Imported Upstream version 2.6.4
[platform/upstream/harfbuzz.git] / src / check-libstdc++.sh
1 #!/bin/sh
2
3 LC_ALL=C
4 export LC_ALL
5
6 test -z "$srcdir" && srcdir=.
7 test -z "$libs" && libs=.libs
8 stat=0
9
10
11 if which ldd 2>/dev/null >/dev/null; then
12         LDD=ldd
13 else
14         # 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
21 fi
22
23 tested=false
24 # harfbuzz-icu links to libstdc++ because icu does.
25 # harfbuzz-subset uses libstdc++.
26 for soname in harfbuzz harfbuzz-gobject; do
27         for suffix in so dylib; do
28                 so=$libs/lib$soname.$suffix
29                 if ! test -f "$so"; then continue; fi
30
31                 echo "Checking that we are not linking to libstdc++ or libc++ in $so"
32                 if $LDD $so | grep 'libstdc[+][+]\|libc[+][+]'; then
33                         echo "Ouch, linked to libstdc++ or libc++"
34                         stat=1
35                 fi
36                 tested=true
37         done
38 done
39 if ! $tested; then
40         echo "check-libstdc++.sh: libharfbuzz shared library not found; skipping test"
41         exit 77
42 fi
43
44 exit $stat