]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix compilation error on MSVC due to conflict of different stdlib.h files.
authorBruno Haible <bruno@clisp.org>
Thu, 5 Jun 2025 19:36:47 +0000 (21:36 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 5 Jun 2025 19:36:47 +0000 (21:36 +0200)
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00071.html>.

* autogen.sh: Change gnulib-tool invocation for libgrep.
* gettext-tools/configure.ac (AC_CONFIG_FILES): Add libgrep/gnulib-lib/Makefile.
* gettext-tools/libgrep/Makefile.am: Don't include Makefile.gnulib.
(SUBDIRS): New variable.
(noinst_LIBRARIES): Add libgrep.a.
(AM_CPPFLAGS): Add -I options for gnulib-lib subdirectory.
(libgrep_a_DEPENDENCIES): New variable.
* gettext-tools/libgrep/gnulib-lib/Makefile.am: New file.
* gettext-tools/src/Makefile.am (LIBGREP): Add ../libgrep/gnulib-lib/libgnu.a.

.gitignore
autogen.sh
gettext-tools/configure.ac
gettext-tools/libgrep/Makefile.am
gettext-tools/libgrep/gnulib-lib/Makefile.am [new file with mode: 0644]
gettext-tools/src/Makefile.am

index 43fb153780bacd442f6f492db49842c7febef110..a520ac084a76ea7ad2ff32ee0db7c63df65e279c 100644 (file)
 /gettext-tools/libgettextpo/xstriconv.h
 /gettext-tools/libgettextpo/xvasprintf.c
 /gettext-tools/libgettextpo/xvasprintf.h
-/gettext-tools/libgrep/glthread/
 /gettext-tools/libgrep/gnulib-m4/
-/gettext-tools/libgrep/malloc/
-/gettext-tools/libgrep/Makefile.gnulib
-/gettext-tools/libgrep/_Noreturn.h
-/gettext-tools/libgrep/arg-nonnull.h
-/gettext-tools/libgrep/attribute.h
-/gettext-tools/libgrep/btowc.c
-/gettext-tools/libgrep/c++defs.h
-/gettext-tools/libgrep/cdefs.h
-/gettext-tools/libgrep/dynarray.h
-/gettext-tools/libgrep/fcntl.in.h
-/gettext-tools/libgrep/intprops-internal.h
-/gettext-tools/libgrep/intprops.h
-/gettext-tools/libgrep/inttypes.in.h
-/gettext-tools/libgrep/iswblank.c
-/gettext-tools/libgrep/iswctype-impl.h
-/gettext-tools/libgrep/iswctype.c
-/gettext-tools/libgrep/iswdigit.c
-/gettext-tools/libgrep/iswpunct.c
-/gettext-tools/libgrep/iswxdigit.c
-/gettext-tools/libgrep/langinfo.in.h
-/gettext-tools/libgrep/libc-config.h
-/gettext-tools/libgrep/limits.in.h
-/gettext-tools/libgrep/locale.in.h
-/gettext-tools/libgrep/localeconv.c
-/gettext-tools/libgrep/malloc.c
-/gettext-tools/libgrep/mbrlen.c
-/gettext-tools/libgrep/mbszero.c
-/gettext-tools/libgrep/mbtowc-impl.h
-/gettext-tools/libgrep/mbtowc.c
-/gettext-tools/libgrep/nl_langinfo.c
-/gettext-tools/libgrep/nl_langinfo-lock.c
-/gettext-tools/libgrep/pthread.in.h
-/gettext-tools/libgrep/pthread-once.c
-/gettext-tools/libgrep/regcomp.c
-/gettext-tools/libgrep/regex.c
-/gettext-tools/libgrep/regex.h
-/gettext-tools/libgrep/regex_internal.c
-/gettext-tools/libgrep/regex_internal.h
-/gettext-tools/libgrep/regexec.c
-/gettext-tools/libgrep/sched.in.h
-/gettext-tools/libgrep/stdckdint.in.h
-/gettext-tools/libgrep/stddef.in.h
-/gettext-tools/libgrep/stdint.in.h
-/gettext-tools/libgrep/stdlib.c
-/gettext-tools/libgrep/stdlib.in.h
-/gettext-tools/libgrep/sys_types.in.h
-/gettext-tools/libgrep/time.in.h
-/gettext-tools/libgrep/unistd.c
-/gettext-tools/libgrep/unistd.in.h
-/gettext-tools/libgrep/warn-on-use.h
-/gettext-tools/libgrep/wchar.in.h
-/gettext-tools/libgrep/wcrtomb.c
-/gettext-tools/libgrep/wctype-h.c
-/gettext-tools/libgrep/wctype-impl.h
-/gettext-tools/libgrep/wctype.c
-/gettext-tools/libgrep/wctype.in.h
-/gettext-tools/libgrep/windows-initguard.h
+/gettext-tools/libgrep/gnulib-lib/
+!/gettext-tools/libgrep/gnulib-lib/Makefile.am
 /gettext-tools/man/x-to-1.in
 /gettext-tools/tests/gnulib-m4/
 /gettext-tools/tests/gnulib-lib/
@@ -972,23 +916,6 @@ core
 /gettext-tools/libgettextpo/uniwidth.h
 /gettext-tools/libgettextpo/wchar.h
 /gettext-tools/libgettextpo/wctype.h
-/gettext-tools/libgrep/fcntl.h
-/gettext-tools/libgrep/inttypes.h
-/gettext-tools/libgrep/langinfo.h
-/gettext-tools/libgrep/limits.h
-/gettext-tools/libgrep/locale.h
-/gettext-tools/libgrep/pthread.h
-/gettext-tools/libgrep/sched.h
-/gettext-tools/libgrep/stdbool.h
-/gettext-tools/libgrep/stdckdint.h
-/gettext-tools/libgrep/stddef.h
-/gettext-tools/libgrep/stdint.h
-/gettext-tools/libgrep/stdlib.h
-/gettext-tools/libgrep/time.h
-/gettext-tools/libgrep/unistd.h
-/gettext-tools/libgrep/wchar.h
-/gettext-tools/libgrep/wctype.h
-/gettext-tools/libgrep/sys/types.h
 /gettext-tools/po/??@*.insert-header
 /gettext-tools/src/gettext.res
 /gettext-tools/src/libxgettextts1.a
index b181c523ae8ca522bcdf501d934d1f50d8cea914..d587b53a177b4149a0ef7d50144efef2047b9919 100755 (executable)
@@ -379,7 +379,7 @@ if ! $skip_gnulib; then
     mbrlen
     regex
   '
-  $GNULIB_TOOL --dir=gettext-tools --macro-prefix=grgl --lib=libgrep --source-base=libgrep --m4-base=libgrep/gnulib-m4 --witness-c-macro=IN_GETTEXT_TOOLS_LIBGREP --makefile-name=Makefile.gnulib --local-dir=gnulib-local --local-symlink \
+  $GNULIB_TOOL --dir=gettext-tools --macro-prefix=grgl --source-base=libgrep/gnulib-lib --m4-base=libgrep/gnulib-m4 --makefile-name=Makefile.gnulib --witness-c-macro=IN_GETTEXT_TOOLS_LIBGREP --local-dir=gnulib-local --local-symlink \
     --import \
     `for m in $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES; do \
        if test \`$GNULIB_TOOL --extract-applicability $m\` != all; then \
index 867190217762b36d6066f5830d900fb982150890..ae4434df6dff30b31d0d2f4a626083da785a8b96 100644 (file)
@@ -673,6 +673,7 @@ AC_CONFIG_FILES([its/Makefile])
 AC_CONFIG_FILES([gnulib-lib/Makefile])
 
 AC_CONFIG_FILES([libgrep/Makefile])
+AC_CONFIG_FILES([libgrep/gnulib-lib/Makefile])
 
 AC_CONFIG_FILES([src/Makefile])
 AC_CONFIG_FILES([src/user-email:src/user-email.sh.in])
index 9353631df4aed3252315341e291725d47d2abba2..760b1676ced142004f6450fe24c8d0722a866608 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for libgrep directory in GNU gettext package.
-## Copyright (C) 2005-2024 Free Software Foundation, Inc.
+## Copyright (C) 2005-2025 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -17,6 +17,9 @@
 ## Process this file with automake to produce Makefile.in.
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
+
+SUBDIRS = gnulib-lib
+
 EXTRA_DIST =
 BUILT_SOURCES =
 MOSTLYCLEANFILES = core *.stackdump
@@ -25,26 +28,26 @@ CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
 
-noinst_LIBRARIES =
+noinst_LIBRARIES = libgrep.a
 
 # Note that Automake's $(DEFAULT_INCLUDES) already contains
 # -I. -I$(srcdir) -I$(top_builddir).
 AM_CPPFLAGS = \
+  -Ignulib-lib -I$(srcdir)/gnulib-lib \
   -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
   -I../../gettext-runtime/intl
 
 # Enable more warning options in this directory.
 AM_CFLAGS = @WARN_CFLAGS@
 
-# Rules generated and collected by gnulib-tool, for building libgrep.a.
-include Makefile.gnulib
-
 # Sources that are compiled on all platforms.
 
-libgrep_a_SOURCES += \
+libgrep_a_SOURCES = \
   libgrep.h \
   kwset.h kwset.c \
   m-fgrep.c m-regex.c
 
+libgrep_a_DEPENDENCIES = gnulib-lib/libgnu.a
+
 # Allow users to use "gnulib-tool --update".
 EXTRA_DIST += gnulib-m4/gnulib-cache.m4
diff --git a/gettext-tools/libgrep/gnulib-lib/Makefile.am b/gettext-tools/libgrep/gnulib-lib/Makefile.am
new file mode 100644 (file)
index 0000000..dc8c010
--- /dev/null
@@ -0,0 +1,37 @@
+## Makefile for the gettext-tools/libgrep/gnulib-lib subdirectory of GNU gettext
+## Copyright (C) 2025 Free Software Foundation, Inc.
+##
+## This program 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
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+## Process this file with automake to produce Makefile.in.
+
+AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
+EXTRA_DIST =
+BUILT_SOURCES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+SUFFIXES =
+
+noinst_LIBRARIES =
+
+# Note that Automake's $(DEFAULT_INCLUDES) already contains
+# -I. -I$(srcdir) -I$(top_builddir).
+AM_CPPFLAGS = \
+  -I../../gnulib-lib -I$(top_srcdir)/gnulib-lib
+
+# Rules generated and collected by gnulib-tool.
+include Makefile.gnulib
index 513996cab46f5049a78a6c5c2c52f07b4c2297f0..a5f02c4e3d994d44b5fd0055046bc53aa38f8816 100644 (file)
@@ -279,7 +279,7 @@ libxgettextts4_a_CPPFLAGS = \
 libxgettextts4_a_CFLAGS = $(AM_CFLAGS) @FOREIGN_WARN_CFLAGS@ @NO_EXPENSIVE_WARN_CFLAGS@
 
 # msggrep needs pattern matching.
-LIBGREP = ../libgrep/libgrep.a
+LIBGREP = ../libgrep/libgrep.a ../libgrep/gnulib-lib/libgnu.a
 
 # Source dependencies.
 msgcmp_SOURCES = msgcmp.c