summaryrefslogtreecommitdiffstats
path: root/gl/m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/00gnulib.m430
-rw-r--r--gl/m4/btowc.m46
-rw-r--r--gl/m4/c-strtod.m46
-rw-r--r--gl/m4/errno_h.m411
-rw-r--r--gl/m4/extensions.m420
-rw-r--r--gl/m4/fcntl_h.m42
-rw-r--r--gl/m4/floorf.m46
-rw-r--r--gl/m4/gnulib-common.m427
-rw-r--r--gl/m4/gnulib-comp.m48
-rw-r--r--gl/m4/include_next.m421
-rw-r--r--gl/m4/inet_ntop.m415
-rw-r--r--gl/m4/lib-link.m417
-rw-r--r--gl/m4/lib-prefix.m47
-rw-r--r--gl/m4/locale-fr.m473
-rw-r--r--gl/m4/locale-ja.m479
-rw-r--r--gl/m4/locale-zh.m463
-rw-r--r--gl/m4/mbrtowc.m481
-rw-r--r--gl/m4/mktime.m49
-rw-r--r--gl/m4/multiarch.m415
-rw-r--r--gl/m4/printf.m4206
-rw-r--r--gl/m4/regex.m411
-rw-r--r--gl/m4/stdint.m472
-rw-r--r--gl/m4/stdio_h.m410
-rw-r--r--gl/m4/stdlib_h.m417
-rw-r--r--gl/m4/strdup.m438
-rw-r--r--gl/m4/sys_socket_h.m465
-rw-r--r--gl/m4/unistd_h.m46
-rw-r--r--gl/m4/vasnprintf.m424
-rw-r--r--gl/m4/wchar.m451
-rw-r--r--gl/m4/wcrtomb.m424
30 files changed, 681 insertions, 339 deletions
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
new file mode 100644
index 00000000..d4d04d15
--- /dev/null
+++ b/gl/m4/00gnulib.m4
@@ -0,0 +1,30 @@
1# 00gnulib.m4 serial 2
2dnl Copyright (C) 2009 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 This file must be named something that sorts before all other
8dnl gnulib-provided .m4 files. It is needed until such time as we can
9dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics.
10
11# AC_DEFUN_ONCE([NAME], VALUE)
12# ----------------------------
13# Define NAME to expand to VALUE on the first use (whether by direct
14# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
15# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
16# definition is slower than the version in Autoconf 2.64, because it
17# can only use interfaces that existed since 2.59; but it achieves the
18# same effect. Quoting is necessary to avoid confusing Automake.
19m4_version_prereq([2.63.263], [],
20[m4_define([AC][_DEFUN_ONCE],
21 [AC][_DEFUN([$1],
22 [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
23 [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
24[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
25
26# gl_00GNULIB
27# -----------
28# Witness macro that this file has been included. Needed to force
29# Automake to include this file prior to all other gnulib .m4 files.
30AC_DEFUN([gl_00GNULIB])
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
index 64ff8290..b46f74fb 100644
--- a/gl/m4/btowc.m4
+++ b/gl/m4/btowc.m4
@@ -1,5 +1,5 @@
1# btowc.m4 serial 3 1# btowc.m4 serial 4
2dnl Copyright (C) 2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -47,7 +47,7 @@ int main ()
47}], 47}],
48 [gl_cv_func_btowc_eof=yes], 48 [gl_cv_func_btowc_eof=yes],
49 [gl_cv_func_btowc_eof=no], 49 [gl_cv_func_btowc_eof=no],
50 []) 50 [:])
51 fi 51 fi
52 ]) 52 ])
53 case "$gl_cv_func_btowc_eof" in 53 case "$gl_cv_func_btowc_eof" in
diff --git a/gl/m4/c-strtod.m4 b/gl/m4/c-strtod.m4
index 0514f2d4..ba954354 100644
--- a/gl/m4/c-strtod.m4
+++ b/gl/m4/c-strtod.m4
@@ -1,4 +1,4 @@
1# c-strtod.m4 serial 10 1# c-strtod.m4 serial 11
2 2
3# Copyright (C) 2004, 2005, 2006, 2009 Free Software Foundation, Inc. 3# Copyright (C) 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
@@ -39,6 +39,8 @@ AC_DEFUN([gl_C_STRTOD],
39 39
40 dnl Prerequisites of lib/c-strtod.c. 40 dnl Prerequisites of lib/c-strtod.c.
41 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 41 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
42
43 AC_REQUIRE([AC_C_INLINE])
42 : 44 :
43]) 45])
44 46
@@ -49,5 +51,7 @@ AC_DEFUN([gl_C_STRTOLD],
49 dnl Prerequisites of lib/c-strtold.c. 51 dnl Prerequisites of lib/c-strtold.c.
50 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 52 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
51 AC_REQUIRE([gl_C99_STRTOLD]) 53 AC_REQUIRE([gl_C99_STRTOLD])
54
55 AC_REQUIRE([AC_C_INLINE])
52 : 56 :
53]) 57])
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 0682d1ab..16188d9b 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,17 +1,10 @@
1# errno_h.m4 serial 3 1# errno_h.m4 serial 5
2dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2004, 2006, 2008, 2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6 6
7AC_DEFUN([gl_HEADER_ERRNO_H], 7AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
8[
9 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
10 dnl once only, before all statements that occur in other macros.
11 AC_REQUIRE([gl_HEADER_ERRNO_H_BODY])
12])
13
14AC_DEFUN([gl_HEADER_ERRNO_H_BODY],
15[ 8[
16 AC_REQUIRE([AC_PROG_CC]) 9 AC_REQUIRE([AC_PROG_CC])
17 AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ 10 AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 611fcfdb..ba6d5e19 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
1# serial 6 -*- Autoconf -*- 1# serial 8 -*- Autoconf -*-
2# Enable extensions on systems that normally disable them. 2# Enable extensions on systems that normally disable them.
3 3
4# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. 4# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation 5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it, 6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved. 7# with or without modifications, as long as this notice is preserved.
@@ -20,7 +20,7 @@
20# AC_DEFINE. The goal here is to define all known feature-enabling 20# AC_DEFINE. The goal here is to define all known feature-enabling
21# macros, then, if reports of conflicts are made, disable macros that 21# macros, then, if reports of conflicts are made, disable macros that
22# cause problems on some platforms (such as __EXTENSIONS__). 22# cause problems on some platforms (such as __EXTENSIONS__).
23AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], 23AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
24[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl 24[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
25AC_BEFORE([$0], [AC_RUN_IFELSE])dnl 25AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
26 26
@@ -90,5 +90,15 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
90# ------------------------ 90# ------------------------
91# Enable extensions on systems that normally disable them, 91# Enable extensions on systems that normally disable them,
92# typically due to standards-conformance issues. 92# typically due to standards-conformance issues.
93AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], 93AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
94 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) 94[
95 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
96 dnl gnulib does not need it. But if it gets required by third-party macros
97 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
98 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
99 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
100 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
101 AC_REQUIRE([AC_GNU_SOURCE])
102
103 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
104])
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
index 4a7fc42b..1ae0b15a 100644
--- a/gl/m4/fcntl_h.m4
+++ b/gl/m4/fcntl_h.m4
@@ -9,6 +9,8 @@ dnl Written by Paul Eggert.
9AC_DEFUN([gl_FCNTL_H], 9AC_DEFUN([gl_FCNTL_H],
10[ 10[
11 AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) 11 AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
12 dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
13 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
12 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], 14 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
13 [AC_RUN_IFELSE( 15 [AC_RUN_IFELSE(
14 [AC_LANG_PROGRAM( 16 [AC_LANG_PROGRAM(
diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4
index 8cdaa946..915e5664 100644
--- a/gl/m4/floorf.m4
+++ b/gl/m4/floorf.m4
@@ -1,5 +1,5 @@
1# floorf.m4 serial 3 1# floorf.m4 serial 4
2dnl Copyright (C) 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2007, 2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_FLOORF],
34# Sets FLOORF_LIBM. 34# Sets FLOORF_LIBM.
35AC_DEFUN([gl_FUNC_FLOORF_LIBS], 35AC_DEFUN([gl_FUNC_FLOORF_LIBS],
36[ 36[
37 AC_CACHE_VAL([gl_cv_func_floorf_libm], [ 37 gl_CACHE_VAL_SILENT([gl_cv_func_floorf_libm], [
38 gl_cv_func_floorf_libm=? 38 gl_cv_func_floorf_libm=?
39 AC_TRY_LINK([ 39 AC_TRY_LINK([
40 #ifndef __NO_MATH_INLINES 40 #ifndef __NO_MATH_INLINES
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 5804eb9b..c8fda203 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 7 1# gnulib-common.m4 serial 11
2dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2009 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,
@@ -8,6 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
8# is expanded unconditionally through gnulib-tool magic. 8# is expanded unconditionally through gnulib-tool magic.
9AC_DEFUN([gl_COMMON], [ 9AC_DEFUN([gl_COMMON], [
10 dnl Use AC_REQUIRE here, so that the code is expanded once only. 10 dnl Use AC_REQUIRE here, so that the code is expanded once only.
11 AC_REQUIRE([gl_00GNULIB])
11 AC_REQUIRE([gl_COMMON_BODY]) 12 AC_REQUIRE([gl_COMMON_BODY])
12]) 13])
13AC_DEFUN([gl_COMMON_BODY], [ 14AC_DEFUN([gl_COMMON_BODY], [
@@ -52,7 +53,7 @@ m4_ifndef([m4_foreach_w],
52# is a backport of autoconf-2.60's AC_PROG_MKDIR_P. 53# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
53# Remove this macro when we can assume autoconf >= 2.60. 54# Remove this macro when we can assume autoconf >= 2.60.
54m4_ifdef([AC_PROG_MKDIR_P], [], [ 55m4_ifdef([AC_PROG_MKDIR_P], [], [
55 AC_DEFUN([AC_PROG_MKDIR_P], 56 AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
56 [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake 57 [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
57 MKDIR_P='$(mkdir_p)' 58 MKDIR_P='$(mkdir_p)'
58 AC_SUBST([MKDIR_P])])]) 59 AC_SUBST([MKDIR_P])])])
@@ -99,3 +100,25 @@ AC_DEFUN([AC_C_RESTRICT],
99 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; 100 *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
100 esac 101 esac
101]) 102])
103
104# gl_BIGENDIAN
105# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
106# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
107# macros invoke AC_C_BIGENDIAN with arguments.
108AC_DEFUN([gl_BIGENDIAN],
109[
110 AC_C_BIGENDIAN
111])
112
113# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
114# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
115# output a spurious "(cached)" mark in the midst of other configure output.
116# This macro should be used instead of AC_CACHE_VAL when it is not surrounded
117# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
118AC_DEFUN([gl_CACHE_VAL_SILENT],
119[
120 saved_as_echo_n="$as_echo_n"
121 as_echo_n=':'
122 AC_CACHE_VAL([$1], [$2])
123 as_echo_n="$saved_as_echo_n"
124])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index c6171dea..005cc4eb 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -25,7 +25,6 @@ AC_DEFUN([gl_EARLY],
25 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable 25 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
26 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable 26 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
27 AC_REQUIRE([AC_PROG_RANLIB]) 27 AC_REQUIRE([AC_PROG_RANLIB])
28 AC_REQUIRE([AC_GNU_SOURCE])
29 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 28 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
30]) 29])
31 30
@@ -116,6 +115,8 @@ AC_DEFUN([gl_INIT],
116 gl_STDINT_H 115 gl_STDINT_H
117 gl_STDIO_H 116 gl_STDIO_H
118 gl_STDLIB_H 117 gl_STDLIB_H
118 gl_FUNC_STRDUP_POSIX
119 gl_STRING_MODULE_INDICATOR([strdup])
119 gl_FUNC_STRERROR 120 gl_FUNC_STRERROR
120 gl_STRING_MODULE_INDICATOR([strerror]) 121 gl_STRING_MODULE_INDICATOR([strerror])
121 gl_HEADER_STRING_H 122 gl_HEADER_STRING_H
@@ -124,7 +125,6 @@ AC_DEFUN([gl_INIT],
124 gl_FUNC_STRNLEN 125 gl_FUNC_STRNLEN
125 gl_STRING_MODULE_INDICATOR([strnlen]) 126 gl_STRING_MODULE_INDICATOR([strnlen])
126 gl_HEADER_SYS_SOCKET 127 gl_HEADER_SYS_SOCKET
127 gl_MODULE_INDICATOR([sys_socket])
128 AC_PROG_MKDIR_P 128 AC_PROG_MKDIR_P
129 gl_HEADER_TIME_H 129 gl_HEADER_TIME_H
130 gl_TIME_R 130 gl_TIME_R
@@ -282,6 +282,7 @@ AC_DEFUN([gltests_LIBSOURCES], [
282AC_DEFUN([gl_FILE_LIST], [ 282AC_DEFUN([gl_FILE_LIST], [
283 build-aux/config.rpath 283 build-aux/config.rpath
284 build-aux/link-warning.h 284 build-aux/link-warning.h
285 lib/alignof.h
285 lib/alloca.c 286 lib/alloca.c
286 lib/alloca.in.h 287 lib/alloca.in.h
287 lib/arpa_inet.in.h 288 lib/arpa_inet.in.h
@@ -367,6 +368,7 @@ AC_DEFUN([gl_FILE_LIST], [
367 lib/stdio-write.c 368 lib/stdio-write.c
368 lib/stdio.in.h 369 lib/stdio.in.h
369 lib/stdlib.in.h 370 lib/stdlib.in.h
371 lib/strdup.c
370 lib/streq.h 372 lib/streq.h
371 lib/strerror.c 373 lib/strerror.c
372 lib/string.in.h 374 lib/string.in.h
@@ -395,6 +397,7 @@ AC_DEFUN([gl_FILE_LIST], [
395 lib/xsize.h 397 lib/xsize.h
396 lib/xstrndup.c 398 lib/xstrndup.c
397 lib/xstrndup.h 399 lib/xstrndup.h
400 m4/00gnulib.m4
398 m4/alloca.m4 401 m4/alloca.m4
399 m4/arpa_inet_h.m4 402 m4/arpa_inet_h.m4
400 m4/base64.m4 403 m4/base64.m4
@@ -478,6 +481,7 @@ AC_DEFUN([gl_FILE_LIST], [
478 m4/stdint_h.m4 481 m4/stdint_h.m4
479 m4/stdio_h.m4 482 m4/stdio_h.m4
480 m4/stdlib_h.m4 483 m4/stdlib_h.m4
484 m4/strdup.m4
481 m4/strerror.m4 485 m4/strerror.m4
482 m4/string_h.m4 486 m4/string_h.m4
483 m4/strndup.m4 487 m4/strndup.m4
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 062753c5..d6101fe3 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
1# include_next.m4 serial 10 1# include_next.m4 serial 12
2dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -32,14 +32,15 @@ AC_DEFUN([gl_INCLUDE_NEXT],
32 [gl_cv_have_include_next], 32 [gl_cv_have_include_next],
33 [rm -rf conftestd1a conftestd1b conftestd2 33 [rm -rf conftestd1a conftestd1b conftestd2
34 mkdir conftestd1a conftestd1b conftestd2 34 mkdir conftestd1a conftestd1b conftestd2
35 dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports 35 dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on
36 dnl include_next when used as first preprocessor directive in a file, 36 dnl AIX 6.1 support include_next when used as first preprocessor directive
37 dnl but not when preceded by another include directive. Additionally, 37 dnl in a file, but not when preceded by another include directive. Check
38 dnl with this same compiler, include_next is a no-op when used in a 38 dnl for this bug by including <stdio.h>.
39 dnl header file that was included by specifying its absolute file name. 39 dnl Additionally, with this same compiler, include_next is a no-op when
40 dnl Despite these two bugs, include_next is used in the compiler's 40 dnl used in a header file that was included by specifying its absolute
41 dnl <math.h>. By virtue of the second bug, we need to use include_next 41 dnl file name. Despite these two bugs, include_next is used in the
42 dnl as well in this case. 42 dnl compiler's <math.h>. By virtue of the second bug, we need to use
43 dnl include_next as well in this case.
43 cat <<EOF > conftestd1a/conftest.h 44 cat <<EOF > conftestd1a/conftest.h
44#define DEFINED_IN_CONFTESTD1 45#define DEFINED_IN_CONFTESTD1
45#include_next <conftest.h> 46#include_next <conftest.h>
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index 42bfc5e4..2bbdca10 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,4 +1,4 @@
1# inet_ntop.m4 serial 8 1# inet_ntop.m4 serial 9
2dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2005, 2006, 2008, 2009 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,
@@ -11,7 +11,18 @@ AC_DEFUN([gl_INET_NTOP],
11 11
12 gl_REPLACE_ARPA_INET_H 12 gl_REPLACE_ARPA_INET_H
13 13
14 AC_REPLACE_FUNCS([inet_ntop]) 14 dnl The AC_SEARCH_LIBS call is a hack to persuade the Solaris 8 linker to
15 dnl find inet_ntop.
16 dnl
17 dnl It is the responsibility of gl_INET_NTOP's caller to arrange for
18 dnl -lnsl if it is needed. Normally -lnsl is not needed on Solaris 8,
19 dnl since inet_ntop is needed only by getaddrinfo, and getaddrinfo
20 dnl isn't built on Solaris 8.
21 gl_save_LIBS=$LIBS
22 AC_SEARCH_LIBS([inet_ntop], [nsl], [],
23 [AC_REPLACE_FUNCS([inet_ntop])])
24 LIBS=$gl_save_LIBS
25
15 gl_PREREQ_INET_NTOP 26 gl_PREREQ_INET_NTOP
16]) 27])
17 28
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index fcd3391b..21442033 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
1# lib-link.m4 serial 18 (gettext-0.18) 1# lib-link.m4 serial 19 (gettext-0.18)
2dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2009 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,
@@ -43,12 +43,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
43 popdef([Name]) 43 popdef([Name])
44]) 44])
45 45
46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) 46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
47dnl searches for libname and the libraries corresponding to explicit and 47dnl searches for libname and the libraries corresponding to explicit and
48dnl implicit dependencies, together with the specified include files and 48dnl implicit dependencies, together with the specified include files and
49dnl the ability to compile and link the specified testcode. If found, it 49dnl the ability to compile and link the specified testcode. The missing-message
50dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and 50dnl defaults to 'no' and may contain additional hints for the user.
51dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and 51dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
52dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
52dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs 53dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
53dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. 54dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
54dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 55dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
@@ -74,12 +75,14 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
74 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 75 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
75 ac_save_LIBS="$LIBS" 76 ac_save_LIBS="$LIBS"
76 LIBS="$LIBS $LIB[]NAME" 77 LIBS="$LIBS $LIB[]NAME"
77 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) 78 AC_TRY_LINK([$3], [$4],
79 [ac_cv_lib[]Name=yes],
80 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
78 LIBS="$ac_save_LIBS" 81 LIBS="$ac_save_LIBS"
79 ]) 82 ])
80 if test "$ac_cv_lib[]Name" = yes; then 83 if test "$ac_cv_lib[]Name" = yes; then
81 HAVE_LIB[]NAME=yes 84 HAVE_LIB[]NAME=yes
82 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) 85 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib[]$1 library.])
83 AC_MSG_CHECKING([how to link with lib[]$1]) 86 AC_MSG_CHECKING([how to link with lib[]$1])
84 AC_MSG_RESULT([$LIB[]NAME]) 87 AC_MSG_RESULT([$LIB[]NAME])
85 else 88 else
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
index 3bdc0fc5..4b7ee335 100644
--- a/gl/m4/lib-prefix.m4
+++ b/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
1# lib-prefix.m4 serial 6 (gettext-0.18) 1# lib-prefix.m4 serial 7 (gettext-0.18)
2dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2005, 2008-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -206,6 +206,9 @@ sixtyfour bits
206 if test -d "$searchdir"; then 206 if test -d "$searchdir"; then
207 case "$searchdir" in 207 case "$searchdir" in
208 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; 208 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
209 */../ | */.. )
210 # Better ignore directories of this form. They are misleading.
211 ;;
209 *) searchdir=`cd "$searchdir" && pwd` 212 *) searchdir=`cd "$searchdir" && pwd`
210 case "$searchdir" in 213 case "$searchdir" in
211 */lib64 ) acl_libdirstem=lib64 ;; 214 */lib64 ) acl_libdirstem=lib64 ;;
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index e471839e..653a5bc2 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,4 +1,4 @@
1# locale-fr.m4 serial 10 1# locale-fr.m4 serial 11
2dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2009 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,
@@ -12,25 +12,7 @@ AC_DEFUN([gt_LOCALE_FR],
12 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ 14 AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
15 macosx= 15 AC_LANG_CONFTEST([AC_LANG_SOURCE([
16changequote(,)dnl
17 case "$host_os" in
18 darwin[56]*) ;;
19 darwin*) macosx=yes;;
20 esac
21changequote([,])dnl
22 if test -n "$macosx"; then
23 # On Darwin 7 (MacOS X), the libc supports some locales in non-UTF-8
24 # encodings, but the kernel does not support them. The documentation
25 # says:
26 # "... all code that calls BSD system routines should ensure
27 # that the const *char parameters of these routines are in UTF-8
28 # encoding. All BSD system functions expect their string
29 # parameters to be in UTF-8 encoding and nothing else."
30 # See the comments in config.charset. Therefore we bypass the test.
31 gt_cv_locale_fr=none
32 else
33 AC_LANG_CONFTEST([AC_LANG_SOURCE([
34changequote(,)dnl 16changequote(,)dnl
35#include <locale.h> 17#include <locale.h>
36#include <time.h> 18#include <time.h>
@@ -75,42 +57,41 @@ int main () {
75 return 0; 57 return 0;
76} 58}
77changequote([,])dnl 59changequote([,])dnl
78 ])]) 60 ])])
79 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 61 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
80 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because 62 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
81 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the 63 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
82 # configure script would override the LC_ALL setting. Likewise for 64 # configure script would override the LC_ALL setting. Likewise for
83 # LC_CTYPE, which is also set at the beginning of the configure script. 65 # LC_CTYPE, which is also set at the beginning of the configure script.
84 # Test for the usual locale name. 66 # Test for the usual locale name.
85 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 67 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
86 gt_cv_locale_fr=fr_FR 68 gt_cv_locale_fr=fr_FR
69 else
70 # Test for the locale name with explicit encoding suffix.
71 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
72 gt_cv_locale_fr=fr_FR.ISO-8859-1
87 else 73 else
88 # Test for the locale name with explicit encoding suffix. 74 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
89 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 75 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
90 gt_cv_locale_fr=fr_FR.ISO-8859-1 76 gt_cv_locale_fr=fr_FR.ISO8859-1
91 else 77 else
92 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. 78 # Test for the HP-UX locale name.
93 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 79 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
94 gt_cv_locale_fr=fr_FR.ISO8859-1 80 gt_cv_locale_fr=fr_FR.iso88591
95 else 81 else
96 # Test for the HP-UX locale name. 82 # Test for the Solaris 7 locale name.
97 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 83 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
98 gt_cv_locale_fr=fr_FR.iso88591 84 gt_cv_locale_fr=fr
99 else 85 else
100 # Test for the Solaris 7 locale name. 86 # None found.
101 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 87 gt_cv_locale_fr=none
102 gt_cv_locale_fr=fr
103 else
104 # None found.
105 gt_cv_locale_fr=none
106 fi
107 fi 88 fi
108 fi 89 fi
109 fi 90 fi
110 fi 91 fi
111 fi 92 fi
112 rm -fr conftest*
113 fi 93 fi
94 rm -fr conftest*
114 ]) 95 ])
115 LOCALE_FR=$gt_cv_locale_fr 96 LOCALE_FR=$gt_cv_locale_fr
116 AC_SUBST([LOCALE_FR]) 97 AC_SUBST([LOCALE_FR])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
index c80c5af9..93605764 100644
--- a/gl/m4/locale-ja.m4
+++ b/gl/m4/locale-ja.m4
@@ -1,4 +1,4 @@
1# locale-ja.m4 serial 6 1# locale-ja.m4 serial 7
2dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2009 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,
@@ -12,25 +12,7 @@ AC_DEFUN([gt_LOCALE_JA],
12 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ 14 AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
15 macosx= 15 AC_LANG_CONFTEST([AC_LANG_SOURCE([
16changequote(,)dnl
17 case "$host_os" in
18 darwin[56]*) ;;
19 darwin*) macosx=yes;;
20 esac
21changequote([,])dnl
22 if test -n "$macosx"; then
23 # On Darwin 7 (MacOS X), the libc supports some locales in non-UTF-8
24 # encodings, but the kernel does not support them. The documentation
25 # says:
26 # "... all code that calls BSD system routines should ensure
27 # that the const *char parameters of these routines are in UTF-8
28 # encoding. All BSD system functions expect their string
29 # parameters to be in UTF-8 encoding and nothing else."
30 # See the comments in config.charset. Therefore we bypass the test.
31 gt_cv_locale_ja=none
32 else
33 AC_LANG_CONFTEST([AC_LANG_SOURCE([
34changequote(,)dnl 16changequote(,)dnl
35#include <locale.h> 17#include <locale.h>
36#include <time.h> 18#include <time.h>
@@ -79,47 +61,46 @@ int main ()
79 return 0; 61 return 0;
80} 62}
81changequote([,])dnl 63changequote([,])dnl
82 ])]) 64 ])])
83 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 65 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
84 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because 66 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
85 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the 67 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
86 # configure script would override the LC_ALL setting. Likewise for 68 # configure script would override the LC_ALL setting. Likewise for
87 # LC_CTYPE, which is also set at the beginning of the configure script. 69 # LC_CTYPE, which is also set at the beginning of the configure script.
88 # Test for the AIX locale name. 70 # Test for the AIX locale name.
89 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 71 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
90 gt_cv_locale_ja=ja_JP 72 gt_cv_locale_ja=ja_JP
73 else
74 # Test for the locale name with explicit encoding suffix.
75 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
76 gt_cv_locale_ja=ja_JP.EUC-JP
91 else 77 else
92 # Test for the locale name with explicit encoding suffix. 78 # Test for the HP-UX, OSF/1, NetBSD locale name.
93 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 79 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
94 gt_cv_locale_ja=ja_JP.EUC-JP 80 gt_cv_locale_ja=ja_JP.eucJP
95 else 81 else
96 # Test for the HP-UX, OSF/1, NetBSD locale name. 82 # Test for the IRIX, FreeBSD locale name.
97 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 83 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
98 gt_cv_locale_ja=ja_JP.eucJP 84 gt_cv_locale_ja=ja_JP.EUC
99 else 85 else
100 # Test for the IRIX, FreeBSD locale name. 86 # Test for the Solaris 7 locale name.
101 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 87 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
102 gt_cv_locale_ja=ja_JP.EUC 88 gt_cv_locale_ja=ja
103 else 89 else
104 # Test for the Solaris 7 locale name. 90 # Special test for NetBSD 1.6.
105 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 91 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
106 gt_cv_locale_ja=ja 92 gt_cv_locale_ja=ja_JP.eucJP
107 else 93 else
108 # Special test for NetBSD 1.6. 94 # None found.
109 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then 95 gt_cv_locale_ja=none
110 gt_cv_locale_ja=ja_JP.eucJP
111 else
112 # None found.
113 gt_cv_locale_ja=none
114 fi
115 fi 96 fi
116 fi 97 fi
117 fi 98 fi
118 fi 99 fi
119 fi 100 fi
120 fi 101 fi
121 rm -fr conftest*
122 fi 102 fi
103 rm -fr conftest*
123 ]) 104 ])
124 LOCALE_JA=$gt_cv_locale_ja 105 LOCALE_JA=$gt_cv_locale_ja
125 AC_SUBST([LOCALE_JA]) 106 AC_SUBST([LOCALE_JA])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
index ba7f9c5c..36a5f1df 100644
--- a/gl/m4/locale-zh.m4
+++ b/gl/m4/locale-zh.m4
@@ -1,4 +1,4 @@
1# locale-zh.m4 serial 5 1# locale-zh.m4 serial 6
2dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2009 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,
@@ -12,25 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN],
12 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ 14 AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
15 macosx= 15 AC_LANG_CONFTEST([AC_LANG_SOURCE([
16changequote(,)dnl
17 case "$host_os" in
18 darwin[56]*) ;;
19 darwin*) macosx=yes;;
20 esac
21changequote([,])dnl
22 if test -n "$macosx"; then
23 # On Darwin 7 (MacOS X), the libc supports some locales in non-UTF-8
24 # encodings, but the kernel does not support them. The documentation
25 # says:
26 # "... all code that calls BSD system routines should ensure
27 # that the const *char parameters of these routines are in UTF-8
28 # encoding. All BSD system functions expect their string
29 # parameters to be in UTF-8 encoding and nothing else."
30 # See the comments in config.charset. Therefore we bypass the test.
31 gt_cv_locale_zh_CN=none
32 else
33 AC_LANG_CONFTEST([AC_LANG_SOURCE([
34changequote(,)dnl 16changequote(,)dnl
35#include <locale.h> 17#include <locale.h>
36#include <stdlib.h> 18#include <stdlib.h>
@@ -80,31 +62,30 @@ int main ()
80 return 0; 62 return 0;
81} 63}
82changequote([,])dnl 64changequote([,])dnl
83 ])]) 65 ])])
84 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 66 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
85 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because 67 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
86 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the 68 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
87 # configure script would override the LC_ALL setting. Likewise for 69 # configure script would override the LC_ALL setting. Likewise for
88 # LC_CTYPE, which is also set at the beginning of the configure script. 70 # LC_CTYPE, which is also set at the beginning of the configure script.
89 # Test for the locale name without encoding suffix. 71 # Test for the locale name without encoding suffix.
90 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 72 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
91 gt_cv_locale_zh_CN=zh_CN 73 gt_cv_locale_zh_CN=zh_CN
74 else
75 # Test for the locale name with explicit encoding suffix.
76 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
77 gt_cv_locale_zh_CN=zh_CN.GB18030
92 else 78 else
93 # Test for the locale name with explicit encoding suffix. 79 # None found.
94 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 80 gt_cv_locale_zh_CN=none
95 gt_cv_locale_zh_CN=zh_CN.GB18030
96 else
97 # None found.
98 gt_cv_locale_zh_CN=none
99 fi
100 fi 81 fi
101 else
102 # If there was a link error, due to mblen(), the system is so old that
103 # it certainly doesn't have a chinese locale.
104 gt_cv_locale_zh_CN=none
105 fi 82 fi
106 rm -fr conftest* 83 else
84 # If there was a link error, due to mblen(), the system is so old that
85 # it certainly doesn't have a chinese locale.
86 gt_cv_locale_zh_CN=none
107 fi 87 fi
88 rm -fr conftest*
108 ]) 89 ])
109 LOCALE_ZH_CN=$gt_cv_locale_zh_CN 90 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
110 AC_SUBST([LOCALE_ZH_CN]) 91 AC_SUBST([LOCALE_ZH_CN])
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index 726497b6..11d7d23e 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
1# mbrtowc.m4 serial 13 1# mbrtowc.m4 serial 15
2dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 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,
@@ -65,9 +65,15 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
65 AC_CHECK_FUNCS_ONCE([mbrtowc]) 65 AC_CHECK_FUNCS_ONCE([mbrtowc])
66 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then 66 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
67 gl_MBRTOWC_INCOMPLETE_STATE 67 gl_MBRTOWC_INCOMPLETE_STATE
68 gl_MBRTOWC_SANITYCHECK
69 REPLACE_MBSTATE_T=0
68 case "$gl_cv_func_mbrtowc_incomplete_state" in 70 case "$gl_cv_func_mbrtowc_incomplete_state" in
69 *yes) REPLACE_MBSTATE_T=0 ;; 71 *yes) ;;
70 *) REPLACE_MBSTATE_T=1 ;; 72 *) REPLACE_MBSTATE_T=1 ;;
73 esac
74 case "$gl_cv_func_mbrtowc_sanitycheck" in
75 *yes) ;;
76 *) REPLACE_MBSTATE_T=1 ;;
71 esac 77 esac
72 else 78 else
73 REPLACE_MBSTATE_T=1 79 REPLACE_MBSTATE_T=1
@@ -121,7 +127,58 @@ int main ()
121}], 127}],
122 [gl_cv_func_mbrtowc_incomplete_state=yes], 128 [gl_cv_func_mbrtowc_incomplete_state=yes],
123 [gl_cv_func_mbrtowc_incomplete_state=no], 129 [gl_cv_func_mbrtowc_incomplete_state=no],
124 []) 130 [:])
131 fi
132 ])
133])
134
135dnl Test whether mbrtowc works not worse than mbtowc.
136dnl Result is gl_cv_func_mbrtowc_sanitycheck.
137
138AC_DEFUN([gl_MBRTOWC_SANITYCHECK],
139[
140 AC_REQUIRE([AC_PROG_CC])
141 AC_REQUIRE([gt_LOCALE_ZH_CN])
142 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
143 AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc],
144 [gl_cv_func_mbrtowc_sanitycheck],
145 [
146 dnl Initial guess, used when cross-compiling or when no suitable locale
147 dnl is present.
148changequote(,)dnl
149 case "$host_os" in
150 # Guess no on Solaris 8.
151 solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
152 # Guess yes otherwise.
153 *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
154 esac
155changequote([,])dnl
156 if test $LOCALE_ZH_CN != none; then
157 AC_TRY_RUN([
158#include <locale.h>
159#include <string.h>
160#include <wchar.h>
161int main ()
162{
163 /* This fails on Solaris 8:
164 mbrtowc returns 2, and sets wc to 0x00F0.
165 mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
166 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
167 {
168 char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
169 mbstate_t state;
170 wchar_t wc;
171
172 memset (&state, '\0', sizeof (mbstate_t));
173 if (mbrtowc (&wc, input + 3, 6, &state) != 4
174 && mbtowc (&wc, input + 3, 6) == 4)
175 return 1;
176 }
177 return 0;
178}],
179 [gl_cv_func_mbrtowc_sanitycheck=yes],
180 [gl_cv_func_mbrtowc_sanitycheck=no],
181 [:])
125 fi 182 fi
126 ]) 183 ])
127]) 184])
@@ -168,7 +225,7 @@ int main ()
168 return 1; 225 return 1;
169 } 226 }
170 return 0; 227 return 0;
171}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], []) 228}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
172 fi 229 fi
173 ]) 230 ])
174]) 231])
@@ -238,7 +295,7 @@ int main ()
238}], 295}],
239 [gl_cv_func_mbrtowc_retval=yes], 296 [gl_cv_func_mbrtowc_retval=yes],
240 [gl_cv_func_mbrtowc_retval=no], 297 [gl_cv_func_mbrtowc_retval=no],
241 []) 298 [:])
242 fi 299 fi
243 ]) 300 ])
244]) 301])
@@ -258,10 +315,10 @@ AC_DEFUN([gl_MBRTOWC_NUL_RETVAL],
258 dnl is present. 315 dnl is present.
259changequote(,)dnl 316changequote(,)dnl
260 case "$host_os" in 317 case "$host_os" in
261 # Guess no on Solaris 9. 318 # Guess no on Solaris 8 and 9.
262 solaris2.9) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; 319 solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
263 # Guess yes otherwise. 320 # Guess yes otherwise.
264 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; 321 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
265 esac 322 esac
266changequote([,])dnl 323changequote([,])dnl
267 if test $LOCALE_ZH_CN != none; then 324 if test $LOCALE_ZH_CN != none; then
@@ -271,7 +328,7 @@ changequote([,])dnl
271#include <wchar.h> 328#include <wchar.h>
272int main () 329int main ()
273{ 330{
274 /* This fails on Solaris 9. */ 331 /* This fails on Solaris 8 and 9. */
275 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) 332 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
276 { 333 {
277 mbstate_t state; 334 mbstate_t state;
@@ -285,7 +342,7 @@ int main ()
285}], 342}],
286 [gl_cv_func_mbrtowc_nul_retval=yes], 343 [gl_cv_func_mbrtowc_nul_retval=yes],
287 [gl_cv_func_mbrtowc_nul_retval=no], 344 [gl_cv_func_mbrtowc_nul_retval=no],
288 []) 345 [:])
289 fi 346 fi
290 ]) 347 ])
291]) 348])
diff --git a/gl/m4/mktime.m4 b/gl/m4/mktime.m4
index 223b9f1f..1e926e86 100644
--- a/gl/m4/mktime.m4
+++ b/gl/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 14 1# serial 15
2dnl Copyright (C) 2002-2003, 2005-2007, 2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2003, 2005-2007, 2009 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,
@@ -15,6 +15,13 @@ dnl From Jim Meyering.
15AC_DEFUN([AC_FUNC_MKTIME], 15AC_DEFUN([AC_FUNC_MKTIME],
16[AC_CHECK_HEADERS_ONCE([unistd.h]) 16[AC_CHECK_HEADERS_ONCE([unistd.h])
17AC_CHECK_FUNCS_ONCE([alarm]) 17AC_CHECK_FUNCS_ONCE([alarm])
18AC_REQUIRE([gl_MULTIARCH])
19if test $APPLE_UNIVERSAL_BUILD = 1; then
20 # A universal build on Apple MacOS X platforms.
21 # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
22 # But we need a configuration result that is valid in both modes.
23 ac_cv_func_working_mktime=no
24fi
18AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime], 25AC_CACHE_CHECK([for working mktime], [ac_cv_func_working_mktime],
19[AC_RUN_IFELSE([AC_LANG_SOURCE( 26[AC_RUN_IFELSE([AC_LANG_SOURCE(
20[[/* Test program from Paul Eggert and Tony Leneis. */ 27[[/* Test program from Paul Eggert and Tony Leneis. */
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index 7b73e15e..ec377bac 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
1# multiarch.m4 serial 3 1# multiarch.m4 serial 5
2dnl Copyright (C) 2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2008, 2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -19,16 +19,7 @@ dnl with or without modifications, as long as this notice is preserved.
19# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the 19# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
20# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly. 20# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
21 21
22AC_DEFUN([gl_MULTIARCH], 22AC_DEFUN_ONCE([gl_MULTIARCH],
23[
24 dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
25 dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
26 dnl being handled better than AC_REQUIRE invocations inside normally invoked
27 dnl macros.
28 AC_REQUIRE([gl_MULTIARCH_BODY])
29])
30
31AC_DEFUN([gl_MULTIARCH_BODY],
32[ 23[
33 dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. 24 dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
34 gl_cv_c_multiarch=no 25 gl_cv_c_multiarch=no
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 4d109935..87aa45c5 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
1# printf.m4 serial 26 1# printf.m4 serial 33
2dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2007-2009 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,
@@ -125,7 +125,8 @@ changequote([,])dnl
125]) 125])
126 126
127dnl Test whether the *printf family of functions supports infinite and NaN 127dnl Test whether the *printf family of functions supports infinite and NaN
128dnl 'double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) 128dnl 'double' arguments and negative zero arguments in the %f, %e, %g
129dnl directives. (ISO C99, POSIX:2001)
129dnl Result is gl_cv_func_printf_infinite. 130dnl Result is gl_cv_func_printf_infinite.
130 131
131AC_DEFUN([gl_PRINTF_INFINITE], 132AC_DEFUN([gl_PRINTF_INFINITE],
@@ -156,6 +157,13 @@ strisnan (const char *string, size_t start_index, size_t end_index)
156 } 157 }
157 return 0; 158 return 0;
158} 159}
160static int
161have_minus_zero ()
162{
163 static double plus_zero = 0.0;
164 double minus_zero = - plus_zero;
165 return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
166}
159static char buf[10000]; 167static char buf[10000];
160static double zero = 0.0; 168static double zero = 0.0;
161int main () 169int main ()
@@ -187,6 +195,11 @@ int main ()
187 if (sprintf (buf, "%g", zero / zero) < 0 195 if (sprintf (buf, "%g", zero / zero) < 0
188 || !strisnan (buf, 0, strlen (buf))) 196 || !strisnan (buf, 0, strlen (buf)))
189 return 1; 197 return 1;
198 /* This test fails on HP-UX 10.20. */
199 if (have_minus_zero ())
200 if (sprintf (buf, "%g", - zero) < 0
201 || strcmp (buf, "-0") != 0)
202 return 1;
190 return 0; 203 return 0;
191}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], 204}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
192 [ 205 [
@@ -225,7 +238,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
225[ 238[
226 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) 239 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
227 AC_REQUIRE([AC_PROG_CC]) 240 AC_REQUIRE([AC_PROG_CC])
228 AC_REQUIRE([AC_C_BIGENDIAN]) 241 AC_REQUIRE([gl_BIGENDIAN])
229 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 242 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
230 dnl The user can set or unset the variable gl_printf_safe to indicate 243 dnl The user can set or unset the variable gl_printf_safe to indicate
231 dnl that he wishes a safe handling of non-IEEE-754 'long double' values. 244 dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
@@ -545,7 +558,7 @@ int main ()
545 if (sprintf (buf, "%F", 1.0 / 0.0) < 0 558 if (sprintf (buf, "%F", 1.0 / 0.0) < 0
546 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) 559 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
547 return 1; 560 return 1;
548 /* This catches a Cygwin 2007 bug. */ 561 /* This catches a Cygwin 1.5.x bug. */
549 if (sprintf (buf, "%.F", 1234.0) < 0 562 if (sprintf (buf, "%.F", 1234.0) < 0
550 || strcmp (buf, "1234") != 0) 563 || strcmp (buf, "1234") != 0)
551 return 1; 564 return 1;
@@ -612,6 +625,84 @@ changequote([,])dnl
612 ]) 625 ])
613]) 626])
614 627
628dnl Test whether the *printf family of functions supports the %ls format
629dnl directive and in particular, when a precision is specified, whether
630dnl the functions stop converting the wide string argument when the number
631dnl of bytes that have been produced by this conversion equals or exceeds
632dnl the precision.
633dnl Result is gl_cv_func_printf_directive_ls.
634
635AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
636[
637 AC_REQUIRE([AC_PROG_CC])
638 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
639 AC_CACHE_CHECK([whether printf supports the 'ls' directive],
640 [gl_cv_func_printf_directive_ls],
641 [
642 AC_TRY_RUN([
643/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
644 <wchar.h>.
645 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
646 included before <wchar.h>. */
647#include <stddef.h>
648#include <stdio.h>
649#include <time.h>
650#include <wchar.h>
651#include <string.h>
652int main ()
653{
654 char buf[100];
655 /* Test whether %ls works at all.
656 This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
657 Cygwin 1.5. */
658 {
659 static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
660 buf[0] = '\0';
661 if (sprintf (buf, "%ls", wstring) < 0
662 || strcmp (buf, "abc") != 0)
663 return 1;
664 }
665 /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
666 assertion failure inside libc), but not on OpenBSD 4.0. */
667 {
668 static const wchar_t wstring[] = { 'a', 0 };
669 buf[0] = '\0';
670 if (sprintf (buf, "%ls", wstring) < 0
671 || strcmp (buf, "a") != 0)
672 return 1;
673 }
674 /* Test whether precisions in %ls are supported as specified in ISO C 99
675 section 7.19.6.1:
676 "If a precision is specified, no more than that many bytes are written
677 (including shift sequences, if any), and the array shall contain a
678 null wide character if, to equal the multibyte character sequence
679 length given by the precision, the function would need to access a
680 wide character one past the end of the array."
681 This test fails on Solaris 10. */
682 {
683 static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
684 buf[0] = '\0';
685 if (sprintf (buf, "%.2ls", wstring) < 0
686 || strcmp (buf, "ab") != 0)
687 return 1;
688 }
689 return 0;
690}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
691 [
692changequote(,)dnl
693 case "$host_os" in
694 openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
695 irix*) gl_cv_func_printf_directive_ls="guessing no";;
696 solaris*) gl_cv_func_printf_directive_ls="guessing no";;
697 cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
698 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
699 *) gl_cv_func_printf_directive_ls="guessing yes";;
700 esac
701changequote([,])dnl
702 ])
703 ])
704])
705
615dnl Test whether the *printf family of functions supports POSIX/XSI format 706dnl Test whether the *printf family of functions supports POSIX/XSI format
616dnl strings with positions. (POSIX:2001) 707dnl strings with positions. (POSIX:2001)
617dnl Result is gl_cv_func_printf_positions. 708dnl Result is gl_cv_func_printf_positions.
@@ -1142,7 +1233,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1],
1142#include <stdio.h> 1233#include <stdio.h>
1143int main() 1234int main()
1144{ 1235{
1145 static char buf[8] = "DEADBEEF"; 1236 static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
1146 snprintf (buf, 1, "%d", 12345); 1237 snprintf (buf, 1, "%d", 12345);
1147 return buf[1] != 'E'; 1238 return buf[1] != 'E';
1148}], 1239}],
@@ -1160,7 +1251,7 @@ dnl ---------------------------------------------------------------------
1160dnl #include <stdio.h> 1251dnl #include <stdio.h>
1161dnl int main() 1252dnl int main()
1162dnl { 1253dnl {
1163dnl static char buf[8] = "DEADBEEF"; 1254dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
1164dnl snprintf (buf, 0, "%d", 12345); 1255dnl snprintf (buf, 0, "%d", 12345);
1165dnl return buf[0] != 'D'; 1256dnl return buf[0] != 'D';
1166dnl } 1257dnl }
@@ -1181,7 +1272,7 @@ dnl return ret;
1181dnl } 1272dnl }
1182dnl int main() 1273dnl int main()
1183dnl { 1274dnl {
1184dnl static char buf[8] = "DEADBEEF"; 1275dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
1185dnl my_snprintf (buf, 0, "%d", 12345); 1276dnl my_snprintf (buf, 0, "%d", 12345);
1186dnl return buf[0] != 'D'; 1277dnl return buf[0] != 'D';
1187dnl } 1278dnl }
@@ -1209,7 +1300,7 @@ static int my_snprintf (char *buf, int size, const char *format, ...)
1209} 1300}
1210int main() 1301int main()
1211{ 1302{
1212 static char buf[8] = "DEADBEEF"; 1303 static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
1213 my_snprintf (buf, 0, "%d", 12345); 1304 my_snprintf (buf, 0, "%d", 12345);
1214 return buf[0] != 'D'; 1305 return buf[0] != 'D';
1215}], 1306}],
@@ -1261,18 +1352,19 @@ dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
1261dnl 5 = gl_PRINTF_DIRECTIVE_A 1352dnl 5 = gl_PRINTF_DIRECTIVE_A
1262dnl 6 = gl_PRINTF_DIRECTIVE_F 1353dnl 6 = gl_PRINTF_DIRECTIVE_F
1263dnl 7 = gl_PRINTF_DIRECTIVE_N 1354dnl 7 = gl_PRINTF_DIRECTIVE_N
1264dnl 8 = gl_PRINTF_POSITIONS 1355dnl 8 = gl_PRINTF_DIRECTIVE_LS
1265dnl 9 = gl_PRINTF_FLAG_GROUPING 1356dnl 9 = gl_PRINTF_POSITIONS
1266dnl 10 = gl_PRINTF_FLAG_LEFTADJUST 1357dnl 10 = gl_PRINTF_FLAG_GROUPING
1267dnl 11 = gl_PRINTF_FLAG_ZERO 1358dnl 11 = gl_PRINTF_FLAG_LEFTADJUST
1268dnl 12 = gl_PRINTF_PRECISION 1359dnl 12 = gl_PRINTF_FLAG_ZERO
1269dnl 13 = gl_PRINTF_ENOMEM 1360dnl 13 = gl_PRINTF_PRECISION
1270dnl 14 = gl_SNPRINTF_PRESENCE 1361dnl 14 = gl_PRINTF_ENOMEM
1271dnl 15 = gl_SNPRINTF_TRUNCATION_C99 1362dnl 15 = gl_SNPRINTF_PRESENCE
1272dnl 16 = gl_SNPRINTF_RETVAL_C99 1363dnl 16 = gl_SNPRINTF_TRUNCATION_C99
1273dnl 17 = gl_SNPRINTF_DIRECTIVE_N 1364dnl 17 = gl_SNPRINTF_RETVAL_C99
1274dnl 18 = gl_SNPRINTF_SIZE1 1365dnl 18 = gl_SNPRINTF_DIRECTIVE_N
1275dnl 19 = gl_VSNPRINTF_ZEROSIZE_C99 1366dnl 19 = gl_SNPRINTF_SIZE1
1367dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
1276dnl 1368dnl
1277dnl 1 = checking whether printf supports size specifiers as in C99... 1369dnl 1 = checking whether printf supports size specifiers as in C99...
1278dnl 2 = checking whether printf supports 'long double' arguments... 1370dnl 2 = checking whether printf supports 'long double' arguments...
@@ -1281,42 +1373,44 @@ dnl 4 = checking whether printf supports infinite 'long double' arguments...
1281dnl 5 = checking whether printf supports the 'a' and 'A' directives... 1373dnl 5 = checking whether printf supports the 'a' and 'A' directives...
1282dnl 6 = checking whether printf supports the 'F' directive... 1374dnl 6 = checking whether printf supports the 'F' directive...
1283dnl 7 = checking whether printf supports the 'n' directive... 1375dnl 7 = checking whether printf supports the 'n' directive...
1284dnl 8 = checking whether printf supports POSIX/XSI format strings with positions... 1376dnl 8 = checking whether printf supports the 'ls' directive...
1285dnl 9 = checking whether printf supports the grouping flag... 1377dnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
1286dnl 10 = checking whether printf supports the left-adjust flag correctly... 1378dnl 10 = checking whether printf supports the grouping flag...
1287dnl 11 = checking whether printf supports the zero flag correctly... 1379dnl 11 = checking whether printf supports the left-adjust flag correctly...
1288dnl 12 = checking whether printf supports large precisions... 1380dnl 12 = checking whether printf supports the zero flag correctly...
1289dnl 13 = checking whether printf survives out-of-memory conditions... 1381dnl 13 = checking whether printf supports large precisions...
1290dnl 14 = checking for snprintf... 1382dnl 14 = checking whether printf survives out-of-memory conditions...
1291dnl 15 = checking whether snprintf truncates the result as in C99... 1383dnl 15 = checking for snprintf...
1292dnl 16 = checking whether snprintf returns a byte count as in C99... 1384dnl 16 = checking whether snprintf truncates the result as in C99...
1293dnl 17 = checking whether snprintf fully supports the 'n' directive... 1385dnl 17 = checking whether snprintf returns a byte count as in C99...
1294dnl 18 = checking whether snprintf respects a size of 1... 1386dnl 18 = checking whether snprintf fully supports the 'n' directive...
1295dnl 19 = checking whether vsnprintf respects a zero size as in C99... 1387dnl 19 = checking whether snprintf respects a size of 1...
1388dnl 20 = checking whether vsnprintf respects a zero size as in C99...
1296dnl 1389dnl
1297dnl . = yes, # = no. 1390dnl . = yes, # = no.
1298dnl 1391dnl
1299dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1392dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1300dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . 1393dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
1301dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . 1394dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
1302dnl FreeBSD 5.4, 6.1 . . . . # . . . . . # . # . . . . . . 1395dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
1303dnl MacOS X 10.3.9 . . . . # . . . . . # . # . . . . . . 1396dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
1304dnl OpenBSD 3.9, 4.0 . . # # # # . . # . # . # . . . . . . 1397dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
1305dnl Cygwin 2007 (= Cygwin 1.5.24) . . . . # # . . . ? # ? ? . . . . . . 1398dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
1306dnl Cygwin 2006 (= Cygwin 1.5.19) # . . . # # . . # ? # ? ? . . . . . . 1399dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
1307dnl Solaris 10 . . # # # . . . . . # . . . . . . . . 1400dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
1308dnl Solaris 2.6 ... 9 # . # # # # . . . . # . . . . . . . . 1401dnl Solaris 10 . . # # # . . # . . . # . . . . . . . .
1309dnl Solaris 2.5.1 # . # # # # . . . . # . . # # # # # # 1402dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
1310dnl AIX 5.2 . . # # # . . . . . # . . . . . . . . 1403dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
1311dnl AIX 4.3.2, 5.1 # . # # # # . . . . # . . . . . . . . 1404dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
1312dnl HP-UX 11.31 . . . . # . . . . . # . . . . # # . . 1405dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
1313dnl HP-UX 11.{00,11,23} # . . . # # . . . . # . . . . # # . # 1406dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
1314dnl HP-UX 10.20 # . . . # # . . . # # . . . . # # ? # 1407dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
1315dnl IRIX 6.5 # . # # # # . . . . # . . . . # . . . 1408dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
1316dnl OSF/1 5.1 # . # # # # . . . . # . . . . # . . # 1409dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
1317dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # # 1410dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
1318dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ? 1411dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
1319dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . . 1412dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
1320dnl Haiku . . . # # # . . . . . . ? . . . . . . 1413dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
1321dnl BeOS # # . # # # . # . ? . # ? . . . . . . 1414dnl Haiku . . . # # # . # . . . . . ? . . . . . .
1322dnl mingw # # # # # # . # # . # # ? . # # # . . 1415dnl BeOS # # . # # # . ? # . ? . # ? . . . . . .
1416dnl mingw # # # # # # . . # # . # # ? . # # # . .
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index 43b04638..aef53d29 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,4 +1,4 @@
1# serial 53 1# serial 54
2 2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 4# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -18,12 +18,9 @@ AC_DEFUN([gl_REGEX],
18 18
19 AC_ARG_WITH([included-regex], 19 AC_ARG_WITH([included-regex],
20 [AS_HELP_STRING([--without-included-regex], 20 [AS_HELP_STRING([--without-included-regex],
21 [don't compile regex; this is the default on 32-bit 21 [don't compile regex; this is the default on systems
22 systems with recent-enough versions of the GNU C 22 with recent-enough versions of the GNU C Library
23 Library (use with caution on other systems). 23 (use with caution on other systems).])])
24 On systems with 64-bit ptrdiff_t and 32-bit int,
25 --with-included-regex is the default, in case
26 regex functions operate on very long strings (>2GB)])])
27 24
28 case $with_included_regex in #( 25 case $with_included_regex in #(
29 yes|no) ac_use_included_regex=$with_included_regex 26 yes|no) ac_use_included_regex=$with_included_regex
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index b4194c8a..a2e8bdd6 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
1# stdint.m4 serial 33 1# stdint.m4 serial 34
2dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2009 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,
@@ -201,7 +201,75 @@ struct s {
201 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; 201 int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
202}; 202};
203 ]])], 203 ]])],
204 [gl_cv_header_working_stdint_h=yes])]) 204 [dnl Determine whether the various *_MIN, *_MAX macros are usable
205 dnl in preprocessor expression. We could do it by compiling a test
206 dnl program for each of these macros. It is faster to run a program
207 dnl that inspects the macro expansion.
208 dnl This detects a bug on HP-UX 11.23/ia64.
209 AC_RUN_IFELSE([
210 AC_LANG_PROGRAM([[
211#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
212#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
213#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
214#include <stdint.h>
215]
216gl_STDINT_INCLUDES
217[
218#include <stdio.h>
219#include <string.h>
220#define MVAL(macro) MVAL1(macro)
221#define MVAL1(expression) #expression
222static const char *macro_values[] =
223 {
224#ifdef INT8_MAX
225 MVAL (INT8_MAX),
226#endif
227#ifdef INT16_MAX
228 MVAL (INT16_MAX),
229#endif
230#ifdef INT32_MAX
231 MVAL (INT32_MAX),
232#endif
233#ifdef INT64_MAX
234 MVAL (INT64_MAX),
235#endif
236#ifdef UINT8_MAX
237 MVAL (UINT8_MAX),
238#endif
239#ifdef UINT16_MAX
240 MVAL (UINT16_MAX),
241#endif
242#ifdef UINT32_MAX
243 MVAL (UINT32_MAX),
244#endif
245#ifdef UINT64_MAX
246 MVAL (UINT64_MAX),
247#endif
248 NULL
249 };
250]], [[
251 const char **mv;
252 for (mv = macro_values; *mv != NULL; mv++)
253 {
254 const char *value = *mv;
255 /* Test whether it looks like a cast expression. */
256 if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
257 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
258 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
259 || strncmp (value, "((int)"/*)*/, 6) == 0
260 || strncmp (value, "((signed short)"/*)*/, 15) == 0
261 || strncmp (value, "((signed char)"/*)*/, 14) == 0)
262 return 1;
263 }
264 return 0;
265]])],
266 [gl_cv_header_working_stdint_h=yes],
267 [],
268 [dnl When cross-compiling, assume it works.
269 gl_cv_header_working_stdint_h=yes
270 ])
271 ])
272 ])
205 fi 273 fi
206 if test "$gl_cv_header_working_stdint_h" = yes; then 274 if test "$gl_cv_header_working_stdint_h" = yes; then
207 STDINT_H= 275 STDINT_H=
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 60b4bd79..846b65d3 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
1# stdio_h.m4 serial 14 1# stdio_h.m4 serial 15
2dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -53,6 +53,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
53 GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) 53 GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
54 GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) 54 GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
55 GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) 55 GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
56 GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
57 GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
56 GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) 58 GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
57 GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) 59 GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
58 GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) 60 GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
@@ -86,6 +88,10 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
86 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) 88 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
87 REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) 89 REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
88 REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) 90 REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
91 HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
92 REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
93 HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
94 REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
89 HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) 95 HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
90 REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) 96 REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
91 HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) 97 HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index 582db13d..b295f16b 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
1# stdlib_h.m4 serial 13 1# stdlib_h.m4 serial 15
2dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -8,9 +8,20 @@ AC_DEFUN([gl_STDLIB_H],
8[ 8[
9 AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) 9 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
10 gl_CHECK_NEXT_HEADERS([stdlib.h]) 10 gl_CHECK_NEXT_HEADERS([stdlib.h])
11 AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
12 if test $ac_cv_header_random_h = yes; then
13 HAVE_RANDOM_H=1
14 else
15 HAVE_RANDOM_H=0
16 fi
17 AC_SUBST([HAVE_RANDOM_H])
11 AC_CHECK_TYPES([struct random_data], 18 AC_CHECK_TYPES([struct random_data],
12 [], [HAVE_STRUCT_RANDOM_DATA=0], 19 [], [HAVE_STRUCT_RANDOM_DATA=0],
13 [[#include <stdlib.h>]]) 20 [[#include <stdlib.h>
21 #if HAVE_RANDOM_H
22 # include <random.h>
23 #endif
24 ]])
14]) 25])
15 26
16AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], 27AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
new file mode 100644
index 00000000..d7daac2b
--- /dev/null
+++ b/gl/m4/strdup.m4
@@ -0,0 +1,38 @@
1# strdup.m4 serial 11
2
3dnl Copyright (C) 2002-2009 Free Software Foundation, Inc.
4
5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved.
8
9AC_DEFUN([gl_FUNC_STRDUP],
10[
11 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
12 AC_REPLACE_FUNCS([strdup])
13 AC_CHECK_DECLS_ONCE([strdup])
14 if test $ac_cv_have_decl_strdup = no; then
15 HAVE_DECL_STRDUP=0
16 fi
17 gl_PREREQ_STRDUP
18])
19
20AC_DEFUN([gl_FUNC_STRDUP_POSIX],
21[
22 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
23 AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
24 if test $gl_cv_func_malloc_posix != yes; then
25 REPLACE_STRDUP=1
26 AC_LIBOBJ([strdup])
27 else
28 AC_REPLACE_FUNCS([strdup])
29 fi
30 AC_CHECK_DECLS_ONCE([strdup])
31 if test $ac_cv_have_decl_strdup = no; then
32 HAVE_DECL_STRDUP=0
33 fi
34 gl_PREREQ_STRDUP
35])
36
37# Prerequisites of lib/strdup.c.
38AC_DEFUN([gl_PREREQ_STRDUP], [:])
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index 85a0ace8..d1cb9c20 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
1# sys_socket_h.m4 serial 12 1# sys_socket_h.m4 serial 12
2dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2005-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -40,32 +40,54 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
40 else 40 else
41 SYS_SOCKET_H='sys/socket.h' 41 SYS_SOCKET_H='sys/socket.h'
42 fi 42 fi
43 # We need to check for ws2tcpip.h now.
44 gl_PREREQ_SYS_H_SOCKET
45 AC_CHECK_TYPES([struct sockaddr_storage],,,[
46 /* sys/types.h is not needed according to POSIX, but the
47 sys/socket.h in i386-unknown-freebsd4.10 and
48 powerpc-apple-darwin5.5 required it. */
49#include <sys/types.h>
50#ifdef HAVE_SYS_SOCKET_H
51#include <sys/socket.h>
52#endif
53#ifdef HAVE_WS2TCPIP_H
54#include <ws2tcpip.h>
55#endif
56])
57 if test $ac_cv_type_struct_sockaddr_storage = no; then
58 HAVE_STRUCT_SOCKADDR_STORAGE=0
59 SYS_SOCKET_H='sys/socket.h'
60 fi
43 if test -n "$SYS_SOCKET_H"; then 61 if test -n "$SYS_SOCKET_H"; then
44 dnl Check prerequisites of the <sys/socket.h> replacement.
45 gl_CHECK_NEXT_HEADERS([sys/socket.h])
46 if test $ac_cv_header_sys_socket_h = yes; then
47 HAVE_SYS_SOCKET_H=1
48 HAVE_WS2TCPIP_H=0
49 else
50 HAVE_SYS_SOCKET_H=0
51 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
52 dnl the check for those headers unconditional; yet cygwin reports
53 dnl that the headers are present but cannot be compiled (since on
54 dnl cygwin, all socket information should come from sys/socket.h).
55 AC_CHECK_HEADERS([ws2tcpip.h])
56 if test $ac_cv_header_ws2tcpip_h = yes; then
57 HAVE_WS2TCPIP_H=1
58 else
59 HAVE_WS2TCPIP_H=0
60 fi
61 fi
62 gl_PREREQ_SYS_H_WINSOCK2 62 gl_PREREQ_SYS_H_WINSOCK2
63 AC_SUBST([HAVE_SYS_SOCKET_H])
64 AC_SUBST([HAVE_WS2TCPIP_H])
65 fi 63 fi
66 AC_SUBST([SYS_SOCKET_H]) 64 AC_SUBST([SYS_SOCKET_H])
67]) 65])
68 66
67AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
68[
69 dnl Check prerequisites of the <sys/socket.h> replacement.
70 gl_CHECK_NEXT_HEADERS([sys/socket.h])
71 if test $ac_cv_header_sys_socket_h = yes; then
72 HAVE_SYS_SOCKET_H=1
73 HAVE_WS2TCPIP_H=0
74 else
75 HAVE_SYS_SOCKET_H=0
76 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
77 dnl the check for those headers unconditional; yet cygwin reports
78 dnl that the headers are present but cannot be compiled (since on
79 dnl cygwin, all socket information should come from sys/socket.h).
80 AC_CHECK_HEADERS([ws2tcpip.h])
81 if test $ac_cv_header_ws2tcpip_h = yes; then
82 HAVE_WS2TCPIP_H=1
83 else
84 HAVE_WS2TCPIP_H=0
85 fi
86 fi
87 AC_SUBST([HAVE_SYS_SOCKET_H])
88 AC_SUBST([HAVE_WS2TCPIP_H])
89])
90
69# Common prerequisites of of the <sys/socket.h> replacement and of the 91# Common prerequisites of of the <sys/socket.h> replacement and of the
70# <sys/select.h> replacement. 92# <sys/select.h> replacement.
71# Sets and substitutes HAVE_WINSOCK2_H. 93# Sets and substitutes HAVE_WINSOCK2_H.
@@ -114,4 +136,5 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
114 GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) 136 GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
115 GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) 137 GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
116 GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) 138 GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])
139 HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
117]) 140])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 56852736..ff9a4ea0 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
1# unistd_h.m4 serial 16 1# unistd_h.m4 serial 17
2dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -48,6 +48,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
48 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) 48 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
49 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) 49 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
50 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) 50 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
51 GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
51 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) 52 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
52 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) 53 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
53 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) 54 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
@@ -63,6 +64,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
63 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) 64 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
64 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) 65 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
65 HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) 66 HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL])
67 HAVE_LINK=1; AC_SUBST([HAVE_LINK])
66 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) 68 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
67 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) 69 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
68 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) 70 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index 9e839d2b..3a1d1e01 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
1# vasnprintf.m4 serial 26 1# vasnprintf.m4 serial 29
2dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2004, 2006-2009 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,
@@ -52,13 +52,13 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
52]) 52])
53 53
54# Prerequisites of lib/vasnprintf.c. 54# Prerequisites of lib/vasnprintf.c.
55AC_DEFUN([gl_PREREQ_VASNPRINTF], 55AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
56[ 56[
57 AC_REQUIRE([AC_FUNC_ALLOCA]) 57 AC_REQUIRE([AC_FUNC_ALLOCA])
58 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 58 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
59 AC_REQUIRE([gt_TYPE_WCHAR_T]) 59 AC_REQUIRE([gt_TYPE_WCHAR_T])
60 AC_REQUIRE([gt_TYPE_WINT_T]) 60 AC_REQUIRE([gt_TYPE_WINT_T])
61 AC_CHECK_FUNCS([snprintf wcslen]) 61 AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
62 dnl Use the _snprintf function only if it is declared (because on NetBSD it 62 dnl Use the _snprintf function only if it is declared (because on NetBSD it
63 dnl is defined as a weak alias of snprintf; we prefer to use the latter). 63 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
64 AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) 64 AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
@@ -66,7 +66,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
66 66
67# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' 67# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
68# arguments. 68# arguments.
69AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], 69AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
70[ 70[
71 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) 71 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
72 case "$gl_cv_func_printf_long_double" in 72 case "$gl_cv_func_printf_long_double" in
@@ -150,6 +150,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
150 esac 150 esac
151]) 151])
152 152
153# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive.
154AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
155[
156 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
157 case "$gl_cv_func_printf_directive_ls" in
158 *yes)
159 ;;
160 *)
161 AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1],
162 [Define if the vasnprintf implementation needs special code for
163 the 'ls' directive.])
164 ;;
165 esac
166])
167
153# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. 168# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
154AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], 169AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
155[ 170[
@@ -247,6 +262,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
247 gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE 262 gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
248 gl_PREREQ_VASNPRINTF_DIRECTIVE_A 263 gl_PREREQ_VASNPRINTF_DIRECTIVE_A
249 gl_PREREQ_VASNPRINTF_DIRECTIVE_F 264 gl_PREREQ_VASNPRINTF_DIRECTIVE_F
265 gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
250 gl_PREREQ_VASNPRINTF_FLAG_GROUPING 266 gl_PREREQ_VASNPRINTF_FLAG_GROUPING
251 gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST 267 gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
252 gl_PREREQ_VASNPRINTF_FLAG_ZERO 268 gl_PREREQ_VASNPRINTF_FLAG_ZERO
diff --git a/gl/m4/wchar.m4 b/gl/m4/wchar.m4
index ba8ee6ab..2e52a82a 100644
--- a/gl/m4/wchar.m4
+++ b/gl/m4/wchar.m4
@@ -1,13 +1,13 @@
1dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. 1dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
2 2
3dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl Written by Eric Blake. 8dnl Written by Eric Blake.
9 9
10# wchar.m4 serial 22 10# wchar.m4 serial 23
11 11
12AC_DEFUN([gl_WCHAR_H], 12AC_DEFUN([gl_WCHAR_H],
13[ 13[
@@ -73,27 +73,28 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
73 GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) 73 GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
74 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) 74 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
75 dnl Assume proper GNU behavior unless another module says otherwise. 75 dnl Assume proper GNU behavior unless another module says otherwise.
76 HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) 76 HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
77 HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) 77 HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
78 HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) 78 HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
79 HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) 79 HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
80 HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) 80 HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
81 HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) 81 HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
82 HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) 82 HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
83 HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) 83 HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
84 HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) 84 HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
85 HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) 85 HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
86 HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) 86 HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
87 REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) 87 REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
88 REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) 88 REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
89 REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) 89 REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
90 REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) 90 REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
91 REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) 91 REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
92 REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) 92 REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
93 REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) 93 REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
94 REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS]) 94 REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
95 REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) 95 REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
96 REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) 96 REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
97 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) 97 REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
98 WCHAR_H=''; AC_SUBST([WCHAR_H]) 98 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
99 WCHAR_H=''; AC_SUBST([WCHAR_H])
99]) 100])
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index 22d94336..cb7d9263 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
1# wcrtomb.m4 serial 2 1# wcrtomb.m4 serial 4
2dnl Copyright (C) 2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2009 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -9,12 +9,16 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) 9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10 10
11 AC_REQUIRE([AC_TYPE_MBSTATE_T]) 11 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 gl_MBSTATE_T_BROKEN
13 if test $REPLACE_MBSTATE_T = 1; then
14 REPLACE_WCRTOMB=1
15 fi
12 AC_CHECK_FUNCS_ONCE([wcrtomb]) 16 AC_CHECK_FUNCS_ONCE([wcrtomb])
13 if test $ac_cv_func_wcrtomb = no; then 17 if test $ac_cv_func_wcrtomb = no; then
14 HAVE_WCRTOMB=0 18 HAVE_WCRTOMB=0
15 else 19 fi
16 20 if test $HAVE_WCRTOMB != 0 && test $REPLACE_WCRTOMB != 1; then
17 dnl On OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes 21 dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
18 dnl returns 0 instead of 1. 22 dnl returns 0 instead of 1.
19 AC_REQUIRE([AC_PROG_CC]) 23 AC_REQUIRE([AC_PROG_CC])
20 AC_REQUIRE([gt_LOCALE_FR]) 24 AC_REQUIRE([gt_LOCALE_FR])
@@ -29,10 +33,10 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
29 dnl is present. 33 dnl is present.
30changequote(,)dnl 34changequote(,)dnl
31 case "$host_os" in 35 case "$host_os" in
32 # Guess no on OSF/1 and Solaris. 36 # Guess no on AIX 4, OSF/1 and Solaris.
33 osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; 37 aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
34 # Guess yes otherwise. 38 # Guess yes otherwise.
35 *) gl_cv_func_wcrtomb_retval="guessing yes" ;; 39 *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
36 esac 40 esac
37changequote([,])dnl 41changequote([,])dnl
38 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then 42 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
@@ -67,7 +71,7 @@ int main ()
67}], 71}],
68 [gl_cv_func_wcrtomb_retval=yes], 72 [gl_cv_func_wcrtomb_retval=yes],
69 [gl_cv_func_wcrtomb_retval=no], 73 [gl_cv_func_wcrtomb_retval=no],
70 []) 74 [:])
71 fi 75 fi
72 ]) 76 ])
73 case "$gl_cv_func_wcrtomb_retval" in 77 case "$gl_cv_func_wcrtomb_retval" in