X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2FMakefile.am;h=edbf95b40ae4e460d16e0823c879a74dd2d61a2d;hb=ecd7492f21a492b70569d5ecc1d3a808241b63f0;hp=ab5b77955492fe6a7a88c3ce107862bea175e12f;hpb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;p=babeltrace.git diff --git a/src/bindings/python/bt2/Makefile.am b/src/bindings/python/bt2/Makefile.am index ab5b7795..edbf95b4 100644 --- a/src/bindings/python/bt2/Makefile.am +++ b/src/bindings/python/bt2/Makefile.am @@ -3,7 +3,7 @@ # 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 @@ -94,11 +94,11 @@ STATIC_BINDINGS_DEPS = \ # Convenience static libraries on which the Python bindings library depends. # These are listed in the setup.py(.in) file. STATIC_LIBRARIES_DEPS = \ - $(top_builddir)/src/autodisc/libbabeltrace2-autodisc.la \ - $(top_builddir)/src/logging/libbabeltrace2-logging.la \ + $(top_builddir)/src/autodisc/libautodisc.la \ + $(top_builddir)/src/logging/liblogging.la \ $(top_builddir)/src/common/libbabeltrace2-common.la \ - $(top_builddir)/src/py-common/libbabeltrace2-py-common.la \ - $(top_builddir)/src/string-format/libbabeltrace2-string-format.la + $(top_builddir)/src/py-common/libpy-common.la \ + $(top_builddir)/src/string-format/libstring-format.la GENERATED_BINDINGS_DEPS = \ bt2/native_bt.c \ @@ -114,6 +114,18 @@ 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 + +# For SWIG generated code +WARN_CFLAGS += -Wno-missing-field-initializers +WARN_CFLAGS += -Wno-unused-parameter + BUILD_FLAGS=CC="$(CC)" \ CFLAGS="$(GLIB_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(WARN_CFLAGS)" \ CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) -I$(srcdir)/bt2" \ @@ -143,12 +155,25 @@ $(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 = @ + +# For Python < 3.12, force the use of distutils even if setuptools is +# installed. For Python >= 3.12, set the externally managed option to allow +# installation in a directory which isn't in the current PYTHONPATH. +if HAVE_PYTHON_312_OR_GREATER +PY_INSTALL_OPTS = --single-version-externally-managed +else +export SETUPTOOLS_USE_DISTUTILS=stdlib +endif + install-exec-local: build-python-bindings.stamp - @opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \ + $(pyinstall_verbose)opts="--prefix=$(prefix) --exec-prefix=$(exec_prefix) --record $(INSTALLED_FILES) --verbose --no-compile $(DISTSETUPOPTS)"; \ if [ "$(DESTDIR)" != "" ]; then \ opts="$$opts --root=$(DESTDIR)"; \ fi; \ - $(PYTHON) $(builddir)/setup.py install $$opts; + $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts; clean-local: rm -rf $(builddir)/build