issue #8274: Port .def files check in meson.

The check script now takes into account both the autotools and meson
file hierarchy (in autotools, built libs are in .libs/ subdirs).

Also it now properly fails on missing lib.
This commit is contained in:
Jehan 2022-07-31 20:03:12 +02:00
parent 9f60d24581
commit 4c77c5acaf
2 changed files with 41 additions and 2 deletions

View file

@ -491,3 +491,36 @@ else
)
endif
endif
if have_python
# Check .def files for Windows.
custom_target('check-def-files',
input: [
'../libgimpbase/gimpbase.def',
'../libgimpcolor/gimpcolor.def',
'../libgimpconfig/gimpconfig.def',
'../libgimp/gimp.def',
'../libgimp/gimpui.def',
'../libgimpmath/gimpmath.def',
'../libgimpmodule/gimpmodule.def',
'../libgimpthumb/gimpthumb.def',
'../libgimpwidgets/gimpwidgets.def',
],
depends: [
libgimpbase,
libgimpcolor,
libgimpconfig,
libgimp,
libgimpui,
libgimpmath,
libgimpmodule,
libgimpthumb,
libgimpwidgets
],
output: [ 'check-def-files', ],
command: [
python, meson.source_root() / 'tools' / 'defcheck.py', meson.source_root(),
],
build_by_default: true,
)
endif

View file

@ -84,8 +84,14 @@ for df in def_files:
status, nm = subprocess.getstatusoutput ("nm --defined-only --extern-only " +
libname)
if status != 0:
print("trouble reading %s - has it been compiled?" % libname)
continue
libname_meson = path.join(directory, "lib" + basename + "-*.so")
print("trouble reading {} - trying {}".format(libname, libname_meson))
status, nm = subprocess.getstatusoutput ("nm --defined-only --extern-only " +
libname_meson)
if status != 0:
print("trouble reading {} - has it been compiled?".format(libname_meson))
have_errors = -1
continue
nmsymbols = nm.split()[2::3]
nmsymbols = [s for s in nmsymbols if s[0] != '_']