]> git.draconx.ca Git - cdecl99.git/commitdiff
Don't build locale/wcwidth junk if NLS is disabled.
authorNick Bowler <nbowler@draconx.ca>
Sun, 3 Dec 2023 21:54:07 +0000 (16:54 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 4 Dec 2023 05:24:25 +0000 (00:24 -0500)
These functions are only used for NLS support, so it is silly to
compile them if NLS is disabled for any reason.

To do this, we create a local "dx-nls" gnulib module which can in
turn use conditional dependencies to pull in all the (now optional)
modules.

It is necessary to update gnulib in order for this to actually work,
as otherwise uniwidth/width is still compiled for some reason, and
it looks like this has been fixed upstream.

common
configure.ac
gnulib
lib/local/modules/dx-nls [new file with mode: 0644]
lib/local/modules/gnulib-local
lib/local/modules/readline
m4/.gitignore
m4/gnulib-cache.m4

diff --git a/common b/common
index 156615815cd9db9dfc55356939ec15d5d2ea5180..9cacb902a5d6f6c4271ee3066e2efe13663f145a 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 156615815cd9db9dfc55356939ec15d5d2ea5180
+Subproject commit 9cacb902a5d6f6c4271ee3066e2efe13663f145a
index 0b23f6b5695b12315253f2abbc91157a2fd03059..6d4bf6cd3a8ff0c520105bd7665316b749ab593c 100644 (file)
@@ -67,13 +67,6 @@ DX_GLSYM_PREFIX([cdecl__gl_])
 DX_GNULIB_SYMFILES([lib/symfiles], [s])
 AM_CONDITIONAL([BUILD_STATIC], [test x"$enable_static" = x"yes"])
 
-dnl We provide our own makefile rules for gettext.  Disable tracing of
-dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and to
-dnl prevent automake from growing gratuitous error conditions.
-m4_traceoff([AM_GNU_GETTEXT])
-AM_GNU_GETTEXT([external])
-DX_LINGUAS
-
 AM_CONDITIONAL([USE_NLS], [test x"$USE_NLS" = x"yes"])
 
 DX_PROG_FLEX([], [have_flex=yes], [have_flex=no])
diff --git a/gnulib b/gnulib
index f0d3a4d726d16b77b3fe7fb155b29ab792452a4f..8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit f0d3a4d726d16b77b3fe7fb155b29ab792452a4f
+Subproject commit 8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482
diff --git a/lib/local/modules/dx-nls b/lib/local/modules/dx-nls
new file mode 100644 (file)
index 0000000..b150d30
--- /dev/null
@@ -0,0 +1,26 @@
+Description:
+blargh
+
+Files:
+
+Depends-on:
+gnulib-local
+gettext-h    [test x"$USE_NLS" = x"yes"]
+localcharset [test x"$USE_NLS" = x"yes"]
+mbswidth     [test x"$USE_NLS" = x"yes"]
+
+configure.ac:
+m4_set_add([DX_GNULIB_LOCAL_DIST], [modules/dx-nls])dnl
+dnl We provide our own makefile rules for gettext.  Avoid tracing of
+dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and
+dnl to prevent Automake from growing gratuitous error conditions.
+m4_indir([AM_GNU_GETTEXT], [external])
+DX_LINGUAS
+
+Makefile.am:
+
+License:
+WTFPL2
+
+Maintainer:
+Nick Bowler
index 20e312093a476168c52c53816fc9733bb550a6f7..ed362f6fa1e33a10722916c1508fd69cf0dc944a 100644 (file)
@@ -3,29 +3,32 @@ Helper to export gnulib-tool local-dir settings to Automake and distribute
 files automatically.
 
 configure.ac:
+m4_set_add([DX_GNULIB_LOCAL_DIST], [modules/gnulib-local])dnl
 AC_REQUIRE([AC_PROG_AWK])dnl
 m4_pushdef([gl_LOCAL_DIR],
-  [m4_define([_GNULIB_LOCAL_DIR_], $][@)])m4_divert_push([KILL])
+  [m4_define([_DX_GNULIB_LOCAL_DIR_], $][@)])m4_divert_push([KILL])
 m4_include([m4/gnulib-cache.m4])
 m4_popdef([gl_LOCAL_DIR])m4_divert_pop([KILL])dnl
-AC_SUBST([GNULIB_LOCAL_DIR], m4_defn([_GNULIB_LOCAL_DIR_]))
+AC_SUBST([DX_GNULIB_LOCAL_DIR], m4_defn([_DX_GNULIB_LOCAL_DIR_]))
+
+AC_CONFIG_COMMANDS_PRE([AC_SUBST([DX_GNULIB_LOCAL_DIST],
+  ["m4_set_dump([DX_GNULIB_LOCAL_DIST], [ ])"])])
 
 Makefile.am:
-GNULIB_LOCAL_DIST = modules/gnulib-local
-GNULIB_LOCAL_DIRS_AWK = \
+DX_GNULIB_LOCAL_DIRS_AWK = \
        { for (i=1; i<=NF; i++) { sub(/\/[^\/]*$$/, "", $$i); dirs[$$i]=1; } } \
        END { for (i in dirs) print outdir "/" i; }
 
 dist-hook: dist-gnulib-local
 dist-gnulib-local:
        save_IFS=$$IFS; \
