Skip to content

Commit 9f1bade

Browse files
committed
bindings: add check-local for python module underlinkage
Add check-local targets for python3 bindings that rebuild with -Wl,--no-undefined using python3-config --embed --libs. This makes make check catch unresolved Py* symbols in module link steps.
1 parent 58d031d commit 9f1bade

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

bindings/python/python3/Makefile.am

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,13 @@ auparse_la_CFLAGS = -shared
3333
auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro
3434
auparse_la_LIBADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la $(PYTHON3_LIBS)
3535
auparse_la_DEPENDENCIES = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la
36+
37+
check-local:
38+
@python3_embed_libs=`python3-config --embed --libs 2>/dev/null`; \
39+
if test -z "$$python3_embed_libs"; then \
40+
echo "SKIP: python3-config --embed --libs is unavailable"; \
41+
exit 77; \
42+
fi; \
43+
$(MAKE) clean >/dev/null; \
44+
$(MAKE) all-am LDFLAGS="$(LDFLAGS) -Wl,--no-undefined" \
45+
PYTHON3_LIBS="$$python3_embed_libs"

bindings/swig/python3/Makefile.am

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i
3838

3939
CLEANFILES = audit.py* audit_wrap.c *~
4040

41+
check-local:
42+
@python3_embed_libs=`python3-config --embed --libs 2>/dev/null`; \
43+
if test -z "$$python3_embed_libs"; then \
44+
echo "SKIP: python3-config --embed --libs is unavailable"; \
45+
exit 77; \
46+
fi; \
47+
$(MAKE) clean >/dev/null; \
48+
$(MAKE) all-am LDFLAGS="$(LDFLAGS) -Wl,--no-undefined" \
49+
PYTHON3_LIBS="$$python3_embed_libs"

0 commit comments

Comments
 (0)