Show python bindings install output in verbose builds
[babeltrace.git] / src / bindings / python / bt2 / Makefile.am
index fe401978016b80e37d6bbbdba56616697fdfaa52..124fadaf47d813eb6b25a2bb4f424204f7fae09b 100644 (file)
@@ -1,7 +1,9 @@
+# SPDX-License-Identifier: MIT
+
 # Since the shared object used by the python bindings is not built with
 # libtool, we need to add the directory containing libbabeltrace2 to the
 # linker path.
-AM_LDFLAGS=-L$(top_builddir)/src/lib/.libs
+AM_LDFLAGS += -L$(top_builddir)/src/lib/.libs
 
 INSTALLED_FILES=$(builddir)/installed_files.txt
 
@@ -17,6 +19,7 @@ SWIG_INTERFACE_FILES =                                        \
        bt2/native_bt_component_class.i.h               \
        bt2/native_bt_connection.i                      \
        bt2/native_bt_error.i                           \
+       bt2/native_bt_error.i.h                         \
        bt2/native_bt_event.i                           \
        bt2/native_bt_event_class.i                     \
        bt2/native_bt_field.i                           \
@@ -94,17 +97,35 @@ STATIC_LIBRARIES_DEPS = \
        $(top_builddir)/src/autodisc/libbabeltrace2-autodisc.la \
        $(top_builddir)/src/logging/libbabeltrace2-logging.la \
        $(top_builddir)/src/common/libbabeltrace2-common.la \
-       $(top_builddir)/src/py-common/libbabeltrace2-py-common.la
+       $(top_builddir)/src/py-common/libbabeltrace2-py-common.la \
+       $(top_builddir)/src/string-format/libbabeltrace2-string-format.la
 
 GENERATED_BINDINGS_DEPS =      \
        bt2/native_bt.c         \
        bt2/version.py          \
        setup.py
 
+# Some versions of SWIG (like 3.0.12) generate code where a parameter called
+# `swig_this` shadows a global of the same name.  Later versions (like 4.0.1)
+# have renamed this global to `Swig_This_global`.
+#
+# Disable -Wshadow for that file.
+WARN_CFLAGS = -Wno-shadow
+
+WARN_CFLAGS += -Wno-null-dereference
+
+# Python 3.8 with SWIG 4.0.2 generates a deprecated warning for 'tp_print'
+# and in general there is not much we can do about deprecations in generated
+# code.
+WARN_CFLAGS += -Wno-deprecated-declarations
+
+# Python 3.11 + gcc 12.2.0 gave warnings of this kind in Python.h.
+WARN_CFLAGS += -Wno-redundant-decls
+
 BUILD_FLAGS=CC="$(CC)" \
-               CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS)" \
+               CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \
                CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) -I$(srcdir)/bt2" \
-               LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(GLIB_LIBS) $(LIBS)"
+               LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS) $(GLIB_LIBS) $(PYTHON_LDFLAGS) $(LIBS)"
 
 all-local: build-python-bindings.stamp
 
@@ -130,8 +151,12 @@ $(builddir)/bt2/native_bt.c: $(SWIG_INTERFACE_FILES)
 
 -include bt2/native_bt.d
 
+pyinstall_verbose = $(pyinstall_verbose_@AM_V@)
+pyinstall_verbose_ = $(pyinstall_verbose_@AM_DEFAULT_V@)
+pyinstall_verbose_0 = @
+
 install-exec-local: build-python-bindings.stamp
-       @opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \
+       $(pyinstall_verbose)opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \
        if [ "$(DESTDIR)" != "" ]; then \
                opts="$$opts --root=$(DESTDIR)"; \
        fi; \
This page took 0.02447 seconds and 4 git commands to generate.