Hi Reuben, > I have made two installations of gnulib in a project, because I am using > both relocatable-prog and relocatable-lib-lgpl. > > I have different modules installed for each, of course. > > I just had a problem where my library would not compile, because it was > missing setlocale_null.h. GNULIB_SETLOCALE_NULL was indeed set to 1 by > configure. > > The "library gnulib" uses only "locale", which does not depend on > setloacle-null, while the "program gnulib" uses "quote", which does. > > I was able to work around this by adding "setlocale" to the library gnulib > (I could not use "quote", as that is a GPL module); but have I done > something wrong here? I can't see how I would fix this in general without > having two configure scripts…
Having two separate configure scripts is undesirable, because that would increase the total configure time of the package (and people have already complained about the configure time). The same problem is seen also in GNU gettext and in GNU poke. I'm fixing it through the attached patch set. So, you can now remove 'setlocale' from the modules of your library again. Bruno
>From db16856ae761bc213942c17f6fc2b7e9655014b4 Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Sun, 11 Apr 2021 15:50:35 +0200 Subject: [PATCH 1/3] Rename GNULIB_OVERRIDES_WINT_T. * GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T. --- ChangeLog | 5 +++++ lib/stdint.in.h | 4 ++-- lib/wchar.in.h | 2 +- lib/wctype.in.h | 10 +++++----- m4/stdint.m4 | 4 ++-- m4/wctype_h.m4 | 4 ++-- m4/wint_t.m4 | 10 +++++----- modules/iswctype | 2 +- modules/stdint | 2 +- modules/wchar | 2 +- modules/wctype-h | 2 +- 11 files changed, 26 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a46d74..303747d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-04-11 Bruno Haible <br...@clisp.org> + Rename GNULIB_OVERRIDES_WINT_T. + * GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T. + +2021-04-11 Bruno Haible <br...@clisp.org> + increment-serial: New program. * build-aux/increment-serial: New file. diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 60f0b4b..c7b00da 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -85,7 +85,7 @@ /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides wint_t. */ -#if @GNULIB_OVERRIDES_WINT_T@ +#if @GNULIBHEADERS_OVERRIDE_WINT_T@ # undef WINT_MIN # undef WINT_MAX # define WINT_MIN 0x0U @@ -598,7 +598,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) /* wint_t limits */ /* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not accurate, therefore use the definitions from above. */ -# if !@GNULIB_OVERRIDES_WINT_T@ +# if !@GNULIBHEADERS_OVERRIDE_WINT_T@ # undef WINT_MIN # undef WINT_MAX # if @HAVE_SIGNED_WINT_T@ diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 4f1239e..cc68c0c 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -111,7 +111,7 @@ /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be "unchanged by default argument promotions". Override it. */ -# if @GNULIB_OVERRIDES_WINT_T@ +# if @GNULIBHEADERS_OVERRIDE_WINT_T@ # if !GNULIB_defined_wint_t # if @HAVE_CRTDEFS_H@ # include <crtdefs.h> diff --git a/lib/wctype.in.h b/lib/wctype.in.h index 82f0977..08b608f 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -103,7 +103,7 @@ _GL_INLINE_HEADER_BEGIN /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be "unchanged by default argument promotions". Override it. */ -# if @GNULIB_OVERRIDES_WINT_T@ +# if @GNULIBHEADERS_OVERRIDE_WINT_T@ # if !GNULIB_defined_wint_t # if @HAVE_CRTDEFS_H@ # include <crtdefs.h> @@ -132,7 +132,7 @@ typedef unsigned int rpl_wint_t; same way, or not at all. */ # if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@ -# if @GNULIB_OVERRIDES_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */ +# if @GNULIBHEADERS_OVERRIDE_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */ _GL_WCTYPE_INLINE int rpl_iswalnum (wint_t wc) @@ -496,7 +496,7 @@ _GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc)); # endif -# if defined __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@ +# if defined __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t. The functions towlower and towupper are implemented in the MSVCRT library @@ -529,7 +529,7 @@ rpl_towupper (wint_t wc) # define towupper rpl_towupper # endif -# endif /* __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@ */ +# endif /* __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ */ # define GNULIB_defined_wctype_functions 1 #endif @@ -646,7 +646,7 @@ _GL_WARN_ON_USE (wctype, "wctype is unportable - " The argument WC must be either a wchar_t value or WEOF. The argument DESC must have been returned by the wctype() function. */ #if @GNULIB_ISWCTYPE@ -# if @GNULIB_OVERRIDES_WINT_T@ +# if @GNULIBHEADERS_OVERRIDE_WINT_T@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef iswctype # define iswctype rpl_iswctype diff --git a/m4/stdint.m4 b/m4/stdint.m4 index a785b44..3406445 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 58 +# stdint.m4 serial 59 dnl Copyright (C) 2001-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -527,7 +527,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. - if test $GNULIB_OVERRIDES_WINT_T = 1; then + if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 index ea5274c..3ac5e64 100644 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,4 +1,4 @@ -# wctype_h.m4 serial 27 +# wctype_h.m4 serial 28 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. @@ -62,7 +62,7 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WCTYPE_H]) - if test $GNULIB_OVERRIDES_WINT_T = 1; then + if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then REPLACE_ISWCNTRL=1 else case "$gl_cv_func_iswcntrl_works" in diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 index 2fc7467..a49c508 100644 --- a/m4/wint_t.m4 +++ b/m4/wint_t.m4 @@ -1,4 +1,4 @@ -# wint_t.m4 serial 10 +# wint_t.m4 serial 11 dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,14 +34,14 @@ AC_DEFUN([gt_TYPE_WINT_T], [gl_cv_type_wint_t_large_enough=yes], [gl_cv_type_wint_t_large_enough=no])]) if test $gl_cv_type_wint_t_large_enough = no; then - GNULIB_OVERRIDES_WINT_T=1 + GNULIBHEADERS_OVERRIDE_WINT_T=1 else - GNULIB_OVERRIDES_WINT_T=0 + GNULIBHEADERS_OVERRIDE_WINT_T=0 fi else - GNULIB_OVERRIDES_WINT_T=0 + GNULIBHEADERS_OVERRIDE_WINT_T=0 fi - AC_SUBST([GNULIB_OVERRIDES_WINT_T]) + AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T]) ]) dnl Prerequisites of the 'wint_t' override. diff --git a/modules/iswctype b/modules/iswctype index 9fce684..8a8343d 100644 --- a/modules/iswctype +++ b/modules/iswctype @@ -17,7 +17,7 @@ wctype-h configure.ac: gl_FUNC_ISWCTYPE -if test $HAVE_WCTYPE_T = 0 || test $GNULIB_OVERRIDES_WINT_T = 1; then +if test $HAVE_WCTYPE_T = 0 || test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then AC_LIBOBJ([iswctype]) fi gl_WCTYPE_MODULE_INDICATOR([iswctype]) diff --git a/modules/stdint b/modules/stdint index 25b9d7f..0c7e878 100644 --- a/modules/stdint +++ b/modules/stdint @@ -56,7 +56,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \ < $(srcdir)/stdint.in.h; \ } > $@-t && \ mv $@-t $@ diff --git a/modules/wchar b/modules/wchar index e5c0da3..7ec1c02 100644 --- a/modules/wchar +++ b/modules/wchar @@ -34,7 +34,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ - -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \ -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ diff --git a/modules/wctype-h b/modules/wctype-h index b7aef46..8da4b8f 100644 --- a/modules/wctype-h +++ b/modules/wctype-h @@ -32,7 +32,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ - -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ + -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ -e 's/@''GNULIB_ISWDIGIT''@/$(GNULIB_ISWDIGIT)/g' \ -e 's/@''GNULIB_ISWXDIGIT''@/$(GNULIB_ISWXDIGIT)/g' \ -- 2.7.4
>From 8b857ed1ad1cbbf265d43016ee7ee93c7b7c6cb4 Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@clisp.org> Date: Sun, 11 Apr 2021 15:54:18 +0200 Subject: [PATCH 2/3] Rename GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T. * GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from GNULIB_OVERRIDES_CHAR16_T. * GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from GNULIB_OVERRIDES_CHAR32_T. --- ChangeLog | 6 ++++++ lib/uchar.in.h | 4 ++-- m4/mbrtoc32.m4 | 6 +++--- m4/uchar.m4 | 10 +++++----- modules/uchar | 4 ++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 303747d..aeb2476 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-04-11 Bruno Haible <br...@clisp.org> + Rename GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T. + * GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from + GNULIB_OVERRIDES_CHAR16_T. + * GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from + GNULIB_OVERRIDES_CHAR32_T. + Rename GNULIB_OVERRIDES_WINT_T. * GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T. diff --git a/lib/uchar.in.h b/lib/uchar.in.h index ba96335..f52535a 100644 --- a/lib/uchar.in.h +++ b/lib/uchar.in.h @@ -47,7 +47,7 @@ on which __STDC_UTF_16__ is defined.) */ typedef uint_least16_t char16_t; -#elif @GNULIB_OVERRIDES_CHAR16_T@ +#elif @GNULIBHEADERS_OVERRIDE_CHAR16_T@ typedef uint_least16_t gl_char16_t; # define char16_t gl_char16_t @@ -61,7 +61,7 @@ typedef uint_least16_t gl_char16_t; on which __STDC_UTF_32__ is defined.) */ typedef uint_least32_t char32_t; -#elif @GNULIB_OVERRIDES_CHAR32_T@ +#elif @GNULIBHEADERS_OVERRIDE_CHAR32_T@ typedef uint_least32_t gl_char32_t; # define char32_t gl_char32_t diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index ba0397b..0966ea1 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 7 +# mbrtoc32.m4 serial 8 dnl Copyright (C) 2014-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_MBRTOC32], if test $gl_cv_func_mbrtoc32 = no; then HAVE_MBRTOC32=0 else - if test $GNULIB_OVERRIDES_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then + if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOC32=1 else gl_MBRTOC32_EMPTY_INPUT @@ -147,7 +147,7 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK], AC_REQUIRE([gt_LOCALE_FR]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - if test $GNULIB_OVERRIDES_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then + if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then HAVE_WORKING_MBRTOC32=0 else AC_CACHE_CHECK([whether mbrtoc32 works as well as mbrtowc], diff --git a/m4/uchar.m4 b/m4/uchar.m4 index 0729541..62c6e06 100644 --- a/m4/uchar.m4 +++ b/m4/uchar.m4 @@ -1,4 +1,4 @@ -# uchar.m4 serial 17 +# uchar.m4 serial 18 dnl Copyright (C) 2019-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -91,7 +91,7 @@ AC_DEFUN_ONCE([gl_TYPE_CHAR16_T], [gl_cv_type_char16_t_works=no]) ]) if test $gl_cv_type_char16_t_works = no; then - GNULIB_OVERRIDES_CHAR16_T=1 + GNULIBHEADERS_OVERRIDE_CHAR16_T=1 fi ]) AC_DEFUN_ONCE([gl_TYPE_CHAR32_T], @@ -112,7 +112,7 @@ AC_DEFUN_ONCE([gl_TYPE_CHAR32_T], [gl_cv_type_char32_t_works=no]) ]) if test $gl_cv_type_char32_t_works = no; then - GNULIB_OVERRIDES_CHAR32_T=1 + GNULIBHEADERS_OVERRIDE_CHAR32_T=1 fi ]) @@ -127,8 +127,8 @@ AC_DEFUN([gl_UCHAR_MODULE_INDICATOR], AC_DEFUN([gl_UCHAR_H_DEFAULTS], [ - gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_CHAR16_T]) - gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_CHAR32_T]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIBHEADERS_OVERRIDE_CHAR16_T]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIBHEADERS_OVERRIDE_CHAR32_T]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOC32]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALNUM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALPHA]) diff --git a/modules/uchar b/modules/uchar index 7cddcad..e449dd9 100644 --- a/modules/uchar +++ b/modules/uchar @@ -29,8 +29,8 @@ uchar.h: uchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) -e 's|@''NEXT_UCHAR_H''@|$(NEXT_UCHAR_H)|g' \ -e 's|@''CXX_HAS_UCHAR_TYPES''@|$(CXX_HAS_UCHAR_TYPES)|g' \ -e 's|@''SMALL_WCHAR_T''@|$(SMALL_WCHAR_T)|g' \ - -e 's|@''GNULIB_OVERRIDES_CHAR16_T''@|$(GNULIB_OVERRIDES_CHAR16_T)|g' \ - -e 's|@''GNULIB_OVERRIDES_CHAR32_T''@|$(GNULIB_OVERRIDES_CHAR32_T)|g' \ + -e 's|@''GNULIBHEADERS_OVERRIDE_CHAR16_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR16_T)|g' \ + -e 's|@''GNULIBHEADERS_OVERRIDE_CHAR32_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR32_T)|g' \ -e 's/@''GNULIB_BTOC32''@/$(GNULIB_BTOC32)/g' \ -e 's/@''GNULIB_C32ISALNUM''@/$(GNULIB_C32ISALNUM)/g' \ -e 's/@''GNULIB_C32ISALPHA''@/$(GNULIB_C32ISALPHA)/g' \ -- 2.7.4
0003-Support-several-gnulib-tool-invocations-under-the-sa.patch.gz
Description: application/gzip