From: Nick Bowler Date: Sun, 3 Dec 2023 21:54:07 +0000 (-0500) Subject: Don't build locale/wcwidth junk if NLS is disabled. X-Git-Tag: v1.3~75 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/85a6a8c5ddb83606fb27617b9c81c8bcc6b35408 Don't build locale/wcwidth junk if NLS is disabled. 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. --- diff --git a/common b/common index 1566158..9cacb90 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 156615815cd9db9dfc55356939ec15d5d2ea5180 +Subproject commit 9cacb902a5d6f6c4271ee3066e2efe13663f145a diff --git a/configure.ac b/configure.ac index 0b23f6b..6d4bf6c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 f0d3a4d..8c4f4d7 160000 --- 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 index 0000000..b150d30 --- /dev/null +++ b/lib/local/modules/dx-nls @@ -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 diff --git a/lib/local/modules/gnulib-local b/lib/local/modules/gnulib-local index 20e3120..ed362f6 100644 --- a/lib/local/modules/gnulib-local +++ b/lib/local/modules/gnulib-local @@ -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; \ diff --git a/lib/local/modules/readline b/lib/local/modules/readline index 3a9c7f4..4a07ff6 100644 --- a/lib/local/modules/readline +++ b/lib/local/modules/readline @@ -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 diff --git a/m4/.gitignore b/m4/.gitignore index 37b4b19..896684f 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -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 @@ -44,46 +29,33 @@ /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 diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index a246eab..e06a0a7 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -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, @@ -41,26 +41,24 @@ # --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 ])