Support for pthreads can be forcibly disabled by passing "--without-pthread" to the configure script. The actual changes in this commit are in configure.ac and MCONFIG.in; the other files were generated as a result of running aclocal, autoconf, and autoheader on a Debian testing system. Note: the autoconf-archive package must now be installed before rerunning aclocal, to supply the AX_PTHREAD macro. Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> --- [ I've removed the diffs of the generated files since they would make the diff too large for the vger mailing lists. --Ted ] MCONFIG.in | 12 +- aclocal.m4 | 486 +++++++++++++++++++++++++++++ configure | 814 +++++++++++++++++++++++++++++++++++++++++++----- configure.ac | 24 ++ lib/config.h.in | 351 +-------------------- 5 files changed, 1271 insertions(+), 416 deletions(-) diff --git a/MCONFIG.in b/MCONFIG.in index 0598f21b7..69f30674e 100644 --- a/MCONFIG.in +++ b/MCONFIG.in @@ -86,15 +86,17 @@ SYSTEMD_SYSTEM_UNIT_DIR = @systemd_system_unit_dir@ SANITIZER_CFLAGS = @lto_cflags@ @ubsan_cflags@ @addrsan_cflags@ @threadsan_cflags@ SANITIZER_LDFLAGS = @lto_ldflags@ @ubsan_ldflags@ @addrsan_ldflags@ @threadsan_ldflags@ -CC = @CC@ +CC = @PTHREAD_CC@ BUILD_CC = @BUILD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ CFLAGS = @CFLAGS@ CFLAGS_SHLIB = @CFLAGS_SHLIB@ CFLAGS_STLIB = @CFLAGS_STLIB@ CPPFLAGS = @INCLUDES@ -ALL_CFLAGS = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) -ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_SHLIB) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) -ALL_CFLAGS_STLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_STLIB) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) +ALL_CFLAGS = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) +ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_SHLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) +ALL_CFLAGS_STLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_STLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS) LDFLAGS = $(SANITIZER_LDFLAGS) @LDFLAGS@ LDFLAGS_SHLIB = $(SANITIZER_LDFLAGS) @LDFLAGS_SHLIB@ ALL_LDFLAGS = $(LDFLAGS) @LDFLAG_DYNAMIC@ @@ -139,7 +141,7 @@ LIBFUSE = @FUSE_LIB@ LIBSUPPORT = $(LIBINTL) $(LIB)/libsupport@STATIC_LIB_EXT@ LIBBLKID = @LIBBLKID@ @PRIVATE_LIBS_CMT@ $(LIBUUID) LIBINTL = @LIBINTL@ -SYSLIBS = @LIBS@ +SYSLIBS = @LIBS@ @PTHREAD_LIBS@ DEPLIBSS = $(LIB)/libss@LIB_EXT@ DEPLIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@ DEPLIBUUID = @DEPLIBUUID@ diff --git a/configure.ac b/configure.ac index 6cb335d7d..d3d9ae07a 100644 --- a/configure.ac +++ b/configure.ac @@ -773,6 +773,30 @@ fi dnl dnl dnl +AC_ARG_WITH([pthread], +[ --without-pthread disable use of pthread support], +[if test "$withval" = "no" +then + try_pthread="" + AC_MSG_RESULT([Disabling pthread support]) +else + try_pthread="yes" + AC_MSG_RESULT([Testing for pthread support]) +fi] +, +try_pthread="yes" +AC_MSG_RESULT([Try testing for pthread support by default]) +) +if test "$try_pthread" = "yes" +then +AX_PTHREAD +else +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +AC_SUBST([PTHREAD_CC]) +fi +dnl +dnl +dnl AH_TEMPLATE([USE_UUIDD], [Define to 1 to build uuidd]) AC_ARG_ENABLE([uuidd], [ --disable-uuidd disable building the uuid daemon], -- 2.28.0