diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /gfx/harfbuzz/src/check-libstdc++.py | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/harfbuzz/src/check-libstdc++.py')
-rwxr-xr-x | gfx/harfbuzz/src/check-libstdc++.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gfx/harfbuzz/src/check-libstdc++.py b/gfx/harfbuzz/src/check-libstdc++.py new file mode 100755 index 0000000000..e70d5f80b2 --- /dev/null +++ b/gfx/harfbuzz/src/check-libstdc++.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +import sys, os, shutil, subprocess + +os.chdir (os.getenv ('srcdir', os.path.dirname (__file__))) + +libs = os.getenv ('libs', '.libs') + +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 (libs, '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) |