]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Remove a .m4 file that duplicates gnulib functionality.
authorBruno Haible <bruno@clisp.org>
Sun, 18 Jun 2023 13:22:52 +0000 (15:22 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 18 Jun 2023 13:22:52 +0000 (15:22 +0200)
* 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.

gettext-runtime/intl/configure.ac
gettext-runtime/libasprintf/configure.ac
gettext-runtime/m4/Makefile.am
gettext-runtime/m4/printf-posix.m4 [deleted file]

index b525e15e62d7232f36d7419bba880a4c2d525acc..9a80546efca7df68c18ba6fdc6d8259e37a48cdb 100644 (file)
@@ -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])
 
index 2fe76cf0206f6e8a57e6c5a5501320bf6725a2d4..1c69a4e231aa0db926a64016c98160160b213a96 100644 (file)
@@ -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 <stdio.h>])
-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_".
index 8c3b3a25f2e3232ef2dcc6d650e0b5ea25690544..327ee0b8c5948c99f92df7cf402eed8c91a451ca 100644 (file)
@@ -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 (file)
index 12b6cc5..0000000
+++ /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 <stdio.h>
-#include <string.h>
-/* 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
-])