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 |
Behdad Esfahbod | a981d79 | 2018-02-10 15:17:28 -0600 | [diff] [blame] | 24 | # harfbuzz-icu links to libstdc++ because icu does. |
Behdad Esfahbod | 42040a2 | 2018-02-12 18:41:36 -0800 | [diff] [blame] | 25 | # harfbuzz-subset uses libstdc++. |
| 26 | for soname in harfbuzz harfbuzz-gobject; do |
Ebrahim Byagowi | 844f48e | 2018-02-10 23:13:12 +0330 | [diff] [blame] | 27 | for suffix in so dylib; do |
| 28 | so=$libs/lib$soname.$suffix |
| 29 | if ! test -f "$so"; then continue; fi |
Behdad Esfahbod | 8c6bd34 | 2014-08-14 13:33:37 -0400 | [diff] [blame] | 30 | |
Behdad Esfahbod | a981d79 | 2018-02-10 15:17:28 -0600 | [diff] [blame] | 31 | echo "Checking that we are not linking to libstdc++ or libc++ in $so" |
Ebrahim Byagowi | 844f48e | 2018-02-10 23:13:12 +0330 | [diff] [blame] | 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 |
Behdad Esfahbod | 134aa7b | 2012-01-27 02:09:40 -0500 | [diff] [blame] | 38 | done |
| 39 | if ! $tested; then |
Behdad Esfahbod | d59e28e | 2012-08-28 19:08:36 -0400 | [diff] [blame] | 40 | echo "check-libstdc++.sh: libharfbuzz shared library not found; skipping test" |
Behdad Esfahbod | 4538efa | 2011-08-05 20:11:06 -0400 | [diff] [blame] | 41 | exit 77 |
Behdad Esfahbod | 21d0fce | 2009-11-03 14:28:32 -0500 | [diff] [blame] | 42 | fi |
| 43 | |
| 44 | exit $stat |