From: Bruno Haible Date: Thu, 5 Jun 2025 09:05:24 +0000 (+0200) Subject: Fix compilation error on MSVC due to conflict of different stdlib.h files. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c97e89ea645dd2c858ac99a320874f6e60bd07d1;p=thirdparty%2Fgettext.git Fix compilation error on MSVC due to conflict of different stdlib.h files. Reported by Kirill Makurin in . * 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. --- diff --git a/.gitignore b/.gitignore index 89a24cdd4..7a2369676 100644 --- a/.gitignore +++ b/.gitignore @@ -309,59 +309,9 @@ /gettext-tools/libgettextpo/xstriconv.h /gettext-tools/libgettextpo/xvasprintf.c /gettext-tools/libgettextpo/xvasprintf.h -/gettext-tools/libgrep/glthread/ -/gettext-tools/libgrep/malloc/ /gettext-tools/libgrep/gnulib-m4/ -/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/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/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/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/stdbool.in.h -/gettext-tools/libgrep/stdckdint.in.h -/gettext-tools/libgrep/stddef.in.h -/gettext-tools/libgrep/stdint.in.h -/gettext-tools/libgrep/stdlib.in.h -/gettext-tools/libgrep/sys_types.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/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/wcrtomb.c +/gettext-tools/libgrep/gnulib-lib/ +!/gettext-tools/libgrep/gnulib-lib/Makefile.am /gettext-tools/man/x-to-1.in /gettext-tools/tests/init.sh @@ -896,19 +846,6 @@ core /gettext-tools/libgettextpo/uniwidth.h /gettext-tools/libgettextpo/wchar.h /gettext-tools/libgettextpo/wctype.h -/gettext-tools/libgrep/inttypes.h -/gettext-tools/libgrep/langinfo.h -/gettext-tools/libgrep/limits.h -/gettext-tools/libgrep/locale.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/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/po/remove-potcdate.sed /gettext-tools/src/gettext.res diff --git a/autogen.sh b/autogen.sh index 462a6b207..4522ac450 100755 --- a/autogen.sh +++ b/autogen.sh @@ -6,7 +6,7 @@ # # This script requires autoconf-2.64..2.71 and automake-1.13..1.16 in the PATH. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-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 @@ -314,7 +314,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 \ diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 36a9f185b..6616a510e 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-tools directory of GNU gettext -dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -628,6 +628,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]) diff --git a/gettext-tools/libgrep/Makefile.am b/gettext-tools/libgrep/Makefile.am index ea5e4f5d0..826872736 100644 --- a/gettext-tools/libgrep/Makefile.am +++ b/gettext-tools/libgrep/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for libgrep directory in GNU gettext package. -## Copyright (C) 2005-2007, 2009-2010, 2014, 2021, 2023 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 no-dependencies subdir-objects + +SUBDIRS = gnulib-lib + EXTRA_DIST = BUILT_SOURCES = MOSTLYCLEANFILES = core *.stackdump @@ -25,22 +28,25 @@ CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = -noinst_LIBRARIES = +noinst_LIBRARIES = libgrep.a -AM_CPPFLAGS = -I.. -I../gnulib-lib -I$(top_srcdir)/gnulib-lib -I../../gettext-runtime/intl +AM_CPPFLAGS = \ + -I.. \ + -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 index 000000000..dc8c010c5 --- /dev/null +++ b/gettext-tools/libgrep/gnulib-lib/Makefile.am @@ -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 . + +## 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 diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 89697fcb1..5f10db3ca 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -205,7 +205,7 @@ libgettextsrc_la_SOURCES = \ search-path.c # msggrep needs pattern matching. -LIBGREP = ../libgrep/libgrep.a +LIBGREP = ../libgrep/libgrep.a ../libgrep/gnulib-lib/libgnu.a # Source dependencies. msgcmp_SOURCES = msgcmp.c