]> git.draconx.ca Git - cdecl99.git/commitdiff
Don't run configure tests for threading if disabled.
authorNick Bowler <nbowler@draconx.ca>
Fri, 19 Jan 2024 05:14:02 +0000 (00:14 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 19 Jan 2024 05:20:16 +0000 (00:20 -0500)
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.

lib/local/modules/dx-threadlib [new file with mode: 0644]
m4/gnulib-cache.m4

diff --git a/lib/local/modules/dx-threadlib b/lib/local/modules/dx-threadlib
new file mode 100644 (file)
index 0000000..6578fdc
--- /dev/null
@@ -0,0 +1,27 @@
+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
index 13e0fa21a9f329354d3bc91d587530176684aa61..dbd91f018cb486de3f475f5e6421440d9ad60713 100644 (file)
 #  --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])