If the user passes --disable-threads, we shouldn't run all the
configure tests to probe threading system characteristics.
Like with the conditional NLS bits, we create a local "dx-threadlib"
module which uses conditional dependencies to pull in the actual
threading modules.
We additionally have to monkey patch gl_MBRTOWC which hoists the
threading library probes out of the conditional, not so great
(we have disabled the multithread support in gnulib's mbrtowc
replacement anyway) -- this can be done in the new module too.
--- /dev/null
+Description:
+Conditionally pull in gnulib modules for threading support, and work around
+issues related to conditional execution of threading tests.
+
+Files:
+
+Depends-on:
+gnulib-local
+threadlib
+lock [test x"$glthreads_api" != x"none"]
+tls [test x"$glthreads_api" != x"none"]
+
+configure.ac-early:
+dnl AC_REQUIRE has the effect of making the macro expansion unconditional;
+dnl we don't want this: gl_PTHREADLIB will be expanded if it is needed.
+DX_PATCH_MACRO([gl_FUNC_MBRTOWC], [AC_REQUIRE(\[gl_PTHREADLIB\])], [dnl])dnl
+
+configure.ac:
+m4_set_add([DX_GNULIB_LOCAL_DIST], [modules/dx-threadlib])dnl
+
+Makefile.am:
+
+License:
+WTFPL2
+
+Maintainer:
+Nick Bowler
# --avoid=gperf \
# --avoid=std-gnu11 \
# dx-nls \
+# dx-threadlib \
# getopt-gnu \
# gitlog-to-changelog \
# inttypes-incomplete \
-# lock \
# readline \
-# stdbool \
-# tls
+# stdbool
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([lib/local])
gl_MODULES([
dx-nls
+ dx-threadlib
getopt-gnu
gitlog-to-changelog
inttypes-incomplete
- lock
readline
stdbool
- tls
])
gl_AVOID([gperf std-gnu11])
gl_SOURCE_BASE([lib])