Hash :
77c24e8a
Author :
Date :
2025-05-06T13:17:13
[check-*.py] Remove autotoolism Instead of passing source dir and build dir to as envvars, pass them directly as script arguments. The scripts also were supposed to be able to run outsize of the build scripts, but this was broken since the fallback when the envvars were not set was wrong. The HBSOURCES and HBHEADERS are still passed as envvars since they are long lists and might hit command line length limitation on some systems.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#!/usr/bin/env python3
import os
import shutil
import subprocess
import sys
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
os.chdir(srcdir)
ldd = os.getenv("LDD", shutil.which("ldd"))
if not ldd:
otool = os.getenv("OTOOL", shutil.which("otool"))
if otool:
ldd = otool + " -L"
else:
print("check-libstdc++.py: 'ldd' not found; skipping test")
sys.exit(77)
stat = 0
tested = False
# harfbuzz-icu links to libstdc++ because icu does.
for soname in ["harfbuzz", "harfbuzz-subset", "harfbuzz-gobject", "harfbuzz-cairo"]:
for suffix in ["so", "dylib"]:
so = os.path.join(builddir, "lib%s.%s" % (soname, suffix))
if not os.path.exists(so):
continue
print("Checking that we are not linking to libstdc++ or libc++ in %s" % so)
ldd_result = subprocess.check_output(ldd.split() + [so])
if (b"libstdc++" in ldd_result) or (b"libc++" in ldd_result):
print("Ouch, %s is linked to libstdc++ or libc++" % so)
stat = 1
tested = True
if not tested:
print("check-libstdc++.py: libharfbuzz shared library not found; skipping test")
sys.exit(77)
sys.exit(stat)