From: Bruno Haible Date: Sun, 18 Jun 2023 13:22:52 +0000 (+0200) Subject: build: Remove a .m4 file that duplicates gnulib functionality. X-Git-Tag: v0.23~439 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04dce83b0a5e92fdf7947c373b534f3816f2f0d7;p=thirdparty%2Fgettext.git build: Remove a .m4 file that duplicates gnulib functionality. * gettext-runtime/m4/printf-posix.m4: Remove file. * gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it. * gettext-runtime/intl/configure.ac: Use gl_PRINTF_POSITIONS instead of gt_PRINTF_POSIX. * gettext-runtime/libasprintf/configure.ac: Likewise. --- diff --git a/gettext-runtime/intl/configure.ac b/gettext-runtime/intl/configure.ac index b525e15e6..9a80546ef 100644 --- a/gettext-runtime/intl/configure.ac +++ b/gettext-runtime/intl/configure.ac @@ -104,10 +104,16 @@ gl_INIT gt_INTL_SUBDIR_CORE -gt_PRINTF_POSIX -case $gt_cv_func_printf_posix in - *yes) HAVE_POSIX_PRINTF=1 ;; - *) HAVE_POSIX_PRINTF=0 ;; +gl_PRINTF_POSITIONS +case "$gl_cv_func_printf_positions" in + *yes) + AC_DEFINE([HAVE_POSIX_PRINTF], [1], + [Define if your printf() function supports format strings with positions.]) + HAVE_POSIX_PRINTF=1 + ;; + *) + HAVE_POSIX_PRINTF=0 + ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac index 2fe76cf02..1c69a4e23 100644 --- a/gettext-runtime/libasprintf/configure.ac +++ b/gettext-runtime/libasprintf/configure.ac @@ -95,7 +95,14 @@ AC_CHECK_FUNCS([snprintf vasprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [#include ]) -gt_PRINTF_POSIX + +gl_PRINTF_POSITIONS +case "$gl_cv_func_printf_positions" in + *yes) + AC_DEFINE([HAVE_POSIX_PRINTF], [1], + [Define if your printf() function supports format strings with positions.]) + ;; +esac dnl Hide undesired symbols from the global namespace, by prefixing them with dnl "libasprintf_". diff --git a/gettext-runtime/m4/Makefile.am b/gettext-runtime/m4/Makefile.am index 8c3b3a25f..327ee0b8c 100644 --- a/gettext-runtime/m4/Makefile.am +++ b/gettext-runtime/m4/Makefile.am @@ -32,7 +32,6 @@ intmax.m4 \ inttypes_h.m4 \ nls.m4 \ po.m4 \ -printf-posix.m4 \ progtest.m4 \ size_max.m4 \ stdint_h.m4 \ diff --git a/gettext-runtime/m4/printf-posix.m4 b/gettext-runtime/m4/printf-posix.m4 deleted file mode 100644 index 12b6cc5ad..000000000 --- a/gettext-runtime/m4/printf-posix.m4 +++ /dev/null @@ -1,48 +0,0 @@ -# printf-posix.m4 serial 7 (gettext-0.21.1) -dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether the printf() function supports POSIX/XSI format strings with -dnl positions. - -AC_DEFUN([gt_PRINTF_POSIX], -[ - AC_REQUIRE([AC_PROG_CC]) - AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], - [gt_cv_func_printf_posix], - [ - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include -#include -/* The string "%2$d %1$d", with dollar characters protected from the shell's - dollar expansion (possibly an autoconf bug). */ -static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; -static char buf[100]; -int main () -{ - sprintf (buf, format, 33, 55); - return (strcmp (buf, "55 33") != 0); -}]])], - [gt_cv_func_printf_posix=yes], - [gt_cv_func_printf_posix=no], - [ - AC_EGREP_CPP([notposix], [ -#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ - notposix -#endif - ], - [gt_cv_func_printf_posix="guessing no"], - [gt_cv_func_printf_posix="guessing yes"]) - ]) - ]) - case $gt_cv_func_printf_posix in - *yes) - AC_DEFINE([HAVE_POSIX_PRINTF], [1], - [Define if your printf() function supports format strings with positions.]) - ;; - esac -])