blob: 653a566095255558145664bb05a30c4da25f7024 [file] [log] [blame]
Behdad Esfahbod21d0fce2009-11-03 14:28:32 -05001#!/bin/sh
2
3LC_ALL=C
4export LC_ALL
5
Behdad Esfahbod5bc18192011-05-27 15:58:54 -04006test -z "$srcdir" && srcdir=.
Ebrahim Byagowi72bec1c2018-01-05 12:42:20 +03307test -z "$libs" && libs=.libs
Behdad Esfahbod5bc18192011-05-27 15:58:54 -04008stat=0
9
10
Behdad Esfahbod21d0fce2009-11-03 14:28:32 -050011if which ldd 2>/dev/null >/dev/null; then
Ebrahim Byagowi55cae0d2018-01-29 18:05:24 +033012 LDD=ldd
Behdad Esfahbod21d0fce2009-11-03 14:28:32 -050013else
Ebrahim Byagowi55cae0d2018-01-29 18:05:24 +033014 # macOS specific tool
15 if which otool 2>/dev/null >/dev/null; then
16 LDD="otool -L"
17 else
18 echo "check-libstdc++.sh: 'ldd' not found; skipping test"
19 exit 77
20 fi
Behdad Esfahbod21d0fce2009-11-03 14:28:32 -050021fi
22
Behdad Esfahbod134aa7b2012-01-27 02:09:40 -050023tested=false
Ebrahim Byagowi844f48e2018-02-10 23:13:12 +033024for soname in harfbuzz harfbuzz-icu harfbuzz-subset; do
25 for suffix in so dylib; do
26 so=$libs/lib$soname.$suffix
27 if ! test -f "$so"; then continue; fi
Behdad Esfahbod8c6bd342014-08-14 13:33:37 -040028
Ebrahim Byagowi844f48e2018-02-10 23:13:12 +033029 echo "Checking that we are not linking to libstdc++ or libc++"
30 if $LDD $so | grep 'libstdc[+][+]\|libc[+][+]'; then
31 echo "Ouch, linked to libstdc++ or libc++"
32 stat=1
33 fi
34 tested=true
35 done
Behdad Esfahbod134aa7b2012-01-27 02:09:40 -050036done
37if ! $tested; then
Behdad Esfahbodd59e28e2012-08-28 19:08:36 -040038 echo "check-libstdc++.sh: libharfbuzz shared library not found; skipping test"
Behdad Esfahbod4538efa2011-08-05 20:11:06 -040039 exit 77
Behdad Esfahbod21d0fce2009-11-03 14:28:32 -050040fi
41
42exit $stat