aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPo Lu2023-07-10 08:21:59 +0800
committerPo Lu2023-07-10 08:21:59 +0800
commit8dd34ad8d80b0bd07cf59add94bfb6a6e52098b2 (patch)
treef08a3a5d9ba5ec5c3c3e47911809eaee21d63327 /m4
parented5ade097e5b675167f9c7e4916a4beec62d118a (diff)
parentb76878cfab1eb681d759ac3b57832baca4df7ef2 (diff)
downloademacs-8dd34ad8d80b0bd07cf59add94bfb6a6e52098b2.tar.gz
emacs-8dd34ad8d80b0bd07cf59add94bfb6a6e52098b2.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'm4')
-rw-r--r--m4/fsusage.m42
-rw-r--r--m4/largefile.m421
-rw-r--r--m4/locale-fr.m4253
-rw-r--r--m4/warnings.m422
4 files changed, 33 insertions, 265 deletions
diff --git a/m4/fsusage.m4 b/m4/fsusage.m4
index 88f3ca817cb..724a863ac30 100644
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -269,7 +269,7 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
269 269
270# Check for SunOS statfs brokenness wrt partitions 2GB and larger. 270# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
271# If <sys/vfs.h> exists and struct statfs has a member named f_spare, 271# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
272# enable the work-around code in fsusage.c. 272# enable the workaround code in fsusage.c.
273AC_DEFUN([gl_STATFS_TRUNCATES], 273AC_DEFUN([gl_STATFS_TRUNCATES],
274[ 274[
275 AC_CACHE_CHECK([for statfs that truncates block counts], 275 AC_CACHE_CHECK([for statfs that truncates block counts],
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index a2adb533ae6..8b051c0042b 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -181,13 +181,16 @@ AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
181# C code used to probe for large file support. 181# C code used to probe for large file support.
182m4_define([_AC_SYS_LARGEFILE_TEST_CODE], 182m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
183[@%:@include <sys/types.h> 183[@%:@include <sys/types.h>
184 /* Check that off_t can represent 2**63 - 1 correctly. 184@%:@ifndef FTYPE
185 We can't simply define LARGE_OFF_T to be 9223372036854775807, 185@%:@ define FTYPE off_t
186@%:@endif
187 /* Check that FTYPE can represent 2**63 - 1 correctly.
188 We can't simply define LARGE_FTYPE to be 9223372036854775807,
186 since some C++ compilers masquerading as C compilers 189 since some C++ compilers masquerading as C compilers
187 incorrectly reject 9223372036854775807. */ 190 incorrectly reject 9223372036854775807. */
188@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) 191@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31))
189 int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 192 int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721
190 && LARGE_OFF_T % 2147483647 == 1) 193 && LARGE_FTYPE % 2147483647 == 1)
191 ? 1 : -1]];[]dnl 194 ? 1 : -1]];[]dnl
192]) 195])
193# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it. 196# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it.
@@ -227,7 +230,13 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
227 AS_IF([test x"$ac_opt" != x"none needed"], 230 AS_IF([test x"$ac_opt" != x"none needed"],
228 [CC="$ac_save_CC $ac_opt"]) 231 [CC="$ac_save_CC $ac_opt"])
229 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], 232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
230 [ac_cv_sys_largefile_opts="$ac_opt" 233 [AS_IF([test x"$ac_opt" = x"none needed"],
234 [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
235 CC="$CC -DFTYPE=ino_t"
236 AC_COMPILE_IFELSE([], [],
237 [CC="$CC -D_FILE_OFFSET_BITS=64"
238 AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])])
239 ac_cv_sys_largefile_opts=$ac_opt
231 ac_opt_found=yes]) 240 ac_opt_found=yes])
232 test $ac_opt_found = no || break 241 test $ac_opt_found = no || break
233 done 242 done
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
deleted file mode 100644
index 5e13f3945d2..00000000000
--- a/m4/locale-fr.m4
+++ /dev/null
@@ -1,253 +0,0 @@
1# locale-fr.m4 serial 21
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9dnl Determine the name of a french locale with traditional encoding.
10AC_DEFUN_ONCE([gt_LOCALE_FR],
11[
12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
15 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
16#include <locale.h>
17#include <time.h>
18#if HAVE_LANGINFO_CODESET
19# include <langinfo.h>
20#endif
21#include <stdlib.h>
22#include <string.h>
23struct tm t;
24char buf[16];
25int main () {
26 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
27 imitates locale dependent behaviour by looking at the environment
28 variables, and all locales use the UTF-8 encoding. */
29#if defined __BEOS__ || defined __HAIKU__
30 return 1;
31#else
32 /* Check whether the given locale name is recognized by the system. */
33# if defined _WIN32 && !defined __CYGWIN__
34 /* On native Windows, setlocale(category, "") looks at the system settings,
35 not at the environment variables. Also, when an encoding suffix such
36 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
37 category of the locale to "C". */
38 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
39 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
40 return 1;
41# else
42 if (setlocale (LC_ALL, "") == NULL) return 1;
43# endif
44 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
45 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
46 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
47 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
48 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
49 some unit tests fail.
50 On MirBSD 10, when an unsupported locale is specified, setlocale()
51 succeeds but then nl_langinfo(CODESET) is "UTF-8". */
52# if HAVE_LANGINFO_CODESET
53 {
54 const char *cs = nl_langinfo (CODESET);
55 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
56 || strcmp (cs, "UTF-8") == 0)
57 return 1;
58 }
59# endif
60# ifdef __CYGWIN__
61 /* On Cygwin, avoid locale names without encoding suffix, because the
62 locale_charset() function relies on the encoding suffix. Note that
63 LC_ALL is set on the command line. */
64 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
65# endif
66 /* Check whether in the abbreviation of the second month, the second
67 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
68 one byte long. This excludes the UTF-8 encoding. */
69 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
70 if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
71# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
72 /* Check whether the decimal separator is a comma.
73 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
74 are nl_langinfo(RADIXCHAR) are both ".". */
75 if (localeconv () ->decimal_point[0] != ',') return 1;
76# endif
77 return 0;
78#endif
79}
80 ]])])
81 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
82 case "$host_os" in
83 # Handle native Windows specially, because there setlocale() interprets
84 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
85 # "fr" or "fra" as "French" or "French_France.1252",
86 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
87 # "ja" as "Japanese" or "Japanese_Japan.932",
88 # and similar.
89 mingw*)
90 # Test for the native Windows locale name.
91 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
92 gt_cv_locale_fr=French_France.1252
93 else
94 # None found.
95 gt_cv_locale_fr=none
96 fi
97 ;;
98 *)
99 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
100 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
101 # configure script would override the LC_ALL setting. Likewise for
102 # LC_CTYPE, which is also set at the beginning of the configure script.
103 # Test for the usual locale name.
104 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
105 gt_cv_locale_fr=fr_FR
106 else
107 # Test for the locale name with explicit encoding suffix.
108 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
109 gt_cv_locale_fr=fr_FR.ISO-8859-1
110 else
111 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
112 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
113 gt_cv_locale_fr=fr_FR.ISO8859-1
114 else
115 # Test for the HP-UX locale name.
116 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
117 gt_cv_locale_fr=fr_FR.iso88591
118 else
119 # Test for the Solaris 7 locale name.
120 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
121 gt_cv_locale_fr=fr
122 else
123 # None found.
124 gt_cv_locale_fr=none
125 fi
126 fi
127 fi
128 fi
129 fi
130 ;;
131 esac
132 fi
133 rm -fr conftest*
134 ])
135 LOCALE_FR=$gt_cv_locale_fr
136 AC_SUBST([LOCALE_FR])
137])
138
139dnl Determine the name of a french locale with UTF-8 encoding.
140AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
141[
142 AC_REQUIRE([AM_LANGINFO_CODESET])
143 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
144 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
145#include <locale.h>
146#include <time.h>
147#if HAVE_LANGINFO_CODESET
148# include <langinfo.h>
149#endif
150#include <stdlib.h>
151#include <string.h>
152struct tm t;
153char buf[16];
154int main () {
155 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
156 imitates locale dependent behaviour by looking at the environment
157 variables, and all locales use the UTF-8 encoding. */
158#if !(defined __BEOS__ || defined __HAIKU__)
159 /* Check whether the given locale name is recognized by the system. */
160# if defined _WIN32 && !defined __CYGWIN__
161 /* On native Windows, setlocale(category, "") looks at the system settings,
162 not at the environment variables. Also, when an encoding suffix such
163 as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
164 category of the locale to "C". */
165 if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
166 || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
167 return 1;
168# else
169 if (setlocale (LC_ALL, "") == NULL) return 1;
170# endif
171 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
172 On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
173 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
174 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
175 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
176 some unit tests fail. */
177# if HAVE_LANGINFO_CODESET
178 {
179 const char *cs = nl_langinfo (CODESET);
180 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
181 return 1;
182 }
183# endif
184# ifdef __CYGWIN__
185 /* On Cygwin, avoid locale names without encoding suffix, because the
186 locale_charset() function relies on the encoding suffix. Note that
187 LC_ALL is set on the command line. */
188 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
189# endif
190 /* Check whether in the abbreviation of the second month, the second
191 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
192 two bytes long, with UTF-8 encoding. */
193 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
194 if (strftime (buf, sizeof (buf), "%b", &t) < 4
195 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
196 return 1;
197#endif
198#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
199 /* Check whether the decimal separator is a comma.
200 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
201 are nl_langinfo(RADIXCHAR) are both ".". */
202 if (localeconv () ->decimal_point[0] != ',') return 1;
203#endif
204 return 0;
205}
206 ]])])
207 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
208 case "$host_os" in
209 # Handle native Windows specially, because there setlocale() interprets
210 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
211 # "fr" or "fra" as "French" or "French_France.1252",
212 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
213 # "ja" as "Japanese" or "Japanese_Japan.932",
214 # and similar.
215 mingw*)
216 # Test for the hypothetical native Windows locale name.
217 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
218 gt_cv_locale_fr_utf8=French_France.65001
219 else
220 # None found.
221 gt_cv_locale_fr_utf8=none
222 fi
223 ;;
224 *)
225 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
226 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
227 # configure script would override the LC_ALL setting. Likewise for
228 # LC_CTYPE, which is also set at the beginning of the configure script.
229 # Test for the usual locale name.
230 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
231 gt_cv_locale_fr_utf8=fr_FR
232 else
233 # Test for the locale name with explicit encoding suffix.
234 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
235 gt_cv_locale_fr_utf8=fr_FR.UTF-8
236 else
237 # Test for the Solaris 7 locale name.
238 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
239 gt_cv_locale_fr_utf8=fr.UTF-8
240 else
241 # None found.
242 gt_cv_locale_fr_utf8=none
243 fi
244 fi
245 fi
246 ;;
247 esac
248 fi
249 rm -fr conftest*
250 ])
251 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
252 AC_SUBST([LOCALE_FR_UTF8])
253])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 1a3107f846d..9433cb523bf 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
1# warnings.m4 serial 18 1# warnings.m4 serial 19
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -81,12 +81,14 @@ AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
81# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS], 81# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
82# [PROGRAM = AC_LANG_PROGRAM()]) 82# [PROGRAM = AC_LANG_PROGRAM()])
83# ----------------------------------------------------------- 83# -----------------------------------------------------------
84# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it 84# Adds OPTION to VARIABLE (which defaults to WARN_CFLAGS or WARN_CXXFLAGS)
85# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). 85# if the compiler supports it when compiling PROGRAM.
86# 86#
87# If VARIABLE is a variable name, AC_SUBST it. 87# If VARIABLE is a variable name, AC_SUBST it.
88# 88#
89# The effects of this macro depend on the current language (_AC_LANG). 89# The effects of this macro depend on the current language (_AC_LANG).
90#
91# Example: gl_WARN_ADD([-Wparentheses]).
90AC_DEFUN([gl_WARN_ADD], 92AC_DEFUN([gl_WARN_ADD],
91[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)]) 93[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
92gl_COMPILER_OPTION_IF([$1], 94gl_COMPILER_OPTION_IF([$1],
@@ -123,7 +125,12 @@ AC_DEFUN([gl_CC_INHIBIT_WARNINGS],
123 ]) 125 ])
124 case "$gl_cv_cc_winhibit" in 126 case "$gl_cv_cc_winhibit" in
125 none) GL_CFLAG_INHIBIT_WARNINGS='' ;; 127 none) GL_CFLAG_INHIBIT_WARNINGS='' ;;
126 *) GL_CFLAG_INHIBIT_WARNINGS="$gl_cv_cc_winhibit" ;; 128 *)
129 GL_CFLAG_INHIBIT_WARNINGS="$gl_cv_cc_winhibit"
130 dnl If all warnings are inhibited, there's no point in having the GCC
131 dnl analyzer enabled. This saves RAM requirements and CPU consumption.
132 gl_WARN_ADD([-fno-analyzer], [GL_CFLAG_INHIBIT_WARNINGS])
133 ;;
127 esac 134 esac
128 AC_SUBST([GL_CFLAG_INHIBIT_WARNINGS]) 135 AC_SUBST([GL_CFLAG_INHIBIT_WARNINGS])
129]) 136])
@@ -150,7 +157,12 @@ AC_DEFUN([gl_CXX_INHIBIT_WARNINGS],
150 ]) 157 ])
151 case "$gl_cv_cxx_winhibit" in 158 case "$gl_cv_cxx_winhibit" in
152 none) GL_CXXFLAG_INHIBIT_WARNINGS='' ;; 159 none) GL_CXXFLAG_INHIBIT_WARNINGS='' ;;
153 *) GL_CXXFLAG_INHIBIT_WARNINGS="$gl_cv_cxx_winhibit" ;; 160 *)
161 GL_CXXFLAG_INHIBIT_WARNINGS="$gl_cv_cxx_winhibit"
162 dnl If all warnings are inhibited, there's no point in having the GCC
163 dnl analyzer enabled. This saves RAM requirements and CPU consumption.
164 gl_WARN_ADD([-fno-analyzer], [GL_CXXFLAG_INHIBIT_WARNINGS])
165 ;;
154 esac 166 esac
155 else 167 else
156 GL_CXXFLAG_INHIBIT_WARNINGS='' 168 GL_CXXFLAG_INHIBIT_WARNINGS=''