• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3LC_ALL=C
4export LC_ALL
5
6test -z "$srcdir" && srcdir=.
7test -z "$libs" && libs=.libs
8stat=0
9
10
11if which ldd 2>/dev/null >/dev/null; then
12	LDD=ldd
13else
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
21fi
22
23tested=false
24# harfbuzz-icu links to libstdc++ because icu does.
25# harfbuzz-subset uses libstdc++.
26for 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
38done
39if ! $tested; then
40	echo "check-libstdc++.sh: libharfbuzz shared library not found; skipping test"
41	exit 77
42fi
43
44exit $stat
45