python: make all _get_ref/_put_ref proper static methods
[babeltrace.git] / configure.ac
index 89884d973eb7b7bc85b4a0024bfe6b97a35db7ea..364ee76205597ea099a069307ca873ea0567ba82 100644 (file)
@@ -211,12 +211,12 @@ AX_PROG_BISON_VERSION([2.5], [have_bison=yes])
 AS_IF([test "x$have_bison" != "xyes"], [
   AE_IF_IN_GIT_REPO([
     AC_MSG_FAILURE([dnl
-Bison >= 2.4 is required when building from the Git repository. You can
+Bison >= 2.5 is required when building from the Git repository. You can
 set the YACC variable to override automatic detection.
     ])
   ], [
     AC_MSG_WARN([dnl
-Missing Bison >= 2.4. Note that the parser files are already built in
+Missing Bison >= 2.5. Note that the parser files are already built in
 this distribution tarball, so Bison is only needed if you intend to
 modify their sources. You can set the YACC variable to override automatic
 detection.
@@ -448,6 +448,7 @@ AE_FEATURE([Werror],[Treat compiler warnings as errors.])
 # When given, build with AddressSanitizer.
 AE_FEATURE_DEFAULT_DISABLE
 AE_FEATURE([asan],[Build with AddressSanitizer.])
+AE_FEATURE([ubsan],[Build with UndefinedBehaviorSanitizer.])
 
 ##                                          ##
 ## Check for conflicting features selection ##
@@ -538,6 +539,16 @@ AS_IF([AE_IS_FEATURE_ENABLED([python-bindings]) || AE_IS_FEATURE_ENABLED([python
   AS_IF([test "x$have_python_dev" = xno], [
     AC_MSG_ERROR([Cannot find a suitable python-config. You can override the python-config path with the PYTHON_CONFIG environment variable.])
   ])
+
+  AX_COMPARE_VERSION(["$PYTHON_VERSION"], [ge], ["3.12"], [
+    AC_MSG_CHECKING([for python setuptools])
+    AS_IF(["$PYTHON" -c "import setuptools" 2>/dev/null], [
+      AC_MSG_RESULT([yes])
+    ], [
+      AC_MSG_RESULT([no])
+      AC_MSG_ERROR([Python >= 3.12 removed 'distutils', the 'setuptools' module needs to be installed for the selected interpreter.])
+    ])
+  ])
 ])
 
 AE_IF_FEATURE_ENABLED([python-bindings-doc],
@@ -645,13 +656,19 @@ AE_IF_FEATURE_ENABLED([asan], [
   ASAN_LDFLAGS="-fsanitize=address"
 ])
 
-
+# If --enable-ubsan is used...
+AE_IF_FEATURE_ENABLED([ubsan], [
+  # ... add -fsanitize=undefined to the *FLAGS variables.
+  UBSAN_CFLAGS="-fsanitize=undefined"
+  UBSAN_CXXFLAGS="-fsanitize=undefined"
+  UBSAN_LDFLAGS="-fsanitize=undefined"
+])
 
 # CFLAGS from libraries (the glib ones are needed for the following sizeof
 # test).
-AM_CFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS}"
-AM_CXXFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS}"
-AM_LDFLAGS="${ASAN_LDFLAGS}"
+AM_CFLAGS="-fvisibility=hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS} ${UBSAN_CFLAGS}"
+AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS} ${UBSAN_CFLAGS}"
+AM_LDFLAGS="${ASAN_LDFLAGS} ${UBSAN_CFLAGS}"
 
 # Check that the current size_t matches the size that glib thinks it should
 # be. This catches problems on multi-arch where people try to do a 32-bit
@@ -704,6 +721,7 @@ m4_define([WARN_FLAGS_LIST], [ dnl
   dnl Clang's does not.  Enable Clang's `-Wshadow-field-in-constructor`, to make
   dnl Clang warn about that.
   -Wshadow-field-in-constructor dnl
+  -Wshadow-field dnl
   -Wjump-misses-init dnl
   -Wsuggest-attribute=format dnl
   -Wtautological-constant-out-of-range-compare dnl
@@ -844,6 +862,7 @@ AC_CONFIG_FILES([
   tests/lib/Makefile
   tests/lib/test-plugin-plugins/Makefile
   tests/lib/conds/Makefile
+  tests/lib/utils/Makefile
   tests/Makefile
   tests/param-validation/Makefile
   tests/plugins/Makefile
This page took 0.025783 seconds and 4 git commands to generate.