Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | LC_ALL=C |
| 4 | export LC_ALL |
| 5 | |
Behdad Esfahbod | 5bc1819 | 2011-05-27 15:58:54 -0400 | [diff] [blame] | 6 | test -z "$srcdir" && srcdir=. |
Ebrahim Byagowi | 72bec1c | 2018-01-05 12:42:20 +0330 | [diff] [blame] | 7 | test -z "$libs" && libs=.libs |
Behdad Esfahbod | 5bc1819 | 2011-05-27 15:58:54 -0400 | [diff] [blame] | 8 | stat=0 |
| 9 | |
| 10 | |
Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 11 | if which ldd 2>/dev/null >/dev/null; then |
Ebrahim Byagowi | 55cae0d | 2018-01-29 18:05:24 +0330 | [diff] [blame] | 12 | LDD=ldd |
Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 13 | else |
Ebrahim Byagowi | 55cae0d | 2018-01-29 18:05:24 +0330 | [diff] [blame] | 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 |
Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 21 | fi |
| 22 | |
Behdad Esfahbod | 134aa7b | 2012-01-27 02:09:40 -0500 | [diff] [blame] | 23 | tested=false |
Ebrahim Byagowi | 844f48e | 2018-02-10 23:13:12 +0330 | [diff] [blame^] | 24 | for 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 Esfahbod | 8c6bd34 | 2014-08-14 13:33:37 -0400 | [diff] [blame] | 28 | |
Ebrahim Byagowi | 844f48e | 2018-02-10 23:13:12 +0330 | [diff] [blame^] | 29 | 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 Esfahbod | 134aa7b | 2012-01-27 02:09:40 -0500 | [diff] [blame] | 36 | done |
| 37 | if ! $tested; then |
Behdad Esfahbod | d59e28e | 2012-08-28 19:08:36 -0400 | [diff] [blame] | 38 | echo "check-libstdc++.sh: libharfbuzz shared library not found; skipping test" |
Behdad Esfahbod | 4538efa | 2011-08-05 20:11:06 -0400 | [diff] [blame] | 39 | exit 77 |
Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 40 | fi |
| 41 | |
| 42 | exit $stat |