[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8c0671b9cbf 02/16: Avoid duplicate configure-time codeset tests
From: |
Paul Eggert |
Subject: |
master 8c0671b9cbf 02/16: Avoid duplicate configure-time codeset tests |
Date: |
Sun, 14 May 2023 22:28:24 -0400 (EDT) |
branch: master
commit 8c0671b9cbf56bec99a7de63ead33076abb754b1
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Avoid duplicate configure-time codeset tests
* admin/merge-gnulib: Copy m4/codeset.m4 too. This is mostly for
documentation, as it’s now automatically copied by other modules.
* configure.ac (EMACS_PAPER_WIDTH): New macro. This relies on
Gnulib, to avoid duplicate tests for HAVE_LANGINFO_CODESET.
---
admin/merge-gnulib | 2 ++
configure.ac | 38 +++++++++++++++-----------------------
2 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 917ddda1fd5..7c82be98608 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -132,5 +132,7 @@ cp -- "$gnulib_srcdir"/build-aux/config.guess \
cp -- "$gnulib_srcdir"/lib/af_alg.h \
"$gnulib_srcdir"/lib/save-cwd.h \
"$src"lib &&
+cp -- "$gnulib_srcdir"/m4/codeset.m4 \
+ "$src"m4 &&
{ test -z "$src" || cd "$src"; } &&
./autogen.sh
diff --git a/configure.ac b/configure.ac
index dd247e144f4..8b08100464e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5409,29 +5409,21 @@ if test "${emacs_cv_links_glib}" = "yes"; then
fi
AC_SUBST([XGSELOBJ])
-dnl Adapted from Haible's version.
-AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
- [[char *cs = nl_langinfo(CODESET);]])],
- [emacs_cv_langinfo_codeset=yes],
- [emacs_cv_langinfo_codeset=no])
- ])
-if test "$emacs_cv_langinfo_codeset" = yes; then
- AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
- [Define if you have <langinfo.h> and nl_langinfo (CODESET).])
-
- AC_CACHE_CHECK([for nl_langinfo and _NL_PAPER_WIDTH],
- [emacs_cv_langinfo__nl_paper_width],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
- [[char *cs = nl_langinfo (_NL_PAPER_WIDTH);]])],
- [emacs_cv_langinfo__nl_paper_width=yes],
- [emacs_cv_langinfo__nl_paper_width=no])
- ])
- if test "$emacs_cv_langinfo__nl_paper_width" = yes; then
- AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], [1],
- [Define if you have <langinfo.h> and nl_langinfo (_NL_PAPER_WIDTH).])
- fi
-fi
+AC_DEFUN([EMACS_PAPER_WIDTH],
+ [AC_REQUIRE([AM_LANGINFO_CODESET])
+ AS_IF([test "$am_cv_langinfo_codeset" = yes],
+ [AC_CACHE_CHECK([for nl_langinfo and _NL_PAPER_WIDTH],
+ [emacs_cv_langinfo__nl_paper_width],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+ [[char *cs = nl_langinfo (_NL_PAPER_WIDTH);]])],
+ [emacs_cv_langinfo__nl_paper_width=yes],
+ [emacs_cv_langinfo__nl_paper_width=no])
+ ])
+ AS_IF([test "$emacs_cv_langinfo__nl_paper_width" = yes],
+ [AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], [1],
+ [Define if you have <langinfo.h>
+ and nl_langinfo (_NL_PAPER_WIDTH).])])])])
+EMACS_PAPER_WIDTH
AC_TYPE_MBSTATE_T
- master updated (e7dc30c1d58 -> ebf5e4ca1cd), Paul Eggert, 2023/05/14
- master b77d357ea35 01/16: Update from Gnulib by running admin/merge-gnulib, Paul Eggert, 2023/05/14
- master 8c0671b9cbf 02/16: Avoid duplicate configure-time codeset tests,
Paul Eggert <=
- master 3e3f34d71e9 03/16: Fix ebrowse -f buffer overflow, Paul Eggert, 2023/05/14
- master 92d4bda2797 04/16: Fix movemail fd leak, Paul Eggert, 2023/05/14
- master 0c11c2ae71f 10/16: Pacify GCC 13 -Wanalyzer-out-of-bounds, Paul Eggert, 2023/05/14
- master 85c4efc9f41 14/16: Prefer UINTMAX_WIDTH in print_object, Paul Eggert, 2023/05/14
- master 919e1b81a4a 11/16: Pacify GCC 13 -Wnull-dereference in itree.c, Paul Eggert, 2023/05/14
- master 67ee74f8e55 05/16: Pacify GCC 13 -fanalyzer in tty_menu_activate, Paul Eggert, 2023/05/14
- master 0b9677a192b 07/16: Work around GCC bug 109579 in ccl.c, Paul Eggert, 2023/05/14
- master 0f5b1fcdf0b 13/16: Help GCC compute modiff_incr, Paul Eggert, 2023/05/14
- master 7166737b5c9 06/16: Work around GCC bug 109577, Paul Eggert, 2023/05/14
- master 9eef5a678c3 08/16: Do not use -Wanalyzer-fd-leak, Paul Eggert, 2023/05/14