-       IFS=:; set x $(GNULIB_LOCAL_DIR); shift; \
+       IFS=:; set x $(DX_GNULIB_LOCAL_DIR); shift; \
        IFS=$$save_IFS; \
        outdir="$(top_distdir)/$$1"; \
-       dirs=`echo $(GNULIB_LOCAL_DIST) \
-             | $(AWK) '$(GNULIB_LOCAL_DIRS_AWK)' outdir="$$outdir"`; \
+       dirs=`echo $(DX_GNULIB_LOCAL_DIST) \
+             | $(AWK) '$(DX_GNULIB_LOCAL_DIRS_AWK)' outdir="$$outdir"`; \
        ( set -x; $(MKDIR_P) $$dirs && chmod u+w $$dirs ) || exit; \
-       for f in $(GNULIB_LOCAL_DIST); do \
+       for f in $(DX_GNULIB_LOCAL_DIST); do \
          for indir; do \
            test -f "$(top_srcdir)/$$indir/$$f" || continue; \
            ( set -x; cp -p "$(top_srcdir)/$$indir/$$f" "$$outdir/$$f" ) || exit; \
index 3a9c7f428338fba1937faf5ff55932bc6dca6732..4a07ff6fa1657a08d99ea4da122a643b3e1561e9 100644 (file)
@@ -10,10 +10,10 @@ gnulib-local
 havelib
 
 configure.ac:
+m4_set_add([DX_GNULIB_LOCAL_DIST], [modules/readline])dnl
 gl_FUNC_READLINE
 
 Makefile.am:
-GNULIB_LOCAL_DIST += modules/readline
 
 Include:
 #if HAVE_READLINE_READLINE_H
index 37b4b199c5d7ac99cb6b90652d3179b83ff95bf4..896684f14f11baedc982135e2a6309e9ea86358e 100644 (file)
@@ -1,33 +1,18 @@
-/*.orig
 /00gnulib.m4
 /absolute-header.m4
-/alloca.m4
 /codeset.m4
 /errno_h.m4
-/exponentd.m4
 /extensions.m4
 /extern-inline.m4
-/flexmember.m4
-/float_h.m4
 /getdelim.m4
 /getline.m4
 /getopt.m4
-/gettext.m4
 /gnulib-common.m4
 /gnulib-comp.m4
 /gnulib-tool.m4
 /host-cpu-c-abi.m4
-/iconv.m4
-/iconv_h.m4
-/iconv_open.m4
 /include_next.m4
-/inline.m4
-/intl-thread-locale.m4
-/intlmacosx.m4
-/intmax_t.m4
 /inttypes.m4
-/inttypes_h.m4
-/ldexp.m4
 /lib-ld.m4
 /lib-link.m4
 /lib-prefix.m4
 /ltsugar.m4
 /ltversion.m4
 /lt~obsolete.m4
-/math_h.m4
 /mbrtowc.m4
 /mbsinit.m4
 /mbstate_t.m4
 /mbswidth.m4
-/memchr.m4
-/mmap-anon.m4
 /multiarch.m4
-/nls.m4
 /nocrash.m4
 /off_t.m4
 /pid_t.m4
-/po.m4
-/printf.m4
-/progtest.m4
 /pthread_rwlock_rdlock.m4
 /readline.m4
 /setlocale_null.m4
-/size_max.m4
-/snprintf.m4
 /ssize_t.m4
-/std-gnu11.m4
 /stdbool.m4
 /stddef_h.m4
 /stdint.m4
-/stdint_h.m4
 /stdio_h.m4
-/string_h.m4
+/stdlib_h.m4
 /sys_types_h.m4
 /threadlib.m4
 /tls.m4
 /unistd_h.m4
-/vasnprintf.m4
+/vararrays.m4
 /visibility.m4
-/vsnprintf.m4
 /warn-on-use.m4
 /wchar_h.m4
 /wchar_t.m4
 /wctype_h.m4
 /wcwidth.m4
 /wint_t.m4
-/xsize.m4
 /zzgnulib.m4
index a246eaba2653d557bb924420f189eda817a317dc..e06a0a7eb94969a2d0668256163c9992a47454cd 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright (C) 2002-2021 Free Software Foundation, Inc.
+# Copyright (C) 2002-2022 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This file is distributed in the hope that it will be useful,
 #  --no-vc-files \
 #  --avoid=gperf \
 #  --avoid=std-gnu11 \
+#  dx-nls \
 #  getline \
 #  getopt-gnu \
-#  gettext-h \
 #  gitlog-to-changelog \
-#  localcharset \
+#  inttypes-incomplete \
 #  lock \
-#  mbswidth \
 #  readline \
 #  tls
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([lib/local])
 gl_MODULES([
+  dx-nls
   getline
   getopt-gnu
-  gettext-h
   gitlog-to-changelog
-  localcharset
+  inttypes-incomplete
   lock
-  mbswidth
   readline
   tls
 ])