summaryrefslogtreecommitdiffstats
path: root/gl/m4
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-15 09:22:57 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-15 10:19:08 (GMT)
commit71cdb52799220f8d9052643baf1d3e9836a9c755 (patch)
tree27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/m4
parentf7afa46586645e50498d8b2d0c67884f014dc3a4 (diff)
downloadmonitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz
Sync with gnulib
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/absolute-header.m449
-rw-r--r--gl/m4/alloca.m46
-rw-r--r--gl/m4/arpa_inet_h.m442
-rw-r--r--gl/m4/btowc.m468
-rw-r--r--gl/m4/c-strtod.m46
-rw-r--r--gl/m4/codeset.m412
-rw-r--r--gl/m4/double-slash-root.m410
-rw-r--r--gl/m4/eoverflow.m470
-rw-r--r--gl/m4/errno_h.m4119
-rw-r--r--gl/m4/extensions.m420
-rw-r--r--gl/m4/fcntl_h.m494
-rw-r--r--gl/m4/fsusage.m468
-rw-r--r--gl/m4/getaddrinfo.m496
-rw-r--r--gl/m4/gethostname.m411
-rw-r--r--gl/m4/getloadavg.m481
-rw-r--r--gl/m4/getopt.m46
-rw-r--r--gl/m4/gettext.m438
-rw-r--r--gl/m4/glibc2.m414
-rw-r--r--gl/m4/glibc21.m414
-rw-r--r--gl/m4/gnulib-cache.m420
-rw-r--r--gl/m4/gnulib-common.m442
-rw-r--r--gl/m4/gnulib-comp.m4127
-rw-r--r--gl/m4/gnulib-tool.m428
-rw-r--r--gl/m4/hostent.m445
-rw-r--r--gl/m4/iconv.m430
-rw-r--r--gl/m4/include_next.m4103
-rw-r--r--gl/m4/inet_ntop.m417
-rw-r--r--gl/m4/inline.m46
-rw-r--r--gl/m4/intdiv0.m48
-rw-r--r--gl/m4/intldir.m46
-rw-r--r--gl/m4/intlmacosx.m412
-rw-r--r--gl/m4/intmax.m412
-rw-r--r--gl/m4/intmax_t.m416
-rw-r--r--gl/m4/inttypes-pri.m412
-rw-r--r--gl/m4/inttypes_h.m412
-rw-r--r--gl/m4/lcmessage.m410
-rw-r--r--gl/m4/lib-ld.m414
-rw-r--r--gl/m4/lib-link.m4103
-rw-r--r--gl/m4/lib-prefix.m488
-rw-r--r--gl/m4/localcharset.m46
-rw-r--r--gl/m4/locale-fr.m4204
-rw-r--r--gl/m4/locale-ja.m4126
-rw-r--r--gl/m4/locale-zh.m4111
-rw-r--r--gl/m4/lock.m4313
-rw-r--r--gl/m4/longlong.m48
-rw-r--r--gl/m4/ls-mntd-fs.m491
-rw-r--r--gl/m4/malloc.m46
-rw-r--r--gl/m4/math_h.m441
-rw-r--r--gl/m4/mbrtowc.m4325
-rw-r--r--gl/m4/mbsinit.m430
-rw-r--r--gl/m4/mbstate_t.m422
-rw-r--r--gl/m4/mountlist.m48
-rw-r--r--gl/m4/multiarch.m474
-rw-r--r--gl/m4/netdb_h.m445
-rw-r--r--gl/m4/netinet_in_h.m46
-rw-r--r--gl/m4/nls.m412
-rw-r--r--gl/m4/onceonly.m4 (renamed from gl/m4/onceonly_2_57.m4)26
-rw-r--r--gl/m4/open.m466
-rw-r--r--gl/m4/po.m48
-rw-r--r--gl/m4/printf-posix.m413
-rw-r--r--gl/m4/printf.m41322
-rw-r--r--gl/m4/progtest.m414
-rw-r--r--gl/m4/regex.m416
-rw-r--r--gl/m4/servent.m447
-rw-r--r--gl/m4/size_max.m414
-rw-r--r--gl/m4/snprintf.m415
-rw-r--r--gl/m4/sockpfaf.m420
-rw-r--r--gl/m4/stdbool.m44
-rw-r--r--gl/m4/stdint.m441
-rw-r--r--gl/m4/stdint_h.m412
-rw-r--r--gl/m4/stdio_h.m4136
-rw-r--r--gl/m4/stdlib_h.m444
-rw-r--r--gl/m4/strdup.m422
-rw-r--r--gl/m4/strerror.m463
-rw-r--r--gl/m4/string_h.m413
-rw-r--r--gl/m4/strndup.m412
-rw-r--r--gl/m4/strnlen.m48
-rw-r--r--gl/m4/sys_socket_h.m490
-rw-r--r--gl/m4/threadlib.m4313
-rw-r--r--gl/m4/uintmax_t.m410
-rw-r--r--gl/m4/unistd_h.m446
-rw-r--r--gl/m4/vasnprintf.m437
-rw-r--r--gl/m4/visibility.m410
-rw-r--r--gl/m4/vsnprintf.m415
-rw-r--r--gl/m4/wchar.m457
-rw-r--r--gl/m4/wchar_t.m410
-rw-r--r--gl/m4/wcrtomb.m488
-rw-r--r--gl/m4/wctype.m434
-rw-r--r--gl/m4/wint_t.m410
-rw-r--r--gl/m4/write.m420
-rw-r--r--gl/m4/xsize.m46
91 files changed, 4509 insertions, 1116 deletions
diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
deleted file mode 100644
index 5b7a2fc..0000000
--- a/gl/m4/absolute-header.m4
+++ /dev/null
@@ -1,49 +0,0 @@
1# absolute-header.m4 serial 7
2dnl Copyright (C) 2006, 2007 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 Derek Price.
8
9# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
10# ---------------------------------------
11# Find the absolute name of a header file, assuming the header exists.
12# If the header were sys/inttypes.h, this macro would define
13# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
14# in config.h
15# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
16# The three "///" are to pacify Sun C 5.8, which otherwise would say
17# "warning: #include of /usr/include/... may be non-portable".
18# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
19AC_DEFUN([gl_ABSOLUTE_HEADER],
20[AC_LANG_PREPROC_REQUIRE()dnl
21AC_FOREACH([gl_HEADER_NAME], [$1],
22 [AS_VAR_PUSHDEF([gl_absolute_header],
23 [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
24 AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
25 m4_quote(m4_defn([gl_absolute_header])),
26 [AS_VAR_PUSHDEF([ac_header_exists],
27 [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
28 AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
29 if test AS_VAR_GET(ac_header_exists) = yes; then
30 AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
31dnl eval is necessary to expand ac_cpp.
32dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
33 AS_VAR_SET(gl_absolute_header,
34[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
35sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
36 s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
37 s#^/[^/]#//&#
38 p
39 q
40}'`])
41 fi
42 AS_VAR_POPDEF([ac_header_exists])dnl
43 ])dnl
44 AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
45 ["AS_VAR_GET(gl_absolute_header)"],
46 [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
47 AS_VAR_POPDEF([gl_absolute_header])dnl
48])dnl
49])# gl_ABSOLUTE_HEADER
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index 95f54a6..4b978e1 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
1# alloca.m4 serial 8 1# alloca.m4 serial 9
2dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2004, 2006, 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.
@@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA],
26 ]) 26 ])
27 if test $gl_cv_rpl_alloca = yes; then 27 if test $gl_cv_rpl_alloca = yes; then
28 dnl OK, alloca can be implemented through a compiler built-in. 28 dnl OK, alloca can be implemented through a compiler built-in.
29 AC_DEFINE([HAVE_ALLOCA], 1, 29 AC_DEFINE([HAVE_ALLOCA], [1],
30 [Define to 1 if you have 'alloca' after including <alloca.h>, 30 [Define to 1 if you have 'alloca' after including <alloca.h>,
31 a header that may be supplied by this distribution.]) 31 a header that may be supplied by this distribution.])
32 ALLOCA_H=alloca.h 32 ALLOCA_H=alloca.h
diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4
index d01d098..a6e63df 100644
--- a/gl/m4/arpa_inet_h.m4
+++ b/gl/m4/arpa_inet_h.m4
@@ -1,18 +1,50 @@
1# arpa_inet_h.m4 serial 1 1# arpa_inet_h.m4 serial 5
2dnl Copyright (C) 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2006, 2008 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
7dnl Written by Simon Josefsson 7dnl Written by Simon Josefsson and Bruno Haible
8 8
9AC_DEFUN([gl_HEADER_ARPA_INET], 9AC_DEFUN([gl_HEADER_ARPA_INET],
10[ 10[
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
14
11 AC_CHECK_HEADERS_ONCE([arpa/inet.h]) 15 AC_CHECK_HEADERS_ONCE([arpa/inet.h])
12 if test $ac_cv_header_arpa_inet_h = yes; then 16 if test $ac_cv_header_arpa_inet_h = yes; then
13 ARPA_INET_H='' 17 HAVE_ARPA_INET_H=1
14 else 18 else
15 ARPA_INET_H='arpa/inet.h' 19 ARPA_INET_H='arpa/inet.h'
20 HAVE_ARPA_INET_H=0
16 fi 21 fi
17 AC_SUBST(ARPA_INET_H) 22 AC_SUBST([HAVE_ARPA_INET_H])
23 dnl Execute this unconditionally, because ARPA_INET_H may be set by other
24 dnl modules, after this code is executed.
25 gl_CHECK_NEXT_HEADERS([arpa/inet.h])
26])
27
28dnl Unconditionally enables the replacement of <arpa/inet.h>.
29AC_DEFUN([gl_REPLACE_ARPA_INET_H],
30[
31 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
32 ARPA_INET_H='arpa/inet.h'
33])
34
35AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
36[
37 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
38 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
39 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
40])
41
42AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
43[
44 GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
45 GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
46 dnl Assume proper GNU behavior unless another module says otherwise.
47 HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
48 HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
49 ARPA_INET_H=''; AC_SUBST([ARPA_INET_H])
18]) 50])
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
new file mode 100644
index 0000000..64ff829
--- /dev/null
+++ b/gl/m4/btowc.m4
@@ -0,0 +1,68 @@
1# btowc.m4 serial 3
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_FUNC_BTOWC],
8[
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10
11 AC_CHECK_FUNCS_ONCE([btowc])
12 if test $ac_cv_func_btowc = no; then
13 HAVE_BTOWC=0
14 else
15
16 dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
17 AC_REQUIRE([AC_PROG_CC])
18 AC_REQUIRE([gt_LOCALE_FR])
19 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
20 AC_CACHE_CHECK([whether btowc(EOF) is correct],
21 [gl_cv_func_btowc_eof],
22 [
23 dnl Initial guess, used when cross-compiling or when no suitable locale
24 dnl is present.
25changequote(,)dnl
26 case "$host_os" in
27 # Guess no on IRIX.
28 irix*) gl_cv_func_btowc_eof="guessing no" ;;
29 # Guess yes otherwise.
30 *) gl_cv_func_btowc_eof="guessing yes" ;;
31 esac
32changequote([,])dnl
33 if test $LOCALE_FR != none; then
34 AC_TRY_RUN([
35#include <locale.h>
36#include <stdio.h>
37#include <string.h>
38#include <wchar.h>
39int main ()
40{
41 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
42 {
43 if (btowc (EOF) != WEOF)
44 return 1;
45 }
46 return 0;
47}],
48 [gl_cv_func_btowc_eof=yes],
49 [gl_cv_func_btowc_eof=no],
50 [])
51 fi
52 ])
53 case "$gl_cv_func_btowc_eof" in
54 *yes) ;;
55 *) REPLACE_BTOWC=1 ;;
56 esac
57 fi
58 if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
59 gl_REPLACE_WCHAR_H
60 AC_LIBOBJ([btowc])
61 gl_PREREQ_BTOWC
62 fi
63])
64
65# Prerequisites of lib/btowc.c.
66AC_DEFUN([gl_PREREQ_BTOWC], [
67 :
68])
diff --git a/gl/m4/c-strtod.m4 b/gl/m4/c-strtod.m4
index 7f206c7..0514f2d 100644
--- a/gl/m4/c-strtod.m4
+++ b/gl/m4/c-strtod.m4
@@ -1,6 +1,6 @@
1# c-strtod.m4 serial 9 1# c-strtod.m4 serial 10
2 2
3# Copyright (C) 2004, 2005, 2006 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
5# gives unlimited permission to copy and/or distribute it, 5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6# with or without modifications, as long as this notice is preserved.
@@ -29,7 +29,7 @@ AC_DEFUN([gl_C99_STRTOLD],
29 [gl_cv_func_c99_strtold=yes], 29 [gl_cv_func_c99_strtold=yes],
30 [gl_cv_func_c99_strtold=no])]) 30 [gl_cv_func_c99_strtold=no])])
31 if test $gl_cv_func_c99_strtold = yes; then 31 if test $gl_cv_func_c99_strtold = yes; then
32 AC_DEFINE([HAVE_C99_STRTOLD], 1, [Define to 1 if strtold conforms to C99.]) 32 AC_DEFINE([HAVE_C99_STRTOLD], [1], [Define to 1 if strtold conforms to C99.])
33 fi 33 fi
34]) 34])
35 35
diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4
index 223955b..413217b 100644
--- a/gl/m4/codeset.m4
+++ b/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
1# codeset.m4 serial 2 (gettext-0.16) 1# codeset.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 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.
@@ -8,14 +8,14 @@ dnl From Bruno Haible.
8 8
9AC_DEFUN([AM_LANGINFO_CODESET], 9AC_DEFUN([AM_LANGINFO_CODESET],
10[ 10[
11 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 11 AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
12 [AC_TRY_LINK([#include <langinfo.h>], 12 [AC_TRY_LINK([#include <langinfo.h>],
13 [char* cs = nl_langinfo(CODESET); return !cs;], 13 [char* cs = nl_langinfo(CODESET); return !cs;],
14 am_cv_langinfo_codeset=yes, 14 [am_cv_langinfo_codeset=yes],
15 am_cv_langinfo_codeset=no) 15 [am_cv_langinfo_codeset=no])
16 ]) 16 ])
17 if test $am_cv_langinfo_codeset = yes; then 17 if test $am_cv_langinfo_codeset = yes; then
18 AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 18 AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
19 [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) 19 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
20 fi 20 fi
21]) 21])
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
index 69d60d0..8c6841b 100644
--- a/gl/m4/double-slash-root.m4
+++ b/gl/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
1# double-slash-root.m4 serial 2 -*- Autoconf -*- 1# double-slash-root.m4 serial 4 -*- Autoconf -*-
2dnl Copyright (C) 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 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.
@@ -24,15 +24,15 @@ AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
24 gl_cv_double_slash_root='unknown, assuming no' ;; 24 gl_cv_double_slash_root='unknown, assuming no' ;;
25 esac 25 esac
26 else 26 else
27 set x `ls -di / //` 27 set x `ls -di / // 2>/dev/null`
28 if test $[2] = $[4] && wc //dev/null >/dev/null 2>&1; then 28 if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
29 gl_cv_double_slash_root=no 29 gl_cv_double_slash_root=no
30 else 30 else
31 gl_cv_double_slash_root=yes 31 gl_cv_double_slash_root=yes
32 fi 32 fi
33 fi]) 33 fi])
34 if test "$gl_cv_double_slash_root" = yes; then 34 if test "$gl_cv_double_slash_root" = yes; then
35 AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], 1, 35 AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
36 [Define to 1 if // is a file system root distinct from /.]) 36 [Define to 1 if // is a file system root distinct from /.])
37 fi 37 fi
38]) 38])
diff --git a/gl/m4/eoverflow.m4 b/gl/m4/eoverflow.m4
deleted file mode 100644
index 3bffd10..0000000
--- a/gl/m4/eoverflow.m4
+++ /dev/null
@@ -1,70 +0,0 @@
1# eoverflow.m4 serial 2
2dnl Copyright (C) 2004, 2006 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
9# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
10# POSIX. But some systems (like AIX 3) don't define it, and some systems
11# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
12
13# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
14# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
15# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
16# value.
17
18AC_DEFUN([gl_EOVERFLOW],
19[
20 AC_REQUIRE([AC_PROG_CC])dnl
21
22 AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
23 AC_EGREP_CPP(yes,[
24#include <errno.h>
25#ifdef EOVERFLOW
26yes
27#endif
28 ], have_eoverflow=1)
29 if test -n "$have_eoverflow"; then
30 dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
31 ac_cv_decl_EOVERFLOW=yes
32 else
33 AC_EGREP_CPP(yes,[
34#define _XOPEN_SOURCE_EXTENDED 1
35#include <errno.h>
36#ifdef EOVERFLOW
37yes
38#endif
39 ], have_eoverflow=1)
40 if test -n "$have_eoverflow"; then
41 dnl EOVERFLOW exists but is hidden.
42 dnl Define it to the same value.
43 AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [
44#define _XOPEN_SOURCE_EXTENDED 1
45#include <errno.h>
46/* The following two lines are a workaround against an autoconf-2.52 bug. */
47#include <stdio.h>
48#include <stdlib.h>
49])
50 else
51 dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
52 dnl don't define it as EINVAL, because snprintf() callers want to
53 dnl distinguish EINVAL and EOVERFLOW.
54 ac_cv_decl_EOVERFLOW=E2BIG
55 fi
56 fi
57 ])
58 if test "$ac_cv_decl_EOVERFLOW" != yes; then
59 AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
60 [Define as good substitute value for EOVERFLOW.])
61 EOVERFLOW="$ac_cv_decl_EOVERFLOW"
62 AC_SUBST(EOVERFLOW)
63 fi
64])
65
66dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
67dnl Remove this when we can assume autoconf >= 2.61.
68m4_ifdef([AC_COMPUTE_INT], [], [
69 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
70])
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
new file mode 100644
index 0000000..0682d1a
--- /dev/null
+++ b/gl/m4/errno_h.m4
@@ -0,0 +1,119 @@
1# errno_h.m4 serial 3
2dnl Copyright (C) 2004, 2006, 2008, 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
7AC_DEFUN([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[
16 AC_REQUIRE([AC_PROG_CC])
17 AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
18 AC_EGREP_CPP([booboo],[
19#include <errno.h>
20#if !defined ENOMSG
21booboo
22#endif
23#if !defined EIDRM
24booboo
25#endif
26#if !defined ENOLINK
27booboo
28#endif
29#if !defined EPROTO
30booboo
31#endif
32#if !defined EMULTIHOP
33booboo
34#endif
35#if !defined EBADMSG
36booboo
37#endif
38#if !defined EOVERFLOW
39booboo
40#endif
41#if !defined ENOTSUP
42booboo
43#endif
44#if !defined ECANCELED
45booboo
46#endif
47 ],
48 [gl_cv_header_errno_h_complete=no],
49 [gl_cv_header_errno_h_complete=yes])
50 ])
51 if test $gl_cv_header_errno_h_complete = yes; then
52 ERRNO_H=''
53 else
54 gl_CHECK_NEXT_HEADERS([errno.h])
55 ERRNO_H='errno.h'
56 fi
57 AC_SUBST([ERRNO_H])
58 gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
59 gl_REPLACE_ERRNO_VALUE([ENOLINK])
60 gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
61])
62
63# Assuming $1 = EOVERFLOW.
64# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
65# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
66# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
67# Check for the value of EOVERFLOW.
68# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
69AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
70[
71 if test -n "$ERRNO_H"; then
72 AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
73 AC_EGREP_CPP([yes],[
74#include <errno.h>
75#ifdef ]$1[
76yes
77#endif
78 ],
79 [gl_cv_header_errno_h_]$1[=yes],
80 [gl_cv_header_errno_h_]$1[=no])
81 if test $gl_cv_header_errno_h_]$1[ = no; then
82 AC_EGREP_CPP([yes],[
83#define _XOPEN_SOURCE_EXTENDED 1
84#include <errno.h>
85#ifdef ]$1[
86yes
87#endif
88 ], [gl_cv_header_errno_h_]$1[=hidden])
89 if test $gl_cv_header_errno_h_]$1[ = hidden; then
90 dnl The macro exists but is hidden.
91 dnl Define it to the same value.
92 AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
93#define _XOPEN_SOURCE_EXTENDED 1
94#include <errno.h>
95/* The following two lines are a workaround against an autoconf-2.52 bug. */
96#include <stdio.h>
97#include <stdlib.h>
98])
99 fi
100 fi
101 ])
102 case $gl_cv_header_errno_h_]$1[ in
103 yes | no)
104 ]$1[_HIDDEN=0; ]$1[_VALUE=
105 ;;
106 *)
107 ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
108 ;;
109 esac
110 AC_SUBST($1[_HIDDEN])
111 AC_SUBST($1[_VALUE])
112 fi
113])
114
115dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
116dnl Remove this when we can assume autoconf >= 2.61.
117m4_ifdef([AC_COMPUTE_INT], [], [
118 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
119])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index bcbb3ce..611fcfd 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
1# serial 5 -*- Autoconf -*- 1# serial 6 -*- 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, 2007 Free Software Foundation, Inc. 4# Copyright (C) 2003, 2006-2008 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.
@@ -24,6 +24,8 @@ AC_DEFUN([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
27 AC_REQUIRE([AC_CANONICAL_HOST])
28
27 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) 29 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
28 if test "$MINIX" = yes; then 30 if test "$MINIX" = yes; then
29 AC_DEFINE([_POSIX_SOURCE], [1], 31 AC_DEFINE([_POSIX_SOURCE], [1],
@@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
36 [Define to 1 if on MINIX.]) 38 [Define to 1 if on MINIX.])
37 fi 39 fi
38 40
41 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
42 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
43 dnl provided.
44 case "$host_os" in
45 hpux*)
46 AC_DEFINE([_XOPEN_SOURCE], [500],
47 [Define to 500 only on HP-UX.])
48 ;;
49 esac
50
39 AH_VERBATIM([__EXTENSIONS__], 51 AH_VERBATIM([__EXTENSIONS__],
40[/* Enable extensions on AIX 3, Interix. */ 52[/* Enable extensions on AIX 3, Interix. */
41#ifndef _ALL_SOURCE 53#ifndef _ALL_SOURCE
@@ -61,9 +73,9 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
61 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], 73 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
62 [ac_cv_safe_to_define___extensions__], 74 [ac_cv_safe_to_define___extensions__],
63 [AC_COMPILE_IFELSE( 75 [AC_COMPILE_IFELSE(
64 [AC_LANG_PROGRAM([ 76 [AC_LANG_PROGRAM([[
65# define __EXTENSIONS__ 1 77# define __EXTENSIONS__ 1
66 AC_INCLUDES_DEFAULT])], 78 ]AC_INCLUDES_DEFAULT])],
67 [ac_cv_safe_to_define___extensions__=yes], 79 [ac_cv_safe_to_define___extensions__=yes],
68 [ac_cv_safe_to_define___extensions__=no])]) 80 [ac_cv_safe_to_define___extensions__=no])])
69 test $ac_cv_safe_to_define___extensions__ = yes && 81 test $ac_cv_safe_to_define___extensions__ = yes &&
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
new file mode 100644
index 0000000..4a7fc42
--- /dev/null
+++ b/gl/m4/fcntl_h.m4
@@ -0,0 +1,94 @@
1# Configure fcntl.h.
2dnl Copyright (C) 2006, 2007, 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 Written by Paul Eggert.
8
9AC_DEFUN([gl_FCNTL_H],
10[
11 AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
12 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
13 [AC_RUN_IFELSE(
14 [AC_LANG_PROGRAM(
15 [[#include <sys/types.h>
16 #include <sys/stat.h>
17 #include <unistd.h>
18 #include <fcntl.h>
19 #ifndef O_NOATIME
20 #define O_NOATIME 0
21 #endif
22 #ifndef O_NOFOLLOW
23 #define O_NOFOLLOW 0
24 #endif
25 static int const constants[] =
26 {
27 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
28 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
29 };
30 ]],
31 [[
32 int status = !constants;
33 {
34 static char const sym[] = "conftest.sym";
35 if (symlink (".", sym) != 0
36 || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
37 status |= 32;
38 }
39 {
40 static char const file[] = "confdefs.h";
41 int fd = open (file, O_RDONLY | O_NOATIME);
42 char c;
43 struct stat st0, st1;
44 if (fd < 0
45 || fstat (fd, &st0) != 0
46 || sleep (1) != 0
47 || read (fd, &c, 1) != 1
48 || close (fd) != 0
49 || stat (file, &st1) != 0
50 || st0.st_atime != st1.st_atime)
51 status |= 64;
52 }
53 return status;]])],
54 [gl_cv_header_working_fcntl_h=yes],
55 [case $? in #(
56 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
57 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
58 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
59 *) gl_cv_header_working_fcntl_h='no';;
60 esac],
61 [gl_cv_header_working_fcntl_h=cross-compiling])])
62
63 case $gl_cv_header_working_fcntl_h in #(
64 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
65 *) ac_val=1;;
66 esac
67 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
68 [Define to 1 if O_NOATIME works.])
69
70 case $gl_cv_header_working_fcntl_h in #(
71 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
72 *) ac_val=1;;
73 esac
74 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
75 [Define to 1 if O_NOFOLLOW works.])
76
77 gl_CHECK_NEXT_HEADERS([fcntl.h])
78 FCNTL_H='fcntl.h'
79 AC_SUBST([FCNTL_H])
80])
81
82AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
83[
84 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
85 AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
86 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
87])
88
89AC_DEFUN([gl_FCNTL_H_DEFAULTS],
90[
91 GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
92 dnl Assume proper GNU behavior unless another module says otherwise.
93 REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
94])
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4
index 18eedbc..8b8cbf7 100644
--- a/gl/m4/fsusage.m4
+++ b/gl/m4/fsusage.m4
@@ -1,7 +1,7 @@
1#serial 23 1# serial 24
2# Obtaining file system usage information. 2# Obtaining file system usage information.
3 3
4# Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc. 4# Copyright (C) 1997-1998, 2000-2001, 2003-2009 Free Software Foundation, Inc.
5# 5#
6# This file is free software; the Free Software Foundation 6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -11,16 +11,16 @@
11 11
12AC_DEFUN([gl_FSUSAGE], 12AC_DEFUN([gl_FSUSAGE],
13[ 13[
14 AC_CHECK_HEADERS_ONCE(sys/param.h) 14 AC_CHECK_HEADERS_ONCE([sys/param.h])
15 AC_CHECK_HEADERS_ONCE(sys/vfs.h sys/fs_types.h) 15 AC_CHECK_HEADERS_ONCE([sys/vfs.h sys/fs_types.h])
16 AC_CHECK_HEADERS(sys/mount.h, [], [], 16 AC_CHECK_HEADERS([sys/mount.h], [], [],
17 [AC_INCLUDES_DEFAULT 17 [AC_INCLUDES_DEFAULT
18 [#if HAVE_SYS_PARAM_H 18 [#if HAVE_SYS_PARAM_H
19 #include <sys/param.h> 19 #include <sys/param.h>
20 #endif]]) 20 #endif]])
21 gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) 21 gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
22 if test $gl_cv_fs_space = yes; then 22 if test $gl_cv_fs_space = yes; then
23 AC_LIBOBJ(fsusage) 23 AC_LIBOBJ([fsusage])
24 gl_PREREQ_FSUSAGE_EXTRA 24 gl_PREREQ_FSUSAGE_EXTRA
25 fi 25 fi
26]) 26])
@@ -38,21 +38,21 @@ AC_MSG_NOTICE([checking how to get file system space usage])
38ac_fsusage_space=no 38ac_fsusage_space=no
39 39
40# Perform only the link test since it seems there are no variants of the 40# Perform only the link test since it seems there are no variants of the
41# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) 41# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
42# because that got a false positive on SCO OSR5. Adding the declaration 42# because that got a false positive on SCO OSR5. Adding the declaration
43# of a `struct statvfs' causes this test to fail (as it should) on such 43# of a `struct statvfs' causes this test to fail (as it should) on such
44# systems. That system is reported to work fine with STAT_STATFS4 which 44# systems. That system is reported to work fine with STAT_STATFS4 which
45# is what it gets when this test fails. 45# is what it gets when this test fails.
46if test $ac_fsusage_space = no; then 46if test $ac_fsusage_space = no; then
47 # SVR4 47 # SVR4
48 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs, 48 AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
49 [AC_TRY_LINK([#include <sys/types.h> 49 [AC_TRY_LINK([#include <sys/types.h>
50#if defined __GLIBC__ && !defined __BEOS__ 50#if defined __GLIBC__ && defined __linux__
51Do not use statvfs on systems with GNU libc, because that function stats 51Do not use statvfs on systems with GNU libc on Linux, because that function
52all preceding entries in /proc/mounts, and that makes df hang if even 52stats all preceding entries in /proc/mounts, and that makes df hang if even
53one of the corresponding file systems is hard-mounted, but not available. 53one of the corresponding file systems is hard-mounted, but not available.
54statvfs in GNU libc on BeOS operates differently: it only makes a system 54statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes
55call. 55a system call.
56#endif 56#endif
57 57
58#ifdef __osf__ 58#ifdef __osf__
@@ -65,7 +65,7 @@ call.
65 fu_cv_sys_stat_statvfs=no)]) 65 fu_cv_sys_stat_statvfs=no)])
66 if test $fu_cv_sys_stat_statvfs = yes; then 66 if test $fu_cv_sys_stat_statvfs = yes; then
67 ac_fsusage_space=yes 67 ac_fsusage_space=yes
68 AC_DEFINE(STAT_STATVFS, 1, 68 AC_DEFINE([STAT_STATVFS], [1],
69 [ Define if there is a function named statvfs. (SVR4)]) 69 [ Define if there is a function named statvfs. (SVR4)])
70 fi 70 fi
71fi 71fi
@@ -73,7 +73,7 @@ fi
73if test $ac_fsusage_space = no; then 73if test $ac_fsusage_space = no; then
74 # DEC Alpha running OSF/1 74 # DEC Alpha running OSF/1
75 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) 75 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
76 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, 76 AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1],
77 [AC_TRY_RUN([ 77 [AC_TRY_RUN([
78#include <sys/param.h> 78#include <sys/param.h>
79#include <sys/types.h> 79#include <sys/types.h>
@@ -88,10 +88,10 @@ if test $ac_fsusage_space = no; then
88 fu_cv_sys_stat_statfs3_osf1=yes, 88 fu_cv_sys_stat_statfs3_osf1=yes,
89 fu_cv_sys_stat_statfs3_osf1=no, 89 fu_cv_sys_stat_statfs3_osf1=no,
90 fu_cv_sys_stat_statfs3_osf1=no)]) 90 fu_cv_sys_stat_statfs3_osf1=no)])
91 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) 91 AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1])
92 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then 92 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
93 ac_fsusage_space=yes 93 ac_fsusage_space=yes
94 AC_DEFINE(STAT_STATFS3_OSF1, 1, 94 AC_DEFINE([STAT_STATFS3_OSF1], [1],
95 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) 95 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
96 fi 96 fi
97fi 97fi
@@ -100,7 +100,7 @@ if test $ac_fsusage_space = no; then
100# AIX 100# AIX
101 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl 101 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
102member (AIX, 4.3BSD)]) 102member (AIX, 4.3BSD)])
103 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, 103 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize],
104 [AC_TRY_RUN([ 104 [AC_TRY_RUN([
105#ifdef HAVE_SYS_PARAM_H 105#ifdef HAVE_SYS_PARAM_H
106#include <sys/param.h> 106#include <sys/param.h>
@@ -121,10 +121,10 @@ member (AIX, 4.3BSD)])
121 fu_cv_sys_stat_statfs2_bsize=yes, 121 fu_cv_sys_stat_statfs2_bsize=yes,
122 fu_cv_sys_stat_statfs2_bsize=no, 122 fu_cv_sys_stat_statfs2_bsize=no,
123 fu_cv_sys_stat_statfs2_bsize=no)]) 123 fu_cv_sys_stat_statfs2_bsize=no)])
124 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) 124 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
125 if test $fu_cv_sys_stat_statfs2_bsize = yes; then 125 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
126 ac_fsusage_space=yes 126 ac_fsusage_space=yes
127 AC_DEFINE(STAT_STATFS2_BSIZE, 1, 127 AC_DEFINE([STAT_STATFS2_BSIZE], [1],
128[ Define if statfs takes 2 args and struct statfs has a field named f_bsize. 128[ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
129 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)]) 129 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
130 fi 130 fi
@@ -133,7 +133,7 @@ fi
133if test $ac_fsusage_space = no; then 133if test $ac_fsusage_space = no; then
134# SVR3 134# SVR3
135 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) 135 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
136 AC_CACHE_VAL(fu_cv_sys_stat_statfs4, 136 AC_CACHE_VAL([fu_cv_sys_stat_statfs4],
137 [AC_TRY_RUN([#include <sys/types.h> 137 [AC_TRY_RUN([#include <sys/types.h>
138#include <sys/statfs.h> 138#include <sys/statfs.h>
139 int 139 int
@@ -145,10 +145,10 @@ if test $ac_fsusage_space = no; then
145 fu_cv_sys_stat_statfs4=yes, 145 fu_cv_sys_stat_statfs4=yes,
146 fu_cv_sys_stat_statfs4=no, 146 fu_cv_sys_stat_statfs4=no,
147 fu_cv_sys_stat_statfs4=no)]) 147 fu_cv_sys_stat_statfs4=no)])
148 AC_MSG_RESULT($fu_cv_sys_stat_statfs4) 148 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
149 if test $fu_cv_sys_stat_statfs4 = yes; then 149 if test $fu_cv_sys_stat_statfs4 = yes; then
150 ac_fsusage_space=yes 150 ac_fsusage_space=yes
151 AC_DEFINE(STAT_STATFS4, 1, 151 AC_DEFINE([STAT_STATFS4], [1],
152 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)]) 152 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
153 fi 153 fi
154fi 154fi
@@ -157,7 +157,7 @@ if test $ac_fsusage_space = no; then
157# 4.4BSD and NetBSD 157# 4.4BSD and NetBSD
158 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl 158 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
159member (4.4BSD and NetBSD)]) 159member (4.4BSD and NetBSD)])
160 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, 160 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize],
161 [AC_TRY_RUN([#include <sys/types.h> 161 [AC_TRY_RUN([#include <sys/types.h>
162#ifdef HAVE_SYS_PARAM_H 162#ifdef HAVE_SYS_PARAM_H
163#include <sys/param.h> 163#include <sys/param.h>
@@ -175,10 +175,10 @@ member (4.4BSD and NetBSD)])
175 fu_cv_sys_stat_statfs2_fsize=yes, 175 fu_cv_sys_stat_statfs2_fsize=yes,
176 fu_cv_sys_stat_statfs2_fsize=no, 176 fu_cv_sys_stat_statfs2_fsize=no,
177 fu_cv_sys_stat_statfs2_fsize=no)]) 177 fu_cv_sys_stat_statfs2_fsize=no)])
178 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) 178 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
179 if test $fu_cv_sys_stat_statfs2_fsize = yes; then 179 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
180 ac_fsusage_space=yes 180 ac_fsusage_space=yes
181 AC_DEFINE(STAT_STATFS2_FSIZE, 1, 181 AC_DEFINE([STAT_STATFS2_FSIZE], [1],
182[ Define if statfs takes 2 args and struct statfs has a field named f_fsize. 182[ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
183 (4.4BSD, NetBSD)]) 183 (4.4BSD, NetBSD)])
184 fi 184 fi
@@ -187,7 +187,7 @@ fi
187if test $ac_fsusage_space = no; then 187if test $ac_fsusage_space = no; then
188 # Ultrix 188 # Ultrix
189 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) 189 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
190 AC_CACHE_VAL(fu_cv_sys_stat_fs_data, 190 AC_CACHE_VAL([fu_cv_sys_stat_fs_data],
191 [AC_TRY_RUN([#include <sys/types.h> 191 [AC_TRY_RUN([#include <sys/types.h>
192#ifdef HAVE_SYS_PARAM_H 192#ifdef HAVE_SYS_PARAM_H
193#include <sys/param.h> 193#include <sys/param.h>
@@ -209,10 +209,10 @@ if test $ac_fsusage_space = no; then
209 fu_cv_sys_stat_fs_data=yes, 209 fu_cv_sys_stat_fs_data=yes,
210 fu_cv_sys_stat_fs_data=no, 210 fu_cv_sys_stat_fs_data=no,
211 fu_cv_sys_stat_fs_data=no)]) 211 fu_cv_sys_stat_fs_data=no)])
212 AC_MSG_RESULT($fu_cv_sys_stat_fs_data) 212 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
213 if test $fu_cv_sys_stat_fs_data = yes; then 213 if test $fu_cv_sys_stat_fs_data = yes; then
214 ac_fsusage_space=yes 214 ac_fsusage_space=yes
215 AC_DEFINE(STAT_STATFS2_FS_DATA, 1, 215 AC_DEFINE([STAT_STATFS2_FS_DATA], [1],
216[ Define if statfs takes 2 args and the second argument has 216[ Define if statfs takes 2 args and the second argument has
217 type struct fs_data. (Ultrix)]) 217 type struct fs_data. (Ultrix)])
218 fi 218 fi
@@ -222,7 +222,7 @@ if test $ac_fsusage_space = no; then
222 # SVR2 222 # SVR2
223 AC_TRY_CPP([#include <sys/filsys.h> 223 AC_TRY_CPP([#include <sys/filsys.h>
224 ], 224 ],
225 AC_DEFINE(STAT_READ_FILSYS, 1, 225 AC_DEFINE([STAT_READ_FILSYS], [1],
226 [Define if there is no specific function for reading file systems usage 226 [Define if there is no specific function for reading file systems usage
227 information and you have the <sys/filsys.h> header file. (SVR2)]) 227 information and you have the <sys/filsys.h> header file. (SVR2)])
228 ac_fsusage_space=yes) 228 ac_fsusage_space=yes)
@@ -239,7 +239,7 @@ AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
239AC_DEFUN([gl_STATFS_TRUNCATES], 239AC_DEFUN([gl_STATFS_TRUNCATES],
240[ 240[
241 AC_MSG_CHECKING([for statfs that truncates block counts]) 241 AC_MSG_CHECKING([for statfs that truncates block counts])
242 AC_CACHE_VAL(fu_cv_sys_truncating_statfs, 242 AC_CACHE_VAL([fu_cv_sys_truncating_statfs],
243 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 243 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
244#if !defined(sun) && !defined(__sun) 244#if !defined(sun) && !defined(__sun)
245choke -- this is a workaround for a Sun-specific problem 245choke -- this is a workaround for a Sun-specific problem
@@ -251,19 +251,19 @@ choke -- this is a workaround for a Sun-specific problem
251 [fu_cv_sys_truncating_statfs=yes], 251 [fu_cv_sys_truncating_statfs=yes],
252 [fu_cv_sys_truncating_statfs=no])]) 252 [fu_cv_sys_truncating_statfs=no])])
253 if test $fu_cv_sys_truncating_statfs = yes; then 253 if test $fu_cv_sys_truncating_statfs = yes; then
254 AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1, 254 AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1],
255 [Define if the block counts reported by statfs may be truncated to 2GB 255 [Define if the block counts reported by statfs may be truncated to 2GB
256 and the correct values may be stored in the f_spare array. 256 and the correct values may be stored in the f_spare array.
257 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. 257 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
258 SunOS 4.1.1 seems not to be affected.)]) 258 SunOS 4.1.1 seems not to be affected.)])
259 fi 259 fi
260 AC_MSG_RESULT($fu_cv_sys_truncating_statfs) 260 AC_MSG_RESULT([$fu_cv_sys_truncating_statfs])
261]) 261])
262 262
263 263
264# Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. 264# Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE.
265AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], 265AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
266[ 266[
267 AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h) 267 AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h])
268 gl_STATFS_TRUNCATES 268 gl_STATFS_TRUNCATES
269]) 269])
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
index 5d36c19..4088671 100644
--- a/gl/m4/getaddrinfo.m4
+++ b/gl/m4/getaddrinfo.m4
@@ -1,5 +1,5 @@
1# getaddrinfo.m4 serial 15 1# getaddrinfo.m4 serial 20
2dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-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.
@@ -7,11 +7,23 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_GETADDRINFO], 7AC_DEFUN([gl_GETADDRINFO],
8[ 8[
9 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H 9 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
10 AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
10 AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) 11 AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
12 GETADDRINFO_LIB=
13 gai_saved_LIBS="$LIBS"
11 14
12 AC_CHECK_HEADERS_ONCE(netdb.h) 15 dnl Where is getaddrinfo()?
16 dnl - On Solaris, it is in libsocket.
17 dnl - On Haiku, it is in libnetwork.
18 dnl - On BeOS, it is in libnet.
19 dnl - On native Windows, it is in ws2_32.dll.
20 dnl - Otherwise it is in libc.
21 AC_SEARCH_LIBS([getaddrinfo], [socket network net],
22 [if test "$ac_cv_search_getaddrinfo" != "none required"; then
23 GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
24 fi])
25 LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
13 26
14 AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
15 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ 27 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
16 AC_TRY_LINK([ 28 AC_TRY_LINK([
17#include <sys/types.h> 29#include <sys/types.h>
@@ -26,7 +38,7 @@ AC_DEFUN([gl_GETADDRINFO],
26 [gl_cv_func_getaddrinfo=yes], 38 [gl_cv_func_getaddrinfo=yes],
27 [gl_cv_func_getaddrinfo=no])]) 39 [gl_cv_func_getaddrinfo=no])])
28 if test $gl_cv_func_getaddrinfo = no; then 40 if test $gl_cv_func_getaddrinfo = no; then
29 AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32, 41 AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
30 gl_cv_w32_getaddrinfo, [ 42 gl_cv_w32_getaddrinfo, [
31 gl_cv_w32_getaddrinfo=no 43 gl_cv_w32_getaddrinfo=no
32 am_save_LIBS="$LIBS" 44 am_save_LIBS="$LIBS"
@@ -37,11 +49,13 @@ AC_DEFUN([gl_GETADDRINFO],
37#endif 49#endif
38#include <stddef.h> 50#include <stddef.h>
39], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes) 51], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
40 LIBS="$am_save_LIBS"]) 52 LIBS="$am_save_LIBS"
53 ])
41 if test "$gl_cv_w32_getaddrinfo" = "yes"; then 54 if test "$gl_cv_w32_getaddrinfo" = "yes"; then
42 LIBS="$LIBS -lws2_32" 55 GETADDRINFO_LIB="-lws2_32"
56 LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
43 else 57 else
44 AC_LIBOBJ(getaddrinfo) 58 AC_LIBOBJ([getaddrinfo])
45 fi 59 fi
46 fi 60 fi
47 61
@@ -66,40 +80,34 @@ AC_DEFUN([gl_GETADDRINFO],
66 [gl_cv_func_gai_strerror=yes], 80 [gl_cv_func_gai_strerror=yes],
67 [gl_cv_func_gai_strerror=no])]) 81 [gl_cv_func_gai_strerror=no])])
68 if test $gl_cv_func_gai_strerror = no; then 82 if test $gl_cv_func_gai_strerror = no; then
69 AC_LIBOBJ(gai_strerror) 83 AC_LIBOBJ([gai_strerror])
70 fi 84 fi
71 85
86 LIBS="$gai_saved_LIBS"
87
72 gl_PREREQ_GETADDRINFO 88 gl_PREREQ_GETADDRINFO
89
90 AC_SUBST([GETADDRINFO_LIB])
73]) 91])
74 92
75# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c. 93# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c.
76AC_DEFUN([gl_PREREQ_GETADDRINFO], [ 94AC_DEFUN([gl_PREREQ_GETADDRINFO], [
95 AC_REQUIRE([gl_NETDB_H_DEFAULTS])
77 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H 96 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
78 AC_SEARCH_LIBS(gethostbyname, [inet nsl]) 97 AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
79 AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) 98 AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
80 AC_CHECK_FUNCS(gethostbyname,, [
81 AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32,
82 gl_cv_w32_gethostbyname, [
83 gl_cv_w32_gethostbyname=no
84 am_save_LIBS="$LIBS"
85 LIBS="$LIBS -lws2_32"
86 AC_TRY_LINK([
87#ifdef HAVE_WINSOCK2_H
88#include <winsock2.h>
89#endif
90#include <stddef.h>
91], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes)
92 LIBS="$am_save_LIBS"])
93 if test "$gl_cv_w32_gethostbyname" = "yes"; then
94 LIBS="$LIBS -lws2_32"
95 fi
96 ])
97 AC_REQUIRE([AC_C_RESTRICT]) 99 AC_REQUIRE([AC_C_RESTRICT])
98 AC_REQUIRE([gl_SOCKET_FAMILIES]) 100 AC_REQUIRE([gl_SOCKET_FAMILIES])
99 AC_REQUIRE([gl_HEADER_SYS_SOCKET]) 101 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
100 AC_REQUIRE([AC_C_INLINE]) 102 AC_REQUIRE([AC_C_INLINE])
101 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 103 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
102 AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h) 104
105 dnl Including sys/socket.h is wrong for Windows, but Windows does not
106 dnl have sa_len so the result is correct anyway.
107 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>])
108
109 AC_CHECK_HEADERS_ONCE([netinet/in.h])
110
103 AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ 111 AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
104 /* sys/types.h is not needed according to POSIX, but the 112 /* sys/types.h is not needed according to POSIX, but the
105 sys/socket.h in i386-unknown-freebsd4.10 and 113 sys/socket.h in i386-unknown-freebsd4.10 and
@@ -115,6 +123,19 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
115#include <ws2tcpip.h> 123#include <ws2tcpip.h>
116#endif 124#endif
117]) 125])
126 if test $ac_cv_have_decl_getaddrinfo = no; then
127 HAVE_DECL_GETADDRINFO=0
128 fi
129 if test $ac_cv_have_decl_freeaddrinfo = no; then
130 HAVE_DECL_FREEADDRINFO=0
131 fi
132 if test $ac_cv_have_decl_gai_strerror = no; then
133 HAVE_DECL_GAI_STRERROR=0
134 fi
135 if test $ac_cv_have_decl_getnameinfo = no; then
136 HAVE_DECL_GETNAMEINFO=0
137 fi
138
118 AC_CHECK_TYPES([struct addrinfo],,,[ 139 AC_CHECK_TYPES([struct addrinfo],,,[
119#include <sys/types.h> 140#include <sys/types.h>
120#ifdef HAVE_SYS_SOCKET_H 141#ifdef HAVE_SYS_SOCKET_H
@@ -127,4 +148,19 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
127#include <ws2tcpip.h> 148#include <ws2tcpip.h>
128#endif 149#endif
129]) 150])
151 if test $ac_cv_type_struct_addrinfo = no; then
152 HAVE_STRUCT_ADDRINFO=0
153 fi
154
155 dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
156 case " $GETADDRINFO_LIB " in
157 *" $HOSTENT_LIB "*) ;;
158 *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
159 esac
160
161 dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
162 case " $GETADDRINFO_LIB " in
163 *" $SERVENT_LIB "*) ;;
164 *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
165 esac
130]) 166])
diff --git a/gl/m4/gethostname.m4 b/gl/m4/gethostname.m4
index 1e9749d..6b6fca9 100644
--- a/gl/m4/gethostname.m4
+++ b/gl/m4/gethostname.m4
@@ -1,18 +1,21 @@
1# gethostname.m4 serial 2 1# gethostname.m4 serial 5
2dnl Copyright (C) 2002 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 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_FUNC_GETHOSTNAME], 7AC_DEFUN([gl_FUNC_GETHOSTNAME],
8[ 8[
9 AC_REPLACE_FUNCS(gethostname) 9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 gl_PREREQ_SYS_H_WINSOCK2
11 AC_REPLACE_FUNCS([gethostname])
10 if test $ac_cv_func_gethostname = no; then 12 if test $ac_cv_func_gethostname = no; then
13 HAVE_GETHOSTNAME=0
11 gl_PREREQ_GETHOSTNAME 14 gl_PREREQ_GETHOSTNAME
12 fi 15 fi
13]) 16])
14 17
15# Prerequisites of lib/gethostname.c. 18# Prerequisites of lib/gethostname.c.
16AC_DEFUN([gl_PREREQ_GETHOSTNAME], [ 19AC_DEFUN([gl_PREREQ_GETHOSTNAME], [
17 AC_CHECK_FUNCS(uname) 20 AC_CHECK_FUNCS([uname])
18]) 21])
diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4
index c1547c7..015bcac 100644
--- a/gl/m4/getloadavg.m4
+++ b/gl/m4/getloadavg.m4
@@ -1,7 +1,7 @@
1# Check for getloadavg. 1# Check for getloadavg.
2 2
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003,
4# 2006 Free Software Foundation, Inc. 4# 2006, 2008, 2009 Free Software Foundation, Inc.
5 5
6# This file is free software; the Free Software Foundation 6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,12 @@
13# gl_GETLOADAVG(LIBOBJDIR) 13# gl_GETLOADAVG(LIBOBJDIR)
14# ------------------------ 14# ------------------------
15AC_DEFUN([gl_GETLOADAVG], 15AC_DEFUN([gl_GETLOADAVG],
16[gl_have_func=no # yes means we've found a way to get the load average. 16[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
17
18# Persuade glibc <stdlib.h> to declare getloadavg().
19AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
20
21gl_have_func=no # yes means we've found a way to get the load average.
17 22
18# Make sure getloadavg.c is where it belongs, at configure-time. 23# Make sure getloadavg.c is where it belongs, at configure-time.
19test -f "$srcdir/$1/getloadavg.c" || 24test -f "$srcdir/$1/getloadavg.c" ||
@@ -22,17 +27,17 @@ test -f "$srcdir/$1/getloadavg.c" ||
22gl_save_LIBS=$LIBS 27gl_save_LIBS=$LIBS
23 28
24# Check for getloadavg, but be sure not to touch the cache variable. 29# Check for getloadavg, but be sure not to touch the cache variable.
25(AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && gl_have_func=yes 30(AC_CHECK_FUNC([getloadavg], [exit 0], [exit 1])) && gl_have_func=yes
26 31
27# On HPUX9, an unprivileged user can get load averages through this function. 32# On HPUX9, an unprivileged user can get load averages through this function.
28AC_CHECK_FUNCS(pstat_getdynamic) 33AC_CHECK_FUNCS([pstat_getdynamic])
29 34
30# Solaris has libkstat which does not require root. 35# Solaris has libkstat which does not require root.
31AC_CHECK_LIB(kstat, kstat_open) 36AC_CHECK_LIB([kstat], [kstat_open])
32test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes 37test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes
33 38
34# AIX has libperfstat which does not require root 39# AIX has libperfstat which does not require root
35AC_CHECK_LIB(perfstat, perfstat_cpu_total) 40AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
36test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes 41test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes
37 42
38# Some systems with -lutil have (and need) -lkvm as well, some do not. 43# Some systems with -lutil have (and need) -lkvm as well, some do not.
@@ -40,12 +45,12 @@ test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes
40# to get the right answer into the cache. 45# to get the right answer into the cache.
41# For kstat on solaris, we need libelf to force the definition of SVR4 below. 46# For kstat on solaris, we need libelf to force the definition of SVR4 below.
42if test $gl_have_func = no; then 47if test $gl_have_func = no; then
43 AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") 48 AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
44fi 49fi
45if test $gl_have_func = no; then 50if test $gl_have_func = no; then
46 AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") 51 AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
47 # Check for the 4.4BSD definition of getloadavg. 52 # Check for the 4.4BSD definition of getloadavg.
48 AC_CHECK_LIB(util, getloadavg, 53 AC_CHECK_LIB([util], [getloadavg],
49 [LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes]) 54 [LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes])
50fi 55fi
51 56
@@ -54,17 +59,17 @@ if test $gl_have_func = no; then
54 # Since it is not a standard part of AIX, it might be installed locally. 59 # Since it is not a standard part of AIX, it might be installed locally.
55 gl_getloadavg_LIBS=$LIBS 60 gl_getloadavg_LIBS=$LIBS
56 LIBS="-L/usr/local/lib $LIBS" 61 LIBS="-L/usr/local/lib $LIBS"
57 AC_CHECK_LIB(getloadavg, getloadavg, 62 AC_CHECK_LIB([getloadavg], [getloadavg],
58 [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS]) 63 [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
59fi 64fi
60 65
61# Make sure it is really in the library, if we think we found it, 66# Make sure it is really in the library, if we think we found it,
62# otherwise set up the replacement function. 67# otherwise set up the replacement function.
63AC_CHECK_FUNCS(getloadavg, [], 68AC_CHECK_FUNCS([getloadavg], [],
64 [gl_PREREQ_GETLOADAVG]) 69 [gl_PREREQ_GETLOADAVG])
65 70
66# Some definitions of getloadavg require that the program be installed setgid. 71# Some definitions of getloadavg require that the program be installed setgid.
67AC_CACHE_CHECK(whether getloadavg requires setgid, 72AC_CACHE_CHECK([whether getloadavg requires setgid],
68 gl_cv_func_getloadavg_setgid, 73 gl_cv_func_getloadavg_setgid,
69[AC_EGREP_CPP([Yowza Am I SETGID yet], 74[AC_EGREP_CPP([Yowza Am I SETGID yet],
70[#define CONFIGURING_GETLOADAVG 75[#define CONFIGURING_GETLOADAVG
@@ -77,16 +82,16 @@ Yowza Am I SETGID yet
77 gl_cv_func_getloadavg_setgid=no)]) 82 gl_cv_func_getloadavg_setgid=no)])
78if test $gl_cv_func_getloadavg_setgid = yes; then 83if test $gl_cv_func_getloadavg_setgid = yes; then
79 NEED_SETGID=true 84 NEED_SETGID=true
80 AC_DEFINE(GETLOADAVG_PRIVILEGED, 1, 85 AC_DEFINE([GETLOADAVG_PRIVILEGED], [1],
81 [Define to 1 if the `getloadavg' function needs to be run setuid 86 [Define to 1 if the `getloadavg' function needs to be run setuid
82 or setgid.]) 87 or setgid.])
83else 88else
84 NEED_SETGID=false 89 NEED_SETGID=false
85fi 90fi
86AC_SUBST(NEED_SETGID)dnl 91AC_SUBST([NEED_SETGID])dnl
87 92
88if test $gl_cv_func_getloadavg_setgid = yes; then 93if test $gl_cv_func_getloadavg_setgid = yes; then
89 AC_CACHE_CHECK(group of /dev/kmem, gl_cv_group_kmem, 94 AC_CACHE_CHECK([group of /dev/kmem], [gl_cv_group_kmem],
90[ # On Solaris, /dev/kmem is a symlink. Get info on the real file. 95[ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
91 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` 96 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
92 # If we got an error (system does not support symlinks), try without -L. 97 # If we got an error (system does not support symlinks), try without -L.
@@ -96,7 +101,7 @@ if test $gl_cv_func_getloadavg_setgid = yes; then
96 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/ 101 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/
97 / /s/.* //;p']` 102 / /s/.* //;p']`
98]) 103])
99 AC_SUBST(KMEM_GROUP, $gl_cv_group_kmem)dnl 104 AC_SUBST([KMEM_GROUP], [$gl_cv_group_kmem])dnl
100fi 105fi
101if test "x$gl_save_LIBS" = x; then 106if test "x$gl_save_LIBS" = x; then
102 GETLOADAVG_LIBS=$LIBS 107 GETLOADAVG_LIBS=$LIBS
@@ -105,7 +110,21 @@ else
105fi 110fi
106LIBS=$gl_save_LIBS 111LIBS=$gl_save_LIBS
107 112
108AC_SUBST(GETLOADAVG_LIBS)dnl 113AC_SUBST([GETLOADAVG_LIBS])dnl
114
115# Test whether the system declares getloadavg. Solaris has the function
116# but declares it in <sys/loadavg.h>, not <stdlib.h>.
117AC_CHECK_HEADERS([sys/loadavg.h])
118if test $ac_cv_header_sys_loadavg_h = yes; then
119 HAVE_SYS_LOADAVG_H=1
120else
121 HAVE_SYS_LOADAVG_H=0
122fi
123AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
124 [#if HAVE_SYS_LOADAVG_H
125 # include <sys/loadavg.h>
126 #endif
127 #include <stdlib.h>])
109])# gl_GETLOADAVG 128])# gl_GETLOADAVG
110 129
111 130
@@ -113,44 +132,44 @@ AC_SUBST(GETLOADAVG_LIBS)dnl
113# -------------------- 132# --------------------
114# Set up the AC_LIBOBJ replacement of `getloadavg'. 133# Set up the AC_LIBOBJ replacement of `getloadavg'.
115AC_DEFUN([gl_PREREQ_GETLOADAVG], 134AC_DEFUN([gl_PREREQ_GETLOADAVG],
116[AC_LIBOBJ(getloadavg) 135[AC_LIBOBJ([getloadavg])
117AC_DEFINE(C_GETLOADAVG, 1, [Define to 1 if using `getloadavg.c'.]) 136AC_DEFINE([C_GETLOADAVG], [1], [Define to 1 if using `getloadavg.c'.])
118# Figure out what our getloadavg.c needs. 137# Figure out what our getloadavg.c needs.
119gl_have_func=no 138gl_have_func=no
120AC_CHECK_HEADER(sys/dg_sys_info.h, 139AC_CHECK_HEADER([sys/dg_sys_info.h],
121[gl_have_func=yes 140[gl_have_func=yes
122 AC_DEFINE(DGUX, 1, [Define to 1 for DGUX with <sys/dg_sys_info.h>.]) 141 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
123 AC_CHECK_LIB(dgc, dg_sys_info)]) 142 AC_CHECK_LIB([dgc], [dg_sys_info])])
124 143
125# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it 144# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
126# uses stabs), but it is still SVR4. We cannot check for <elf.h> because 145# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
127# Irix 4.0.5F has the header but not the library. 146# Irix 4.0.5F has the header but not the library.
128if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then 147if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
129 gl_have_func=yes 148 gl_have_func=yes
130 AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.]) 149 AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
131fi 150fi
132 151
133if test $gl_have_func = no; then 152if test $gl_have_func = no; then
134 AC_CHECK_HEADER(inq_stats/cpustats.h, 153 AC_CHECK_HEADER([inq_stats/cpustats.h],
135 [gl_have_func=yes 154 [gl_have_func=yes
136 AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.]) 155 AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
137 AC_DEFINE(UMAX4_3, 1, 156 AC_DEFINE([UMAX4_3], [1],
138 [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> 157 [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
139 instead of <sys/cpustats.h>.])]) 158 instead of <sys/cpustats.h>.])])
140fi 159fi
141 160
142if test $gl_have_func = no; then 161if test $gl_have_func = no; then
143 AC_CHECK_HEADER(sys/cpustats.h, 162 AC_CHECK_HEADER([sys/cpustats.h],
144 [gl_have_func=yes; AC_DEFINE(UMAX)]) 163 [gl_have_func=yes; AC_DEFINE([UMAX])])
145fi 164fi
146 165
147if test $gl_have_func = no; then 166if test $gl_have_func = no; then
148 AC_CHECK_HEADERS(mach/mach.h) 167 AC_CHECK_HEADERS([mach/mach.h])
149fi 168fi
150 169
151AC_CHECK_HEADERS(nlist.h, 170AC_CHECK_HEADERS([nlist.h],
152[AC_CHECK_MEMBERS([struct nlist.n_un.n_name], 171[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
153 [AC_DEFINE(NLIST_NAME_UNION, 1, 172 [AC_DEFINE([NLIST_NAME_UNION], [1],
154 [Define to 1 if your `struct nlist' has an 173 [Define to 1 if your `struct nlist' has an
155 `n_un' member. Obsolete, depend on 174 `n_un' member. Obsolete, depend on
156 `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [], 175 `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index c0a73b2..9b683c2 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,5 +1,5 @@
1# getopt.m4 serial 13 1# getopt.m4 serial 14
2dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2006, 2008 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.
@@ -46,7 +46,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
46 if test -z "$GETOPT_H"; then 46 if test -z "$GETOPT_H"; then
47 AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], 47 AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
48 [AC_RUN_IFELSE( 48 [AC_RUN_IFELSE(
49 [AC_LANG_PROGRAM([#include <getopt.h>], 49 [AC_LANG_PROGRAM([[#include <getopt.h>]],
50 [[ 50 [[
51 char *myargv[3]; 51 char *myargv[3];
52 myargv[0] = "conftest"; 52 myargv[0] = "conftest";
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
index c9ae1f7..d90c850 100644
--- a/gl/m4/gettext.m4
+++ b/gl/m4/gettext.m4
@@ -1,5 +1,5 @@
1# gettext.m4 serial 60 (gettext-0.17) 1# gettext.m4 serial 62 (gettext-0.18)
2dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-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.
@@ -123,11 +123,11 @@ AC_DEFUN([AM_GNU_GETTEXT],
123 gt_use_preinstalled_gnugettext=no 123 gt_use_preinstalled_gnugettext=no
124 ifelse(gt_included_intl, yes, [ 124 ifelse(gt_included_intl, yes, [
125 AC_MSG_CHECKING([whether included gettext is requested]) 125 AC_MSG_CHECKING([whether included gettext is requested])
126 AC_ARG_WITH(included-gettext, 126 AC_ARG_WITH([included-gettext],
127 [ --with-included-gettext use the GNU gettext library included here], 127 [ --with-included-gettext use the GNU gettext library included here],
128 nls_cv_force_use_gnu_gettext=$withval, 128 nls_cv_force_use_gnu_gettext=$withval,
129 nls_cv_force_use_gnu_gettext=no) 129 nls_cv_force_use_gnu_gettext=no)
130 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) 130 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
131 131
132 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" 132 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
133 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then 133 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
@@ -267,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
267 267
268 if test "$gt_use_preinstalled_gnugettext" = "yes" \ 268 if test "$gt_use_preinstalled_gnugettext" = "yes" \
269 || test "$nls_cv_use_gnu_gettext" = "yes"; then 269 || test "$nls_cv_use_gnu_gettext" = "yes"; then
270 AC_DEFINE(ENABLE_NLS, 1, 270 AC_DEFINE([ENABLE_NLS], [1],
271 [Define to 1 if translation of program messages to the user's native language 271 [Define to 1 if translation of program messages to the user's native language
272 is requested.]) 272 is requested.])
273 else 273 else
@@ -301,9 +301,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
301 fi 301 fi
302 302
303 dnl For backward compatibility. Some packages may be using this. 303 dnl For backward compatibility. Some packages may be using this.
304 AC_DEFINE(HAVE_GETTEXT, 1, 304 AC_DEFINE([HAVE_GETTEXT], [1],
305 [Define if the GNU gettext() function is already present or preinstalled.]) 305 [Define if the GNU gettext() function is already present or preinstalled.])
306 AC_DEFINE(HAVE_DCGETTEXT, 1, 306 AC_DEFINE([HAVE_DCGETTEXT], [1],
307 [Define if the GNU dcgettext() function is already present or preinstalled.]) 307 [Define if the GNU dcgettext() function is already present or preinstalled.])
308 fi 308 fi
309 309
@@ -319,9 +319,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
319 fi 319 fi
320 320
321 dnl Make all variables we use known to autoconf. 321 dnl Make all variables we use known to autoconf.
322 AC_SUBST(BUILD_INCLUDED_LIBINTL) 322 AC_SUBST([BUILD_INCLUDED_LIBINTL])
323 AC_SUBST(USE_INCLUDED_LIBINTL) 323 AC_SUBST([USE_INCLUDED_LIBINTL])
324 AC_SUBST(CATOBJEXT) 324 AC_SUBST([CATOBJEXT])
325 325
326 dnl For backward compatibility. Some configure.ins may be using this. 326 dnl For backward compatibility. Some configure.ins may be using this.
327 nls_cv_header_intl= 327 nls_cv_header_intl=
@@ -329,36 +329,36 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
329 329
330 dnl For backward compatibility. Some Makefiles may be using this. 330 dnl For backward compatibility. Some Makefiles may be using this.
331 DATADIRNAME=share 331 DATADIRNAME=share
332 AC_SUBST(DATADIRNAME) 332 AC_SUBST([DATADIRNAME])
333 333
334 dnl For backward compatibility. Some Makefiles may be using this. 334 dnl For backward compatibility. Some Makefiles may be using this.
335 INSTOBJEXT=.mo 335 INSTOBJEXT=.mo
336 AC_SUBST(INSTOBJEXT) 336 AC_SUBST([INSTOBJEXT])
337 337
338 dnl For backward compatibility. Some Makefiles may be using this. 338 dnl For backward compatibility. Some Makefiles may be using this.
339 GENCAT=gencat 339 GENCAT=gencat
340 AC_SUBST(GENCAT) 340 AC_SUBST([GENCAT])
341 341
342 dnl For backward compatibility. Some Makefiles may be using this. 342 dnl For backward compatibility. Some Makefiles may be using this.
343 INTLOBJS= 343 INTLOBJS=
344 if test "$USE_INCLUDED_LIBINTL" = yes; then 344 if test "$USE_INCLUDED_LIBINTL" = yes; then
345 INTLOBJS="\$(GETTOBJS)" 345 INTLOBJS="\$(GETTOBJS)"
346 fi 346 fi
347 AC_SUBST(INTLOBJS) 347 AC_SUBST([INTLOBJS])
348 348
349 dnl Enable libtool support if the surrounding package wishes it. 349 dnl Enable libtool support if the surrounding package wishes it.
350 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix 350 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
351 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) 351 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
352 ]) 352 ])
353 353
354 dnl For backward compatibility. Some Makefiles may be using this. 354 dnl For backward compatibility. Some Makefiles may be using this.
355 INTLLIBS="$LIBINTL" 355 INTLLIBS="$LIBINTL"
356 AC_SUBST(INTLLIBS) 356 AC_SUBST([INTLLIBS])
357 357
358 dnl Make all documented variables known to autoconf. 358 dnl Make all documented variables known to autoconf.
359 AC_SUBST(LIBINTL) 359 AC_SUBST([LIBINTL])
360 AC_SUBST(LTLIBINTL) 360 AC_SUBST([LTLIBINTL])
361 AC_SUBST(POSUB) 361 AC_SUBST([POSUB])
362]) 362])
363 363
364 364
diff --git a/gl/m4/glibc2.m4 b/gl/m4/glibc2.m4
index e8f5bfe..fe58a0f 100644
--- a/gl/m4/glibc2.m4
+++ b/gl/m4/glibc2.m4
@@ -1,5 +1,5 @@
1# glibc2.m4 serial 1 1# glibc2.m4 serial 2
2dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 2004, 2008 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,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved.
9 9
10AC_DEFUN([gt_GLIBC2], 10AC_DEFUN([gt_GLIBC2],
11 [ 11 [
12 AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, 12 AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
13 ac_cv_gnu_library_2, 13 [ac_cv_gnu_library_2],
14 [AC_EGREP_CPP([Lucky GNU user], 14 [AC_EGREP_CPP([Lucky GNU user],
15 [ 15 [
16#include <features.h> 16#include <features.h>
@@ -20,11 +20,11 @@ AC_DEFUN([gt_GLIBC2],
20 #endif 20 #endif
21#endif 21#endif
22 ], 22 ],
23 ac_cv_gnu_library_2=yes, 23 [ac_cv_gnu_library_2=yes],
24 ac_cv_gnu_library_2=no) 24 [ac_cv_gnu_library_2=no])
25 ] 25 ]
26 ) 26 )
27 AC_SUBST(GLIBC2) 27 AC_SUBST([GLIBC2])
28 GLIBC2="$ac_cv_gnu_library_2" 28 GLIBC2="$ac_cv_gnu_library_2"
29 ] 29 ]
30) 30)
diff --git a/gl/m4/glibc21.m4 b/gl/m4/glibc21.m4
index d95fd98..93fbf47 100644
--- a/gl/m4/glibc21.m4
+++ b/gl/m4/glibc21.m4
@@ -1,5 +1,5 @@
1# glibc21.m4 serial 3 1# glibc21.m4 serial 4
2dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 2004, 2008 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,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved.
9 9
10AC_DEFUN([gl_GLIBC21], 10AC_DEFUN([gl_GLIBC21],
11 [ 11 [
12 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 12 AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
13 ac_cv_gnu_library_2_1, 13 [ac_cv_gnu_library_2_1],
14 [AC_EGREP_CPP([Lucky GNU user], 14 [AC_EGREP_CPP([Lucky GNU user],
15 [ 15 [
16#include <features.h> 16#include <features.h>
@@ -20,11 +20,11 @@ AC_DEFUN([gl_GLIBC21],
20 #endif 20 #endif
21#endif 21#endif
22 ], 22 ],
23 ac_cv_gnu_library_2_1=yes, 23 [ac_cv_gnu_library_2_1=yes],
24 ac_cv_gnu_library_2_1=no) 24 [ac_cv_gnu_library_2_1=no])
25 ] 25 ]
26 ) 26 )
27 AC_SUBST(GLIBC21) 27 AC_SUBST([GLIBC21])
28 GLIBC21="$ac_cv_gnu_library_2_1" 28 GLIBC21="$ac_cv_gnu_library_2_1"
29 ] 29 ]
30) 30)
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 302dc19..eb47134 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
1# Copyright (C) 2004-2007 Free Software Foundation, Inc. 1# Copyright (C) 2002-2009 Free Software Foundation, Inc.
2# 2#
3# This file is free software, distributed under the terms of the GNU 3# This file is free software, distributed under the terms of the GNU
4# General Public License. As a special exception to the GNU General 4# General Public License. As a special exception to the GNU General
@@ -15,11 +15,25 @@
15 15
16 16
17# Specification in the form of a command-line invocation: 17# Specification in the form of a command-line invocation:
18# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf 18# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf
19 19
20# Specification in the form of a few gnulib-tool.m4 macro invocations: 20# Specification in the form of a few gnulib-tool.m4 macro invocations:
21gl_LOCAL_DIR([]) 21gl_LOCAL_DIR([])
22gl_MODULES([base64 dirname floorf fsusage getaddrinfo gethostname getloadavg getopt gettext mountlist regex vasprintf vsnprintf]) 22gl_MODULES([
23 base64
24 dirname
25 floorf
26 fsusage
27 getaddrinfo
28 gethostname
29 getloadavg
30 getopt
31 gettext
32 mountlist
33 regex
34 vasprintf
35 vsnprintf
36])
23gl_AVOID([]) 37gl_AVOID([])
24gl_SOURCE_BASE([gl]) 38gl_SOURCE_BASE([gl])
25gl_M4_BASE([gl/m4]) 39gl_M4_BASE([gl/m4])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 9336d72..5804eb9 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,9 +1,38 @@
1# gnulib-common.m4 serial 3 1# gnulib-common.m4 serial 7
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.
6 6
7# gl_COMMON
8# is expanded unconditionally through gnulib-tool magic.
9AC_DEFUN([gl_COMMON], [
10 dnl Use AC_REQUIRE here, so that the code is expanded once only.
11 AC_REQUIRE([gl_COMMON_BODY])
12])
13AC_DEFUN([gl_COMMON_BODY], [
14 AH_VERBATIM([isoc99_inline],
15[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
16 the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
17 earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
18 __APPLE__ && __MACH__ test for MacOS X.
19 __APPLE_CC__ tests for the Apple compiler and its version.
20 __STDC_VERSION__ tests for the C99 mode. */
21#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
22# define __GNUC_STDC_INLINE__ 1
23#endif])
24 AH_VERBATIM([unused_parameter],
25[/* Define as a marker that can be attached to function parameter declarations
26 for parameters that are not used. This helps to reduce warnings, such as
27 from GCC -Wunused-parameter. */
28#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
29# define _UNUSED_PARAMETER_ __attribute__ ((__unused__))
30#else
31# define _UNUSED_PARAMETER_
32#endif
33])
34])
35
7# gl_MODULE_INDICATOR([modulename]) 36# gl_MODULE_INDICATOR([modulename])
8# defines a C macro indicating the presence of the given module. 37# defines a C macro indicating the presence of the given module.
9AC_DEFUN([gl_MODULE_INDICATOR], 38AC_DEFUN([gl_MODULE_INDICATOR],
@@ -12,6 +41,13 @@ AC_DEFUN([gl_MODULE_INDICATOR],
12 [Define to 1 when using the gnulib module ]$1[.]) 41 [Define to 1 when using the gnulib module ]$1[.])
13]) 42])
14 43
44# m4_foreach_w
45# is a backport of autoconf-2.59c's m4_foreach_w.
46# Remove this macro when we can assume autoconf >= 2.60.
47m4_ifndef([m4_foreach_w],
48 [m4_define([m4_foreach_w],
49 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
50
15# AC_PROG_MKDIR_P 51# AC_PROG_MKDIR_P
16# is a backport of autoconf-2.60's AC_PROG_MKDIR_P. 52# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
17# Remove this macro when we can assume autoconf >= 2.60. 53# Remove this macro when we can assume autoconf >= 2.60.
@@ -27,7 +63,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [
27# works. 63# works.
28# This definition can be removed once autoconf >= 2.62 can be assumed. 64# This definition can be removed once autoconf >= 2.62 can be assumed.
29AC_DEFUN([AC_C_RESTRICT], 65AC_DEFUN([AC_C_RESTRICT],
30[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, 66[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
31 [ac_cv_c_restrict=no 67 [ac_cv_c_restrict=no
32 # The order here caters to the fact that C++ does not require restrict. 68 # The order here caters to the fact that C++ does not require restrict.
33 for ac_kw in __restrict __restrict__ _Restrict restrict; do 69 for ac_kw in __restrict __restrict__ _Restrict restrict; do
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 85ad2e9..99fa45d 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
1# DO NOT EDIT! GENERATED AUTOMATICALLY! 1# DO NOT EDIT! GENERATED AUTOMATICALLY!
2# Copyright (C) 2004-2007 Free Software Foundation, Inc. 2# Copyright (C) 2002-2009 Free Software Foundation, Inc.
3# 3#
4# This file is free software, distributed under the terms of the GNU 4# This file is free software, distributed under the terms of the GNU
5# General Public License. As a special exception to the GNU General 5# General Public License. As a special exception to the GNU General
@@ -40,20 +40,27 @@ AC_DEFUN([gl_INIT],
40 m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) 40 m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
41 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) 41 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
42 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) 42 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
43 m4_pushdef([gl_LIBSOURCES_LIST], [])
44 m4_pushdef([gl_LIBSOURCES_DIR], [])
45 gl_COMMON
43 gl_source_base='gl' 46 gl_source_base='gl'
44 gl_FUNC_ALLOCA 47 gl_FUNC_ALLOCA
45 gl_HEADER_ARPA_INET 48 gl_HEADER_ARPA_INET
46 AC_PROG_MKDIR_P 49 AC_PROG_MKDIR_P
47 gl_FUNC_BASE64 50 gl_FUNC_BASE64
51 gl_FUNC_BTOWC
52 gl_WCHAR_MODULE_INDICATOR([btowc])
48 gl_C_STRTOD 53 gl_C_STRTOD
49 gl_CLOEXEC 54 gl_CLOEXEC
50 gl_DIRNAME 55 gl_DIRNAME
51 gl_DOUBLE_SLASH_ROOT 56 gl_DOUBLE_SLASH_ROOT
57 gl_HEADER_ERRNO_H
52 gl_ERROR 58 gl_ERROR
53 m4_ifdef([AM_XGETTEXT_OPTION], 59 m4_ifdef([AM_XGETTEXT_OPTION],
54 [AM_XGETTEXT_OPTION([--flag=error:3:c-format]) 60 [AM_XGETTEXT_OPTION([--flag=error:3:c-format])
55 AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) 61 AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
56 gl_EXITFAIL 62 gl_EXITFAIL
63 gl_FCNTL_H
57 gl_FCNTL_SAFER 64 gl_FCNTL_SAFER
58 gl_MODULE_INDICATOR([fcntl-safer]) 65 gl_MODULE_INDICATOR([fcntl-safer])
59 gl_FLOAT_H 66 gl_FLOAT_H
@@ -61,14 +68,19 @@ AC_DEFUN([gl_INIT],
61 gl_MATH_MODULE_INDICATOR([floorf]) 68 gl_MATH_MODULE_INDICATOR([floorf])
62 gl_FSUSAGE 69 gl_FSUSAGE
63 gl_GETADDRINFO 70 gl_GETADDRINFO
71 gl_NETDB_MODULE_INDICATOR([getaddrinfo])
64 gl_FUNC_GETHOSTNAME 72 gl_FUNC_GETHOSTNAME
73 gl_UNISTD_MODULE_INDICATOR([gethostname])
65 gl_GETLOADAVG([$gl_source_base]) 74 gl_GETLOADAVG([$gl_source_base])
75 gl_STDLIB_MODULE_INDICATOR([getloadavg])
66 gl_GETOPT 76 gl_GETOPT
67 dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. 77 dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
68 AM_GNU_GETTEXT_VERSION([0.17]) 78 AM_GNU_GETTEXT_VERSION([0.17])
69 AC_SUBST([LIBINTL]) 79 AC_SUBST([LIBINTL])
70 AC_SUBST([LTLIBINTL]) 80 AC_SUBST([LTLIBINTL])
81 gl_HOSTENT
71 gl_INET_NTOP 82 gl_INET_NTOP
83 gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
72 gl_INLINE 84 gl_INLINE
73 gl_LOCALCHARSET 85 gl_LOCALCHARSET
74 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" 86 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
@@ -78,12 +90,22 @@ AC_DEFUN([gl_INIT],
78 gl_FUNC_MALLOC_POSIX 90 gl_FUNC_MALLOC_POSIX
79 gl_STDLIB_MODULE_INDICATOR([malloc-posix]) 91 gl_STDLIB_MODULE_INDICATOR([malloc-posix])
80 gl_MATH_H 92 gl_MATH_H
93 gl_FUNC_MBRTOWC
94 gl_WCHAR_MODULE_INDICATOR([mbrtowc])
95 gl_FUNC_MBSINIT
96 gl_WCHAR_MODULE_INDICATOR([mbsinit])
81 gl_MOUNTLIST 97 gl_MOUNTLIST
98 gl_MULTIARCH
99 gl_HEADER_NETDB
82 gl_HEADER_NETINET_IN 100 gl_HEADER_NETINET_IN
83 AC_PROG_MKDIR_P 101 AC_PROG_MKDIR_P
102 gl_FUNC_OPEN
103 gl_MODULE_INDICATOR([open])
104 gl_FCNTL_MODULE_INDICATOR([open])
84 gl_REGEX 105 gl_REGEX
85 gl_SAFE_READ 106 gl_SAFE_READ
86 gl_SAFE_WRITE 107 gl_SAFE_WRITE
108 gl_SERVENT
87 gl_SIZE_MAX 109 gl_SIZE_MAX
88 gl_FUNC_SNPRINTF 110 gl_FUNC_SNPRINTF
89 gl_STDIO_MODULE_INDICATOR([snprintf]) 111 gl_STDIO_MODULE_INDICATOR([snprintf])
@@ -93,8 +115,6 @@ AC_DEFUN([gl_INIT],
93 gl_STDINT_H 115 gl_STDINT_H
94 gl_STDIO_H 116 gl_STDIO_H
95 gl_STDLIB_H 117 gl_STDLIB_H
96 gl_FUNC_STRDUP
97 gl_STRING_MODULE_INDICATOR([strdup])
98 gl_FUNC_STRERROR 118 gl_FUNC_STRERROR
99 gl_STRING_MODULE_INDICATOR([strerror]) 119 gl_STRING_MODULE_INDICATOR([strerror])
100 gl_HEADER_STRING_H 120 gl_HEADER_STRING_H
@@ -103,6 +123,7 @@ AC_DEFUN([gl_INIT],
103 gl_FUNC_STRNLEN 123 gl_FUNC_STRNLEN
104 gl_STRING_MODULE_INDICATOR([strnlen]) 124 gl_STRING_MODULE_INDICATOR([strnlen])
105 gl_HEADER_SYS_SOCKET 125 gl_HEADER_SYS_SOCKET
126 gl_MODULE_INDICATOR([sys_socket])
106 AC_PROG_MKDIR_P 127 AC_PROG_MKDIR_P
107 gl_UNISTD_H 128 gl_UNISTD_H
108 gl_UNISTD_SAFER 129 gl_UNISTD_SAFER
@@ -115,10 +136,27 @@ AC_DEFUN([gl_INIT],
115 gl_FUNC_VSNPRINTF 136 gl_FUNC_VSNPRINTF
116 gl_STDIO_MODULE_INDICATOR([vsnprintf]) 137 gl_STDIO_MODULE_INDICATOR([vsnprintf])
117 gl_WCHAR_H 138 gl_WCHAR_H
139 gl_FUNC_WCRTOMB
140 gl_WCHAR_MODULE_INDICATOR([wcrtomb])
118 gl_WCTYPE_H 141 gl_WCTYPE_H
142 gl_FUNC_WRITE
143 gl_UNISTD_MODULE_INDICATOR([write])
119 gl_XALLOC 144 gl_XALLOC
120 gl_XSIZE 145 gl_XSIZE
121 gl_XSTRNDUP 146 gl_XSTRNDUP
147 m4_ifval(gl_LIBSOURCES_LIST, [
148 m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
149 for gl_file in ]gl_LIBSOURCES_LIST[ ; do
150 if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
151 echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
152 exit 1
153 fi
154 done])dnl
155 m4_if(m4_sysval, [0], [],
156 [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
157 ])
158 m4_popdef([gl_LIBSOURCES_DIR])
159 m4_popdef([gl_LIBSOURCES_LIST])
122 m4_popdef([AC_LIBSOURCES]) 160 m4_popdef([AC_LIBSOURCES])
123 m4_popdef([AC_REPLACE_FUNCS]) 161 m4_popdef([AC_REPLACE_FUNCS])
124 m4_popdef([AC_LIBOBJ]) 162 m4_popdef([AC_LIBOBJ])
@@ -141,7 +179,23 @@ AC_DEFUN([gl_INIT],
141 m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) 179 m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
142 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) 180 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
143 m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) 181 m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
182 m4_pushdef([gltests_LIBSOURCES_LIST], [])
183 m4_pushdef([gltests_LIBSOURCES_DIR], [])
184 gl_COMMON
144 gl_source_base='tests' 185 gl_source_base='tests'
186 m4_ifval(gltests_LIBSOURCES_LIST, [
187 m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
188 for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
189 if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
190 echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
191 exit 1
192 fi
193 done])dnl
194 m4_if(m4_sysval, [0], [],
195 [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
196 ])
197 m4_popdef([gltests_LIBSOURCES_DIR])
198 m4_popdef([gltests_LIBSOURCES_LIST])
145 m4_popdef([AC_LIBSOURCES]) 199 m4_popdef([AC_LIBSOURCES])
146 m4_popdef([AC_REPLACE_FUNCS]) 200 m4_popdef([AC_REPLACE_FUNCS])
147 m4_popdef([AC_LIBOBJ]) 201 m4_popdef([AC_LIBOBJ])
@@ -172,13 +226,6 @@ AC_DEFUN([gl_LIBOBJ], [
172 gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" 226 gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
173]) 227])
174 228
175# m4_foreach_w is provided by autoconf-2.59c and later.
176# This definition is to accommodate developers using versions
177# of autoconf older than that.
178m4_ifndef([m4_foreach_w],
179 [m4_define([m4_foreach_w],
180 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
181
182# Like AC_REPLACE_FUNCS, except that the module name goes 229# Like AC_REPLACE_FUNCS, except that the module name goes
183# into gl_LIBOBJS instead of into LIBOBJS. 230# into gl_LIBOBJS instead of into LIBOBJS.
184AC_DEFUN([gl_REPLACE_FUNCS], [ 231AC_DEFUN([gl_REPLACE_FUNCS], [
@@ -187,15 +234,14 @@ AC_DEFUN([gl_REPLACE_FUNCS], [
187]) 234])
188 235
189# Like AC_LIBSOURCES, except the directory where the source file is 236# Like AC_LIBSOURCES, except the directory where the source file is
190# expected is derived from the gnulib-tool parametrization, 237# expected is derived from the gnulib-tool parameterization,
191# and alloca is special cased (for the alloca-opt module). 238# and alloca is special cased (for the alloca-opt module).
192# We could also entirely rely on EXTRA_lib..._SOURCES. 239# We could also entirely rely on EXTRA_lib..._SOURCES.
193AC_DEFUN([gl_LIBSOURCES], [ 240AC_DEFUN([gl_LIBSOURCES], [
194 m4_foreach([_gl_NAME], [$1], [ 241 m4_foreach([_gl_NAME], [$1], [
195 m4_if(_gl_NAME, [alloca.c], [], [ 242 m4_if(_gl_NAME, [alloca.c], [], [
196 m4_syscmd([test -r gl/]_gl_NAME[ || test ! -d gl])dnl 243 m4_define([gl_LIBSOURCES_DIR], [gl])
197 m4_if(m4_sysval, [0], [], 244 m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
198 [AC_FATAL([missing gl/]_gl_NAME)])
199 ]) 245 ])
200 ]) 246 ])
201]) 247])
@@ -207,13 +253,6 @@ AC_DEFUN([gltests_LIBOBJ], [
207 gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" 253 gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
208]) 254])
209 255
210# m4_foreach_w is provided by autoconf-2.59c and later.
211# This definition is to accommodate developers using versions
212# of autoconf older than that.
213m4_ifndef([m4_foreach_w],
214 [m4_define([m4_foreach_w],
215 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
216
217# Like AC_REPLACE_FUNCS, except that the module name goes 256# Like AC_REPLACE_FUNCS, except that the module name goes
218# into gltests_LIBOBJS instead of into LIBOBJS. 257# into gltests_LIBOBJS instead of into LIBOBJS.
219AC_DEFUN([gltests_REPLACE_FUNCS], [ 258AC_DEFUN([gltests_REPLACE_FUNCS], [
@@ -222,15 +261,14 @@ AC_DEFUN([gltests_REPLACE_FUNCS], [
222]) 261])
223 262
224# Like AC_LIBSOURCES, except the directory where the source file is 263# Like AC_LIBSOURCES, except the directory where the source file is
225# expected is derived from the gnulib-tool parametrization, 264# expected is derived from the gnulib-tool parameterization,
226# and alloca is special cased (for the alloca-opt module). 265# and alloca is special cased (for the alloca-opt module).
227# We could also entirely rely on EXTRA_lib..._SOURCES. 266# We could also entirely rely on EXTRA_lib..._SOURCES.
228AC_DEFUN([gltests_LIBSOURCES], [ 267AC_DEFUN([gltests_LIBSOURCES], [
229 m4_foreach([_gl_NAME], [$1], [ 268 m4_foreach([_gl_NAME], [$1], [
230 m4_if(_gl_NAME, [alloca.c], [], [ 269 m4_if(_gl_NAME, [alloca.c], [], [
231 m4_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl 270 m4_define([gltests_LIBSOURCES_DIR], [tests])
232 m4_if(m4_sysval, [0], [], 271 m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
233 [AC_FATAL([missing tests/]_gl_NAME)])
234 ]) 272 ])
235 ]) 273 ])
236]) 274])
@@ -242,11 +280,13 @@ AC_DEFUN([gl_FILE_LIST], [
242 build-aux/link-warning.h 280 build-aux/link-warning.h
243 lib/alloca.c 281 lib/alloca.c
244 lib/alloca.in.h 282 lib/alloca.in.h
283 lib/arpa_inet.in.h
245 lib/asnprintf.c 284 lib/asnprintf.c
246 lib/asprintf.c 285 lib/asprintf.c
247 lib/base64.c 286 lib/base64.c
248 lib/base64.h 287 lib/base64.h
249 lib/basename.c 288 lib/basename.c
289 lib/btowc.c
250 lib/c-strtod.c 290 lib/c-strtod.c
251 lib/c-strtod.h 291 lib/c-strtod.h
252 lib/cloexec.c 292 lib/cloexec.c
@@ -256,12 +296,14 @@ AC_DEFUN([gl_FILE_LIST], [
256 lib/dirname.c 296 lib/dirname.c
257 lib/dirname.h 297 lib/dirname.h
258 lib/dup-safer.c 298 lib/dup-safer.c
299 lib/errno.in.h
259 lib/error.c 300 lib/error.c
260 lib/error.h 301 lib/error.h
261 lib/exitfail.c 302 lib/exitfail.c
262 lib/exitfail.h 303 lib/exitfail.h
263 lib/fcntl--.h 304 lib/fcntl--.h
264 lib/fcntl-safer.h 305 lib/fcntl-safer.h
306 lib/fcntl.in.h
265 lib/fd-safer.c 307 lib/fd-safer.c
266 lib/float+.h 308 lib/float+.h
267 lib/float.in.h 309 lib/float.in.h
@@ -275,7 +317,6 @@ AC_DEFUN([gl_FILE_LIST], [
275 lib/full-write.h 317 lib/full-write.h
276 lib/gai_strerror.c 318 lib/gai_strerror.c
277 lib/getaddrinfo.c 319 lib/getaddrinfo.c
278 lib/getaddrinfo.h
279 lib/gethostname.c 320 lib/gethostname.c
280 lib/getloadavg.c 321 lib/getloadavg.c
281 lib/getopt.c 322 lib/getopt.c
@@ -284,16 +325,19 @@ AC_DEFUN([gl_FILE_LIST], [
284 lib/getopt_int.h 325 lib/getopt_int.h
285 lib/gettext.h 326 lib/gettext.h
286 lib/inet_ntop.c 327 lib/inet_ntop.c
287 lib/inet_ntop.h
288 lib/intprops.h 328 lib/intprops.h
289 lib/localcharset.c 329 lib/localcharset.c
290 lib/localcharset.h 330 lib/localcharset.h
291 lib/malloc.c 331 lib/malloc.c
292 lib/math.in.h 332 lib/math.in.h
333 lib/mbrtowc.c
334 lib/mbsinit.c
293 lib/mountlist.c 335 lib/mountlist.c
294 lib/mountlist.h 336 lib/mountlist.h
337 lib/netdb.in.h
295 lib/netinet_in.in.h 338 lib/netinet_in.in.h
296 lib/open-safer.c 339 lib/open-safer.c
340 lib/open.c
297 lib/pipe-safer.c 341 lib/pipe-safer.c
298 lib/printf-args.c 342 lib/printf-args.c
299 lib/printf-args.h 343 lib/printf-args.h
@@ -315,9 +359,10 @@ AC_DEFUN([gl_FILE_LIST], [
315 lib/snprintf.c 359 lib/snprintf.c
316 lib/stdbool.in.h 360 lib/stdbool.in.h
317 lib/stdint.in.h 361 lib/stdint.in.h
362 lib/stdio-write.c
318 lib/stdio.in.h 363 lib/stdio.in.h
319 lib/stdlib.in.h 364 lib/stdlib.in.h
320 lib/strdup.c 365 lib/streq.h
321 lib/strerror.c 366 lib/strerror.c
322 lib/string.in.h 367 lib/string.in.h
323 lib/stripslash.c 368 lib/stripslash.c
@@ -330,30 +375,34 @@ AC_DEFUN([gl_FILE_LIST], [
330 lib/vasnprintf.c 375 lib/vasnprintf.c
331 lib/vasnprintf.h 376 lib/vasnprintf.h
332 lib/vasprintf.c 377 lib/vasprintf.c
378 lib/verify.h
333 lib/vsnprintf.c 379 lib/vsnprintf.c
334 lib/wchar.in.h 380 lib/wchar.in.h
381 lib/wcrtomb.c
335 lib/wctype.in.h 382 lib/wctype.in.h
383 lib/write.c
336 lib/xalloc-die.c 384 lib/xalloc-die.c
337 lib/xalloc.h 385 lib/xalloc.h
338 lib/xmalloc.c 386 lib/xmalloc.c
339 lib/xsize.h 387 lib/xsize.h
340 lib/xstrndup.c 388 lib/xstrndup.c
341 lib/xstrndup.h 389 lib/xstrndup.h
342 m4/absolute-header.m4
343 m4/alloca.m4 390 m4/alloca.m4
344 m4/arpa_inet_h.m4 391 m4/arpa_inet_h.m4
345 m4/base64.m4 392 m4/base64.m4
393 m4/btowc.m4
346 m4/c-strtod.m4 394 m4/c-strtod.m4
347 m4/cloexec.m4 395 m4/cloexec.m4
348 m4/codeset.m4 396 m4/codeset.m4
349 m4/dirname.m4 397 m4/dirname.m4
350 m4/dos.m4 398 m4/dos.m4
351 m4/double-slash-root.m4 399 m4/double-slash-root.m4
352 m4/eoverflow.m4 400 m4/errno_h.m4
353 m4/error.m4 401 m4/error.m4
354 m4/exitfail.m4 402 m4/exitfail.m4
355 m4/extensions.m4 403 m4/extensions.m4
356 m4/fcntl-safer.m4 404 m4/fcntl-safer.m4
405 m4/fcntl_h.m4
357 m4/float_h.m4 406 m4/float_h.m4
358 m4/floorf.m4 407 m4/floorf.m4
359 m4/fstypename.m4 408 m4/fstypename.m4
@@ -366,6 +415,7 @@ AC_DEFUN([gl_FILE_LIST], [
366 m4/glibc2.m4 415 m4/glibc2.m4
367 m4/glibc21.m4 416 m4/glibc21.m4
368 m4/gnulib-common.m4 417 m4/gnulib-common.m4
418 m4/hostent.m4
369 m4/iconv.m4 419 m4/iconv.m4
370 m4/include_next.m4 420 m4/include_next.m4
371 m4/inet_ntop.m4 421 m4/inet_ntop.m4
@@ -383,21 +433,32 @@ AC_DEFUN([gl_FILE_LIST], [
383 m4/lib-link.m4 433 m4/lib-link.m4
384 m4/lib-prefix.m4 434 m4/lib-prefix.m4
385 m4/localcharset.m4 435 m4/localcharset.m4
436 m4/locale-fr.m4
437 m4/locale-ja.m4
438 m4/locale-zh.m4
386 m4/lock.m4 439 m4/lock.m4
387 m4/longlong.m4 440 m4/longlong.m4
388 m4/ls-mntd-fs.m4 441 m4/ls-mntd-fs.m4
389 m4/malloc.m4 442 m4/malloc.m4
390 m4/math_h.m4 443 m4/math_h.m4
444 m4/mbrtowc.m4
445 m4/mbsinit.m4
446 m4/mbstate_t.m4
391 m4/mountlist.m4 447 m4/mountlist.m4
448 m4/multiarch.m4
449 m4/netdb_h.m4
392 m4/netinet_in_h.m4 450 m4/netinet_in_h.m4
393 m4/nls.m4 451 m4/nls.m4
394 m4/onceonly_2_57.m4 452 m4/onceonly.m4
453 m4/open.m4
395 m4/po.m4 454 m4/po.m4
396 m4/printf-posix.m4 455 m4/printf-posix.m4
456 m4/printf.m4
397 m4/progtest.m4 457 m4/progtest.m4
398 m4/regex.m4 458 m4/regex.m4
399 m4/safe-read.m4 459 m4/safe-read.m4
400 m4/safe-write.m4 460 m4/safe-write.m4
461 m4/servent.m4
401 m4/size_max.m4 462 m4/size_max.m4
402 m4/snprintf.m4 463 m4/snprintf.m4
403 m4/socklen.m4 464 m4/socklen.m4
@@ -408,12 +469,12 @@ AC_DEFUN([gl_FILE_LIST], [
408 m4/stdint_h.m4 469 m4/stdint_h.m4
409 m4/stdio_h.m4 470 m4/stdio_h.m4
410 m4/stdlib_h.m4 471 m4/stdlib_h.m4
411 m4/strdup.m4
412 m4/strerror.m4 472 m4/strerror.m4
413 m4/string_h.m4 473 m4/string_h.m4
414 m4/strndup.m4 474 m4/strndup.m4
415 m4/strnlen.m4 475 m4/strnlen.m4
416 m4/sys_socket_h.m4 476 m4/sys_socket_h.m4
477 m4/threadlib.m4
417 m4/uintmax_t.m4 478 m4/uintmax_t.m4
418 m4/unistd-safer.m4 479 m4/unistd-safer.m4
419 m4/unistd_h.m4 480 m4/unistd_h.m4
@@ -423,8 +484,10 @@ AC_DEFUN([gl_FILE_LIST], [
423 m4/vsnprintf.m4 484 m4/vsnprintf.m4
424 m4/wchar.m4 485 m4/wchar.m4
425 m4/wchar_t.m4 486 m4/wchar_t.m4
487 m4/wcrtomb.m4
426 m4/wctype.m4 488 m4/wctype.m4
427 m4/wint_t.m4 489 m4/wint_t.m4
490 m4/write.m4
428 m4/xalloc.m4 491 m4/xalloc.m4
429 m4/xsize.m4 492 m4/xsize.m4
430 m4/xstrndup.m4 493 m4/xstrndup.m4
diff --git a/gl/m4/gnulib-tool.m4 b/gl/m4/gnulib-tool.m4
index ef59320..4438d48 100644
--- a/gl/m4/gnulib-tool.m4
+++ b/gl/m4/gnulib-tool.m4
@@ -1,4 +1,4 @@
1# gnulib-tool.m4 serial 1 1# gnulib-tool.m4 serial 2
2dnl Copyright (C) 2004-2005 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-2005 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,9 @@ dnl The following macros need not be invoked explicitly.
8dnl Invoking them does nothing except to declare default arguments 8dnl Invoking them does nothing except to declare default arguments
9dnl for "gnulib-tool --import". 9dnl for "gnulib-tool --import".
10 10
11dnl Usage: gl_LOCAL_DIR([DIR])
12AC_DEFUN([gl_LOCAL_DIR], [])
13
11dnl Usage: gl_MODULES([module1 module2 ...]) 14dnl Usage: gl_MODULES([module1 module2 ...])
12AC_DEFUN([gl_MODULES], []) 15AC_DEFUN([gl_MODULES], [])
13 16
@@ -20,14 +23,35 @@ AC_DEFUN([gl_SOURCE_BASE], [])
20dnl Usage: gl_M4_BASE([DIR]) 23dnl Usage: gl_M4_BASE([DIR])
21AC_DEFUN([gl_M4_BASE], []) 24AC_DEFUN([gl_M4_BASE], [])
22 25
26dnl Usage: gl_PO_BASE([DIR])
27AC_DEFUN([gl_PO_BASE], [])
28
29dnl Usage: gl_DOC_BASE([DIR])
30AC_DEFUN([gl_DOC_BASE], [])
31
32dnl Usage: gl_TESTS_BASE([DIR])
33AC_DEFUN([gl_TESTS_BASE], [])
34
35dnl Usage: gl_WITH_TESTS
36AC_DEFUN([gl_WITH_TESTS], [])
37
23dnl Usage: gl_LIB([LIBNAME]) 38dnl Usage: gl_LIB([LIBNAME])
24AC_DEFUN([gl_LIB], []) 39AC_DEFUN([gl_LIB], [])
25 40
26dnl Usage: gl_LGPL 41dnl Usage: gl_LGPL or gl_LGPL([VERSION])
27AC_DEFUN([gl_LGPL], []) 42AC_DEFUN([gl_LGPL], [])
28 43
44dnl Usage: gl_MAKEFILE_NAME([FILENAME])
45AC_DEFUN([gl_MAKEFILE_NAME], [])
46
29dnl Usage: gl_LIBTOOL 47dnl Usage: gl_LIBTOOL
30AC_DEFUN([gl_LIBTOOL], []) 48AC_DEFUN([gl_LIBTOOL], [])
31 49
32dnl Usage: gl_MACRO_PREFIX([PREFIX]) 50dnl Usage: gl_MACRO_PREFIX([PREFIX])
33AC_DEFUN([gl_MACRO_PREFIX], []) 51AC_DEFUN([gl_MACRO_PREFIX], [])
52
53dnl Usage: gl_PO_DOMAIN([DOMAIN])
54AC_DEFUN([gl_PO_DOMAIN], [])
55
56dnl Usage: gl_VC_FILES([BOOLEAN])
57AC_DEFUN([gl_VC_FILES], [])
diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4
new file mode 100644
index 0000000..4a96af7
--- /dev/null
+++ b/gl/m4/hostent.m4
@@ -0,0 +1,45 @@
1# hostent.m4 serial 1
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_HOSTENT],
8[
9 dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
10 dnl gethostbyaddr() defined?
11 dnl - On Solaris, they are in libnsl. Ignore libxnet.
12 dnl - On Haiku, they are in libnetwork.
13 dnl - On BeOS, they are in libnet.
14 dnl - On native Windows, they are in ws2_32.dll.
15 dnl - Otherwise they are in libc.
16 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
17 HOSTENT_LIB=
18 gl_saved_libs="$LIBS"
19 AC_SEARCH_LIBS([gethostbyname], [nsl network net],
20 [if test "$ac_cv_search_gethostbyname" != "none required"; then
21 HOSTENT_LIB="$ac_cv_search_gethostbyname"
22 fi])
23 LIBS="$gl_saved_libs"
24 if test -z "$HOSTENT_LIB"; then
25 AC_CHECK_FUNCS([gethostbyname], , [
26 AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
27 [gl_cv_w32_gethostbyname],
28 [gl_cv_w32_gethostbyname=no
29 gl_save_LIBS="$LIBS"
30 LIBS="$LIBS -lws2_32"
31 AC_TRY_LINK([
32#ifdef HAVE_WINSOCK2_H
33#include <winsock2.h>
34#endif
35#include <stddef.h>
36], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
37 LIBS="$gl_save_LIBS"
38 ])
39 if test "$gl_cv_w32_gethostbyname" = "yes"; then
40 HOSTENT_LIB="-lws2_32"
41 fi
42 ])
43 fi
44 AC_SUBST([HOSTENT_LIB])
45])
diff --git a/gl/m4/iconv.m4 b/gl/m4/iconv.m4
index 66bc76f..3cc6268 100644
--- a/gl/m4/iconv.m4
+++ b/gl/m4/iconv.m4
@@ -1,5 +1,5 @@
1# iconv.m4 serial AM6 (gettext-0.17) 1# iconv.m4 serial AM7 (gettext-0.18)
2dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 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([AM_ICONV_LINK],
34 am_save_CPPFLAGS="$CPPFLAGS" 34 am_save_CPPFLAGS="$CPPFLAGS"
35 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) 35 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
36 36
37 AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ 37 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
38 am_cv_func_iconv="no, consider installing GNU libiconv" 38 am_cv_func_iconv="no, consider installing GNU libiconv"
39 am_cv_lib_iconv=no 39 am_cv_lib_iconv=no
40 AC_TRY_LINK([#include <stdlib.h> 40 AC_TRY_LINK([#include <stdlib.h>
@@ -42,7 +42,7 @@ AC_DEFUN([AM_ICONV_LINK],
42 [iconv_t cd = iconv_open("",""); 42 [iconv_t cd = iconv_open("","");
43 iconv(cd,NULL,NULL,NULL,NULL); 43 iconv(cd,NULL,NULL,NULL,NULL);
44 iconv_close(cd);], 44 iconv_close(cd);],
45 am_cv_func_iconv=yes) 45 [am_cv_func_iconv=yes])
46 if test "$am_cv_func_iconv" != yes; then 46 if test "$am_cv_func_iconv" != yes; then
47 am_save_LIBS="$LIBS" 47 am_save_LIBS="$LIBS"
48 LIBS="$LIBS $LIBICONV" 48 LIBS="$LIBS $LIBICONV"
@@ -51,13 +51,13 @@ AC_DEFUN([AM_ICONV_LINK],
51 [iconv_t cd = iconv_open("",""); 51 [iconv_t cd = iconv_open("","");
52 iconv(cd,NULL,NULL,NULL,NULL); 52 iconv(cd,NULL,NULL,NULL,NULL);
53 iconv_close(cd);], 53 iconv_close(cd);],
54 am_cv_lib_iconv=yes 54 [am_cv_lib_iconv=yes]
55 am_cv_func_iconv=yes) 55 [am_cv_func_iconv=yes])
56 LIBS="$am_save_LIBS" 56 LIBS="$am_save_LIBS"
57 fi 57 fi
58 ]) 58 ])
59 if test "$am_cv_func_iconv" = yes; then 59 if test "$am_cv_func_iconv" = yes; then
60 AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ 60 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
61 dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. 61 dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
62 am_save_LIBS="$LIBS" 62 am_save_LIBS="$LIBS"
63 if test $am_cv_lib_iconv = yes; then 63 if test $am_cv_lib_iconv = yes; then
@@ -134,7 +134,7 @@ int main ()
134 am_func_iconv=no am_cv_lib_iconv=no 134 am_func_iconv=no am_cv_lib_iconv=no
135 fi 135 fi
136 if test "$am_func_iconv" = yes; then 136 if test "$am_func_iconv" = yes; then
137 AC_DEFINE(HAVE_ICONV, 1, 137 AC_DEFINE([HAVE_ICONV], [1],
138 [Define if you have the iconv() function and it works.]) 138 [Define if you have the iconv() function and it works.])
139 fi 139 fi
140 if test "$am_cv_lib_iconv" = yes; then 140 if test "$am_cv_lib_iconv" = yes; then
@@ -147,8 +147,8 @@ int main ()
147 LIBICONV= 147 LIBICONV=
148 LTLIBICONV= 148 LTLIBICONV=
149 fi 149 fi
150 AC_SUBST(LIBICONV) 150 AC_SUBST([LIBICONV])
151 AC_SUBST(LTLIBICONV) 151 AC_SUBST([LTLIBICONV])
152]) 152])
153 153
154AC_DEFUN([AM_ICONV], 154AC_DEFUN([AM_ICONV],
@@ -156,7 +156,7 @@ AC_DEFUN([AM_ICONV],
156 AM_ICONV_LINK 156 AM_ICONV_LINK
157 if test "$am_cv_func_iconv" = yes; then 157 if test "$am_cv_func_iconv" = yes; then
158 AC_MSG_CHECKING([for iconv declaration]) 158 AC_MSG_CHECKING([for iconv declaration])
159 AC_CACHE_VAL(am_cv_proto_iconv, [ 159 AC_CACHE_VAL([am_cv_proto_iconv], [
160 AC_TRY_COMPILE([ 160 AC_TRY_COMPILE([
161#include <stdlib.h> 161#include <stdlib.h>
162#include <iconv.h> 162#include <iconv.h>
@@ -169,12 +169,12 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
169#else 169#else
170size_t iconv(); 170size_t iconv();
171#endif 171#endif
172], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") 172], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
173 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) 173 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
174 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` 174 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
175 AC_MSG_RESULT([$]{ac_t:- 175 AC_MSG_RESULT([${ac_t:-
176 }[$]am_cv_proto_iconv) 176 }$am_cv_proto_iconv])
177 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, 177 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
178 [Define as const if the declaration of iconv() needs const.]) 178 [Define as const if the declaration of iconv() needs const.])
179 fi 179 fi
180]) 180])
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 7ce472b..062753c 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,19 +1,46 @@
1# include_next.m4 serial 4 1# include_next.m4 serial 10
2dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2008 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
7dnl From Paul Eggert and Derek Price. 7dnl From Paul Eggert and Derek Price.
8 8
9dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
10dnl
11dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
12dnl 'include' otherwise.
13dnl
14dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler
15dnl supports it in the special case that it is the first include directive in
16dnl the given file, or to 'include' otherwise.
17dnl
18dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
19dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
20dnl '#pragma GCC system_header' has the same effect as if the file was found
21dnl through the include search path specified with '-isystem' options (as
22dnl opposed to the search path specified with '-I' options). Namely, gcc
23dnl does not warn about some things, and on some systems (Solaris and Interix)
24dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
25dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
26dnl of plain '__STDC__'.
27
9AC_DEFUN([gl_INCLUDE_NEXT], 28AC_DEFUN([gl_INCLUDE_NEXT],
10[ 29[
11 AC_LANG_PREPROC_REQUIRE() 30 AC_LANG_PREPROC_REQUIRE()
12 AC_CACHE_CHECK([whether the preprocessor supports include_next], 31 AC_CACHE_CHECK([whether the preprocessor supports include_next],
13 [gl_cv_have_include_next], 32 [gl_cv_have_include_next],
14 [rm -rf conftestd1 conftestd2 33 [rm -rf conftestd1a conftestd1b conftestd2
15 mkdir conftestd1 conftestd2 34 mkdir conftestd1a conftestd1b conftestd2
16 cat <<EOF > conftestd1/conftest.h 35 dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports
36 dnl include_next when used as first preprocessor directive in a file,
37 dnl but not when preceded by another include directive. Additionally,
38 dnl with this same compiler, include_next is a no-op when used in a
39 dnl header file that was included by specifying its absolute file name.
40 dnl Despite these two bugs, include_next is used in the compiler's
41 dnl <math.h>. By virtue of the second bug, we need to use include_next
42 dnl as well in this case.
43 cat <<EOF > conftestd1a/conftest.h
17#define DEFINED_IN_CONFTESTD1 44#define DEFINED_IN_CONFTESTD1
18#include_next <conftest.h> 45#include_next <conftest.h>
19#ifdef DEFINED_IN_CONFTESTD2 46#ifdef DEFINED_IN_CONFTESTD2
@@ -22,32 +49,53 @@ int foo;
22#error "include_next doesn't work" 49#error "include_next doesn't work"
23#endif 50#endif
24EOF 51EOF
52 cat <<EOF > conftestd1b/conftest.h
53#define DEFINED_IN_CONFTESTD1
54#include <stdio.h>
55#include_next <conftest.h>
56#ifdef DEFINED_IN_CONFTESTD2
57int foo;
58#else
59#error "include_next doesn't work"
60#endif
61EOF
25 cat <<EOF > conftestd2/conftest.h 62 cat <<EOF > conftestd2/conftest.h
26#ifndef DEFINED_IN_CONFTESTD1 63#ifndef DEFINED_IN_CONFTESTD1
27#error "include_next test doesn't work" 64#error "include_next test doesn't work"
28#endif 65#endif
29#define DEFINED_IN_CONFTESTD2 66#define DEFINED_IN_CONFTESTD2
30EOF 67EOF
31 save_CPPFLAGS="$CPPFLAGS" 68 gl_save_CPPFLAGS="$CPPFLAGS"
32 CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" 69 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
33 AC_COMPILE_IFELSE([#include <conftest.h>], 70 AC_COMPILE_IFELSE([#include <conftest.h>],
34 [gl_cv_have_include_next=yes], 71 [gl_cv_have_include_next=yes],
35 [gl_cv_have_include_next=no]) 72 [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
36 CPPFLAGS="$save_CPPFLAGS" 73 AC_COMPILE_IFELSE([#include <conftest.h>],
37 rm -rf conftestd1 conftestd2 74 [gl_cv_have_include_next=buggy],
75 [gl_cv_have_include_next=no])
76 ])
77 CPPFLAGS="$gl_save_CPPFLAGS"
78 rm -rf conftestd1a conftestd1b conftestd2
38 ]) 79 ])
80 PRAGMA_SYSTEM_HEADER=
39 if test $gl_cv_have_include_next = yes; then 81 if test $gl_cv_have_include_next = yes; then
40
41 dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it
42 dnl to use @INCLUDE_NEXT@ instead.
43 AC_DEFINE([HAVE_INCLUDE_NEXT], 1,
44 [Define if your compiler supports the #include_next directive.])
45
46 INCLUDE_NEXT=include_next 82 INCLUDE_NEXT=include_next
83 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
84 if test -n "$GCC"; then
85 PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
86 fi
47 else 87 else
48 INCLUDE_NEXT=include 88 if test $gl_cv_have_include_next = buggy; then
89 INCLUDE_NEXT=include
90 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
91 else
92 INCLUDE_NEXT=include
93 INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
94 fi
49 fi 95 fi
50 AC_SUBST([INCLUDE_NEXT]) 96 AC_SUBST([INCLUDE_NEXT])
97 AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
98 AC_SUBST([PRAGMA_SYSTEM_HEADER])
51]) 99])
52 100
53# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) 101# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
@@ -63,12 +111,16 @@ EOF
63# The three "///" are to pacify Sun C 5.8, which otherwise would say 111# The three "///" are to pacify Sun C 5.8, which otherwise would say
64# "warning: #include of /usr/include/... may be non-portable". 112# "warning: #include of /usr/include/... may be non-portable".
65# Use `""', not `<>', so that the /// cannot be confused with a C99 comment. 113# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
114# Note: This macro assumes that the header file is not empty after
115# preprocessing, i.e. it does not only define preprocessor macros but also
116# provides some type/enum definitions or function/variable declarations.
66AC_DEFUN([gl_CHECK_NEXT_HEADERS], 117AC_DEFUN([gl_CHECK_NEXT_HEADERS],
67[ 118[
68 AC_REQUIRE([gl_INCLUDE_NEXT]) 119 AC_REQUIRE([gl_INCLUDE_NEXT])
120 AC_REQUIRE([AC_CANONICAL_HOST])
69 AC_CHECK_HEADERS_ONCE([$1]) 121 AC_CHECK_HEADERS_ONCE([$1])
70 122
71 AC_FOREACH([gl_HEADER_NAME], [$1], 123 m4_foreach_w([gl_HEADER_NAME], [$1],
72 [AS_VAR_PUSHDEF([gl_next_header], 124 [AS_VAR_PUSHDEF([gl_next_header],
73 [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME]))) 125 [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
74 if test $gl_cv_have_include_next = yes; then 126 if test $gl_cv_have_include_next = yes; then
@@ -84,11 +136,22 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
84 [AC_LANG_SOURCE( 136 [AC_LANG_SOURCE(
85 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] 137 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
86 )]) 138 )])
87 dnl eval is necessary to expand ac_cpp. 139 dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
140 dnl that contain only a #include of other header files and no
141 dnl non-comment tokens of their own. This leads to a failure to
142 dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
143 dnl and others. The workaround is to force preservation of comments
144 dnl through option -C. This ensures all necessary #line directives
145 dnl are present. GCC supports option -C as well.
146 case "$host_os" in
147 aix*) gl_absname_cpp="$ac_cpp -C" ;;
148 *) gl_absname_cpp="$ac_cpp" ;;
149 esac
150 dnl eval is necessary to expand gl_absname_cpp.
88 dnl Ultrix and Pyramid sh refuse to redirect output of eval, 151 dnl Ultrix and Pyramid sh refuse to redirect output of eval,
89 dnl so use subshell. 152 dnl so use subshell.
90 AS_VAR_SET([gl_next_header], 153 AS_VAR_SET([gl_next_header],
91 ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | 154 ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
92 sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ 155 sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
93 s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# 156 s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
94 s#^/[^/]#//&# 157 s#^/[^/]#//&#
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index bb02d22..42bfc5e 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,19 +1,26 @@
1# inet_ntop.m4 serial 3 1# inet_ntop.m4 serial 8
2dnl Copyright (C) 2005, 2006 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,
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_INET_NTOP], 7AC_DEFUN([gl_INET_NTOP],
8[ 8[
9 AC_REPLACE_FUNCS(inet_ntop) 9 dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
10 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
11
12 gl_REPLACE_ARPA_INET_H
13
14 AC_REPLACE_FUNCS([inet_ntop])
10 gl_PREREQ_INET_NTOP 15 gl_PREREQ_INET_NTOP
11]) 16])
12 17
13# Prerequisites of lib/inet_ntop.h and lib/inet_ntop.c. 18# Prerequisites of lib/inet_ntop.c.
14AC_DEFUN([gl_PREREQ_INET_NTOP], [ 19AC_DEFUN([gl_PREREQ_INET_NTOP], [
15 AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h])
16 AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>]) 20 AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
21 if test $ac_cv_have_decl_inet_ntop = no; then
22 HAVE_DECL_INET_NTOP=0
23 fi
17 AC_REQUIRE([gl_SOCKET_FAMILIES]) 24 AC_REQUIRE([gl_SOCKET_FAMILIES])
18 AC_REQUIRE([AC_C_RESTRICT]) 25 AC_REQUIRE([AC_C_RESTRICT])
19]) 26])
diff --git a/gl/m4/inline.m4 b/gl/m4/inline.m4
index a07076c..cee5109 100644
--- a/gl/m4/inline.m4
+++ b/gl/m4/inline.m4
@@ -1,5 +1,5 @@
1# inline.m4 serial 3 1# inline.m4 serial 4
2dnl Copyright (C) 2006 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,7 +32,7 @@ AC_DEFUN([gl_INLINE],
32 fi 32 fi
33 ]) 33 ])
34 if test $gl_cv_c_inline_effective = yes; then 34 if test $gl_cv_c_inline_effective = yes; then
35 AC_DEFINE([HAVE_INLINE], 1, 35 AC_DEFINE([HAVE_INLINE], [1],
36 [Define to 1 if the compiler supports one of the keywords 36 [Define to 1 if the compiler supports one of the keywords
37 'inline', '__inline__', '__inline' and effectively inlines 37 'inline', '__inline__', '__inline' and effectively inlines
38 functions marked as such.]) 38 functions marked as such.])
diff --git a/gl/m4/intdiv0.m4 b/gl/m4/intdiv0.m4
index 8c8a670..29e6e0a 100644
--- a/gl/m4/intdiv0.m4
+++ b/gl/m4/intdiv0.m4
@@ -1,5 +1,5 @@
1# intdiv0.m4 serial 2 (gettext-0.17) 1# intdiv0.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 2007-2008 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.
@@ -61,7 +61,7 @@ int main ()
61 nan = y / y; 61 nan = y / y;
62 exit (1); 62 exit (1);
63} 63}
64], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 64], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
65 [ 65 [
66 # Guess based on the CPU. 66 # Guess based on the CPU.
67changequote(,)dnl 67changequote(,)dnl
@@ -79,6 +79,6 @@ changequote([,])dnl
79 *yes) value=1;; 79 *yes) value=1;;
80 *) value=0;; 80 *) value=0;;
81 esac 81 esac
82 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 82 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
83 [Define if integer division by zero raises signal SIGFPE.]) 83 [Define if integer division by zero raises signal SIGFPE.])
84]) 84])
diff --git a/gl/m4/intldir.m4 b/gl/m4/intldir.m4
index 7a28843..0980e6f 100644
--- a/gl/m4/intldir.m4
+++ b/gl/m4/intldir.m4
@@ -1,5 +1,5 @@
1# intldir.m4 serial 1 (gettext-0.16) 1# intldir.m4 serial 2 (gettext-0.18)
2dnl Copyright (C) 2006 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.
@@ -13,7 +13,7 @@ dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License. 13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain. 14dnl They are *not* in the public domain.
15 15
16AC_PREREQ(2.52) 16AC_PREREQ([2.52])
17 17
18dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. 18dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
19AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) 19AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4
index d3f0d90..c24837c 100644
--- a/gl/m4/intlmacosx.m4
+++ b/gl/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
1# intlmacosx.m4 serial 1 (gettext-0.17) 1# intlmacosx.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-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,7 +19,7 @@ AC_DEFUN([gt_INTL_MACOSX],
19[ 19[
20 dnl Check for API introduced in MacOS X 10.2. 20 dnl Check for API introduced in MacOS X 10.2.
21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22 gt_cv_func_CFPreferencesCopyAppValue, 22 [gt_cv_func_CFPreferencesCopyAppValue],
23 [gt_save_LIBS="$LIBS" 23 [gt_save_LIBS="$LIBS"
24 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 24 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
25 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], 25 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
@@ -28,11 +28,11 @@ AC_DEFUN([gt_INTL_MACOSX],
28 [gt_cv_func_CFPreferencesCopyAppValue=no]) 28 [gt_cv_func_CFPreferencesCopyAppValue=no])
29 LIBS="$gt_save_LIBS"]) 29 LIBS="$gt_save_LIBS"])
30 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then 30 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
31 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, 31 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
32 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 32 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
33 fi 33 fi
34 dnl Check for API introduced in MacOS X 10.3. 34 dnl Check for API introduced in MacOS X 10.3.
35 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, 35 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36 [gt_save_LIBS="$LIBS" 36 [gt_save_LIBS="$LIBS"
37 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 37 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
38 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], 38 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
@@ -40,7 +40,7 @@ AC_DEFUN([gt_INTL_MACOSX],
40 [gt_cv_func_CFLocaleCopyCurrent=no]) 40 [gt_cv_func_CFLocaleCopyCurrent=no])
41 LIBS="$gt_save_LIBS"]) 41 LIBS="$gt_save_LIBS"])
42 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then 42 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
43 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, 43 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
44 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) 44 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
45 fi 45 fi
46 INTL_MACOSX_LIBS= 46 INTL_MACOSX_LIBS=
diff --git a/gl/m4/intmax.m4 b/gl/m4/intmax.m4
index ce7a8a4..a3785e9 100644
--- a/gl/m4/intmax.m4
+++ b/gl/m4/intmax.m4
@@ -1,5 +1,5 @@
1# intmax.m4 serial 3 (gettext-0.16) 1# intmax.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-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.
@@ -12,7 +12,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
12[ 12[
13 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 13 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 15 AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
16 [AC_TRY_COMPILE([ 16 [AC_TRY_COMPILE([
17#include <stddef.h> 17#include <stddef.h>
18#include <stdlib.h> 18#include <stdlib.h>
@@ -24,10 +24,10 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
24#endif 24#endif
25], [intmax_t x = -1; 25], [intmax_t x = -1;
26 return !x;], 26 return !x;],
27 gt_cv_c_intmax_t=yes, 27 [gt_cv_c_intmax_t=yes],
28 gt_cv_c_intmax_t=no)]) 28 [gt_cv_c_intmax_t=no])])
29 if test $gt_cv_c_intmax_t = yes; then 29 if test $gt_cv_c_intmax_t = yes; then
30 AC_DEFINE(HAVE_INTMAX_T, 1, 30 AC_DEFINE([HAVE_INTMAX_T], [1],
31 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) 31 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
32 fi 32 fi
33]) 33])
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
index 50ae35d..264cb57 100644
--- a/gl/m4/intmax_t.m4
+++ b/gl/m4/intmax_t.m4
@@ -1,12 +1,12 @@
1# intmax_t.m4 serial 6 1# intmax_t.m4 serial 7
2dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 1997-2004, 2006-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.
6 6
7dnl From Paul Eggert. 7dnl From Paul Eggert.
8 8
9AC_PREREQ(2.13) 9AC_PREREQ([2.13])
10 10
11# Define intmax_t to 'long' or 'long long' 11# Define intmax_t to 'long' or 'long long'
12# if it is not already defined in <stdint.h> or <inttypes.h>. 12# if it is not already defined in <stdint.h> or <inttypes.h>.
@@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
22 test $ac_cv_type_long_long_int = yes \ 22 test $ac_cv_type_long_long_int = yes \
23 && ac_type='long long' \ 23 && ac_type='long long' \
24 || ac_type='long' 24 || ac_type='long'
25 AC_DEFINE_UNQUOTED(intmax_t, $ac_type, 25 AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
26 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) 26 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
27 else 27 else
28 AC_DEFINE(HAVE_INTMAX_T, 1, 28 AC_DEFINE([HAVE_INTMAX_T], [1],
29 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) 29 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
30 fi 30 fi
31]) 31])
@@ -36,7 +36,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
36[ 36[
37 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 37 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
38 AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 38 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
39 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 39 AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
40 [AC_TRY_COMPILE([ 40 [AC_TRY_COMPILE([
41#include <stddef.h> 41#include <stddef.h>
42#include <stdlib.h> 42#include <stdlib.h>
@@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
48#endif 48#endif
49], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) 49], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
50 if test $gt_cv_c_intmax_t = yes; then 50 if test $gt_cv_c_intmax_t = yes; then
51 AC_DEFINE(HAVE_INTMAX_T, 1, 51 AC_DEFINE([HAVE_INTMAX_T], [1],
52 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) 52 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
53 else 53 else
54 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 54 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
55 test $ac_cv_type_long_long_int = yes \ 55 test $ac_cv_type_long_long_int = yes \
56 && ac_type='long long' \ 56 && ac_type='long long' \
57 || ac_type='long' 57 || ac_type='long'
58 AC_DEFINE_UNQUOTED(intmax_t, $ac_type, 58 AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
59 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) 59 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
60 fi 60 fi
61]) 61])
diff --git a/gl/m4/inttypes-pri.m4 b/gl/m4/inttypes-pri.m4
index 7c7f894..98fec7b 100644
--- a/gl/m4/inttypes-pri.m4
+++ b/gl/m4/inttypes-pri.m4
@@ -1,12 +1,12 @@
1# inttypes-pri.m4 serial 4 (gettext-0.16) 1# inttypes-pri.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 1997-2002, 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
7dnl From Bruno Haible. 7dnl From Bruno Haible.
8 8
9AC_PREREQ(2.52) 9AC_PREREQ([2.52])
10 10
11# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* 11# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
12# macros to non-string values. This is the case on AIX 4.3.3. 12# macros to non-string values. This is the case on AIX 4.3.3.
@@ -16,17 +16,17 @@ AC_DEFUN([gt_INTTYPES_PRI],
16 AC_CHECK_HEADERS([inttypes.h]) 16 AC_CHECK_HEADERS([inttypes.h])
17 if test $ac_cv_header_inttypes_h = yes; then 17 if test $ac_cv_header_inttypes_h = yes; then
18 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 18 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
19 gt_cv_inttypes_pri_broken, 19 [gt_cv_inttypes_pri_broken],
20 [ 20 [
21 AC_TRY_COMPILE([#include <inttypes.h> 21 AC_TRY_COMPILE([#include <inttypes.h>
22#ifdef PRId32 22#ifdef PRId32
23char *p = PRId32; 23char *p = PRId32;
24#endif 24#endif
25], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 25], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
26 ]) 26 ])
27 fi 27 fi
28 if test "$gt_cv_inttypes_pri_broken" = yes; then 28 if test "$gt_cv_inttypes_pri_broken" = yes; then
29 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 29 AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
30 [Define if <inttypes.h> exists and defines unusable PRI* macros.]) 30 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
31 PRI_MACROS_BROKEN=1 31 PRI_MACROS_BROKEN=1
32 else 32 else
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index edc8ecb..f4ca160 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
1# inttypes_h.m4 serial 7 1# inttypes_h.m4 serial 9
2dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 1997-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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
11 11
12AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 12AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
13[ 13[
14 AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 14 AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
15 [AC_TRY_COMPILE( 15 [AC_TRY_COMPILE(
16 [#include <sys/types.h> 16 [#include <sys/types.h>
17#include <inttypes.h>], 17#include <inttypes.h>],
18 [uintmax_t i = (uintmax_t) -1; return !i;], 18 [uintmax_t i = (uintmax_t) -1; return !i;],
19 gl_cv_header_inttypes_h=yes, 19 [gl_cv_header_inttypes_h=yes],
20 gl_cv_header_inttypes_h=no)]) 20 [gl_cv_header_inttypes_h=no])])
21 if test $gl_cv_header_inttypes_h = yes; then 21 if test $gl_cv_header_inttypes_h = yes; then
22 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 22 AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
23 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, 23 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ]) 24 and declares uintmax_t. ])
25 fi 25 fi
diff --git a/gl/m4/lcmessage.m4 b/gl/m4/lcmessage.m4
index 19aa77e..fa8e416 100644
--- a/gl/m4/lcmessage.m4
+++ b/gl/m4/lcmessage.m4
@@ -1,5 +1,5 @@
1# lcmessage.m4 serial 4 (gettext-0.14.2) 1# lcmessage.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -20,11 +20,11 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
20 20
21AC_DEFUN([gt_LC_MESSAGES], 21AC_DEFUN([gt_LC_MESSAGES],
22[ 22[
23 AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, 23 AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
24 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], 24 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
25 gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) 25 [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
26 if test $gt_cv_val_LC_MESSAGES = yes; then 26 if test $gt_cv_val_LC_MESSAGES = yes; then
27 AC_DEFINE(HAVE_LC_MESSAGES, 1, 27 AC_DEFINE([HAVE_LC_MESSAGES], [1],
28 [Define if your <locale.h> file defines LC_MESSAGES.]) 28 [Define if your <locale.h> file defines LC_MESSAGES.])
29 fi 29 fi
30]) 30])
diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4
index 96c4e2c..e4863f2 100644
--- a/gl/m4/lib-ld.m4
+++ b/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
1# lib-ld.m4 serial 3 (gettext-0.13) 1# lib-ld.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. 2dnl Copyright (C) 1996-2003, 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.
@@ -10,7 +10,7 @@ dnl with libtool.m4.
10 10
11dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. 11dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
12AC_DEFUN([AC_LIB_PROG_LD_GNU], 12AC_DEFUN([AC_LIB_PROG_LD_GNU],
13[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, 13[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
14[# I'd rather use --version here, but apparently some GNU ld's only accept -v. 14[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15case `$LD -v 2>&1 </dev/null` in 15case `$LD -v 2>&1 </dev/null` in
16*GNU* | *'with BFD'*) 16*GNU* | *'with BFD'*)
@@ -23,7 +23,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld
23 23
24dnl From libtool-1.4. Sets the variable LD. 24dnl From libtool-1.4. Sets the variable LD.
25AC_DEFUN([AC_LIB_PROG_LD], 25AC_DEFUN([AC_LIB_PROG_LD],
26[AC_ARG_WITH(gnu-ld, 26[AC_ARG_WITH([gnu-ld],
27[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], 27[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
28test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) 28test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
29AC_REQUIRE([AC_PROG_CC])dnl 29AC_REQUIRE([AC_PROG_CC])dnl
@@ -77,7 +77,7 @@ elif test "$with_gnu_ld" = yes; then
77else 77else
78 AC_MSG_CHECKING([for non-GNU ld]) 78 AC_MSG_CHECKING([for non-GNU ld])
79fi 79fi
80AC_CACHE_VAL(acl_cv_path_LD, 80AC_CACHE_VAL([acl_cv_path_LD],
81[if test -z "$LD"; then 81[if test -z "$LD"; then
82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" 82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
83 for ac_dir in $PATH; do 83 for ac_dir in $PATH; do
@@ -101,9 +101,9 @@ else
101fi]) 101fi])
102LD="$acl_cv_path_LD" 102LD="$acl_cv_path_LD"
103if test -n "$LD"; then 103if test -n "$LD"; then
104 AC_MSG_RESULT($LD) 104 AC_MSG_RESULT([$LD])
105else 105else
106 AC_MSG_RESULT(no) 106 AC_MSG_RESULT([no])
107fi 107fi
108test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 108test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
109AC_LIB_PROG_LD_GNU 109AC_LIB_PROG_LD_GNU
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index e3d26fc..fcd3391 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,12 +1,12 @@
1# lib-link.m4 serial 13 (gettext-0.17) 1# lib-link.m4 serial 18 (gettext-0.18)
2dnl Copyright (C) 2001-2007 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,
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
7dnl From Bruno Haible. 7dnl From Bruno Haible.
8 8
9AC_PREREQ(2.54) 9AC_PREREQ([2.54])
10 10
11dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and 11dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
12dnl the libraries corresponding to explicit and implicit dependencies. 12dnl the libraries corresponding to explicit and implicit dependencies.
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
18[ 18[
19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20 AC_REQUIRE([AC_LIB_RPATH]) 20 AC_REQUIRE([AC_LIB_RPATH])
21 define([Name],[translit([$1],[./-], [___])]) 21 pushdef([Name],[translit([$1],[./-], [___])])
22 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 22 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ 24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 25 AC_LIB_LINKFLAGS_BODY([$1], [$2])
26 ac_cv_lib[]Name[]_libs="$LIB[]NAME" 26 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -39,8 +39,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
39 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the 39 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
40 dnl results of this search when this library appears as a dependency. 40 dnl results of this search when this library appears as a dependency.
41 HAVE_LIB[]NAME=yes 41 HAVE_LIB[]NAME=yes
42 undefine([Name]) 42 popdef([NAME])
43 undefine([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)
@@ -57,9 +57,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
57[ 57[
58 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 58 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
59 AC_REQUIRE([AC_LIB_RPATH]) 59 AC_REQUIRE([AC_LIB_RPATH])
60 define([Name],[translit([$1],[./-], [___])]) 60 pushdef([Name],[translit([$1],[./-], [___])])
61 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 61 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
62 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 62 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
63 63
64 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME 64 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
65 dnl accordingly. 65 dnl accordingly.
@@ -95,8 +95,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
95 AC_SUBST([LIB]NAME) 95 AC_SUBST([LIB]NAME)
96 AC_SUBST([LTLIB]NAME) 96 AC_SUBST([LTLIB]NAME)
97 AC_SUBST([LIB]NAME[_PREFIX]) 97 AC_SUBST([LIB]NAME[_PREFIX])
98 undefine([Name]) 98 popdef([NAME])
99 undefine([NAME]) 99 popdef([Name])
100]) 100])
101 101
102dnl Determine the platform dependent parameters needed to use rpath: 102dnl Determine the platform dependent parameters needed to use rpath:
@@ -114,7 +114,7 @@ AC_DEFUN([AC_LIB_RPATH],
114 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld 114 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
115 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host 115 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
116 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir 116 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
117 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ 117 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
118 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ 118 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
119 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh 119 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
120 . ./conftest.sh 120 . ./conftest.sh
@@ -131,11 +131,32 @@ AC_DEFUN([AC_LIB_RPATH],
131 acl_hardcode_direct="$acl_cv_hardcode_direct" 131 acl_hardcode_direct="$acl_cv_hardcode_direct"
132 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" 132 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
133 dnl Determine whether the user wants rpath handling at all. 133 dnl Determine whether the user wants rpath handling at all.
134 AC_ARG_ENABLE(rpath, 134 AC_ARG_ENABLE([rpath],
135 [ --disable-rpath do not hardcode runtime library paths], 135 [ --disable-rpath do not hardcode runtime library paths],
136 :, enable_rpath=yes) 136 :, enable_rpath=yes)
137]) 137])
138 138
139dnl AC_LIB_FROMPACKAGE(name, package)
140dnl declares that libname comes from the given package. The configure file
141dnl will then not have a --with-libname-prefix option but a
142dnl --with-package-prefix option. Several libraries can come from the same
143dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
144dnl macro call that searches for libname.
145AC_DEFUN([AC_LIB_FROMPACKAGE],
146[
147 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
148 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
149 define([acl_frompackage_]NAME, [$2])
150 popdef([NAME])
151 pushdef([PACK],[$2])
152 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
153 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
154 define([acl_libsinpackage_]PACKUP,
155 m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
156 popdef([PACKUP])
157 popdef([PACK])
158])
159
139dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and 160dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
140dnl the libraries corresponding to explicit and implicit dependencies. 161dnl the libraries corresponding to explicit and implicit dependencies.
141dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. 162dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
@@ -144,19 +165,23 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
144AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 165AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
145[ 166[
146 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 167 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
147 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], 168 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
148 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) 169 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
170 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
171 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
172 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
173 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
149 dnl Autoconf >= 2.61 supports dots in --with options. 174 dnl Autoconf >= 2.61 supports dots in --with options.
150 define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) 175 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
151 dnl By default, look in $includedir and $libdir. 176 dnl By default, look in $includedir and $libdir.
152 use_additional=yes 177 use_additional=yes
153 AC_LIB_WITH_FINAL_PREFIX([ 178 AC_LIB_WITH_FINAL_PREFIX([
154 eval additional_includedir=\"$includedir\" 179 eval additional_includedir=\"$includedir\"
155 eval additional_libdir=\"$libdir\" 180 eval additional_libdir=\"$libdir\"
156 ]) 181 ])
157 AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], 182 AC_ARG_WITH(P_A_C_K[-prefix],
158[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib 183[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
159 --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], 184 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
160[ 185[
161 if test "X$withval" = "Xno"; then 186 if test "X$withval" = "Xno"; then
162 use_additional=no 187 use_additional=no
@@ -169,6 +194,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
169 else 194 else
170 additional_includedir="$withval/include" 195 additional_includedir="$withval/include"
171 additional_libdir="$withval/$acl_libdirstem" 196 additional_libdir="$withval/$acl_libdirstem"
197 if test "$acl_libdirstem2" != "$acl_libdirstem" \
198 && ! test -d "$withval/$acl_libdirstem"; then
199 additional_libdir="$withval/$acl_libdirstem2"
200 fi
172 fi 201 fi
173 fi 202 fi
174]) 203])
@@ -327,7 +356,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
327 dnl Linking with a shared library. We attempt to hardcode its 356 dnl Linking with a shared library. We attempt to hardcode its
328 dnl directory into the executable's runpath, unless it's the 357 dnl directory into the executable's runpath, unless it's the
329 dnl standard /usr/lib. 358 dnl standard /usr/lib.
330 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then 359 if test "$enable_rpath" = no \
360 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
361 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
331 dnl No hardcoding is needed. 362 dnl No hardcoding is needed.
332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 363 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
333 else 364 else
@@ -415,7 +446,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
415 case "$found_dir" in 446 case "$found_dir" in
416 */$acl_libdirstem | */$acl_libdirstem/) 447 */$acl_libdirstem | */$acl_libdirstem/)
417 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` 448 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
418 LIB[]NAME[]_PREFIX="$basedir" 449 if test "$name" = '$1'; then
450 LIB[]NAME[]_PREFIX="$basedir"
451 fi
452 additional_includedir="$basedir/include"
453 ;;
454 */$acl_libdirstem2 | */$acl_libdirstem2/)
455 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
456 if test "$name" = '$1'; then
457 LIB[]NAME[]_PREFIX="$basedir"
458 fi
419 additional_includedir="$basedir/include" 459 additional_includedir="$basedir/include"
420 ;; 460 ;;
421 esac 461 esac
@@ -476,9 +516,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
476 dnl 3. if it's already present in $LDFLAGS or the already 516 dnl 3. if it's already present in $LDFLAGS or the already
477 dnl constructed $LIBNAME, 517 dnl constructed $LIBNAME,
478 dnl 4. if it doesn't exist as a directory. 518 dnl 4. if it doesn't exist as a directory.
479 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then 519 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
520 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
480 haveit= 521 haveit=
481 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 522 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
523 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
482 if test -n "$GCC"; then 524 if test -n "$GCC"; then
483 case $host_os in 525 case $host_os in
484 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 526 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -609,6 +651,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
609 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" 651 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
610 done 652 done
611 fi 653 fi
654 popdef([P_A_C_K])
655 popdef([PACKLIBS])
656 popdef([PACKUP])
657 popdef([PACK])
658 popdef([NAME])
612]) 659])
613 660
614dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, 661dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
@@ -654,7 +701,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
654 if test -n "$next"; then 701 if test -n "$next"; then
655 dir="$next" 702 dir="$next"
656 dnl No need to hardcode the standard /usr/lib. 703 dnl No need to hardcode the standard /usr/lib.
657 if test "X$dir" != "X/usr/$acl_libdirstem"; then 704 if test "X$dir" != "X/usr/$acl_libdirstem" \
705 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
658 rpathdirs="$rpathdirs $dir" 706 rpathdirs="$rpathdirs $dir"
659 fi 707 fi
660 next= 708 next=
@@ -663,7 +711,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
663 -L) next=yes ;; 711 -L) next=yes ;;
664 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` 712 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
665 dnl No need to hardcode the standard /usr/lib. 713 dnl No need to hardcode the standard /usr/lib.
666 if test "X$dir" != "X/usr/$acl_libdirstem"; then 714 if test "X$dir" != "X/usr/$acl_libdirstem" \
715 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
667 rpathdirs="$rpathdirs $dir" 716 rpathdirs="$rpathdirs $dir"
668 fi 717 fi
669 next= ;; 718 next= ;;
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
index a8684e1..3bdc0fc 100644
--- a/gl/m4/lib-prefix.m4
+++ b/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
1# lib-prefix.m4 serial 5 (gettext-0.15) 1# lib-prefix.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2005, 2008 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.
@@ -153,33 +153,69 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
153 prefix="$acl_save_prefix" 153 prefix="$acl_save_prefix"
154]) 154])
155 155
156dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing 156dnl AC_LIB_PREPARE_MULTILIB creates
157dnl the basename of the libdir, either "lib" or "lib64". 157dnl - a variable acl_libdirstem, containing the basename of the libdir, either
158dnl "lib" or "lib64" or "lib/64",
159dnl - a variable acl_libdirstem2, as a secondary possible value for
160dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
161dnl "lib/amd64".
158AC_DEFUN([AC_LIB_PREPARE_MULTILIB], 162AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
159[ 163[
160 dnl There is no formal standard regarding lib and lib64. The current 164 dnl There is no formal standard regarding lib and lib64.
161 dnl practice is that on a system supporting 32-bit and 64-bit instruction 165 dnl On glibc systems, the current practice is that on a system supporting
162 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit 166 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
163 dnl libraries go under $prefix/lib. We determine the compiler's default 167 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
164 dnl mode by looking at the compiler's library search path. If at least 168 dnl the compiler's default mode by looking at the compiler's library search
165 dnl of its elements ends in /lib64 or points to a directory whose absolute 169 dnl path. If at least one of its elements ends in /lib64 or points to a
166 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the 170 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
167 dnl default, namely "lib". 171 dnl Otherwise we use the default, namely "lib".
172 dnl On Solaris systems, the current practice is that on a system supporting
173 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
174 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
175 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
176 AC_REQUIRE([AC_CANONICAL_HOST])
168 acl_libdirstem=lib 177 acl_libdirstem=lib
169 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` 178 acl_libdirstem2=
170 if test -n "$searchpath"; then 179 case "$host_os" in
171 acl_save_IFS="${IFS= }"; IFS=":" 180 solaris*)
172 for searchdir in $searchpath; do 181 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
173 if test -d "$searchdir"; then 182 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
174 case "$searchdir" in 183 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
175 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; 184 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
176 *) searchdir=`cd "$searchdir" && pwd` 185 dnl symlink is missing, so we set acl_libdirstem2 too.
177 case "$searchdir" in 186 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
178 */lib64 ) acl_libdirstem=lib64 ;; 187 [AC_EGREP_CPP([sixtyfour bits], [
179 esac ;; 188#ifdef _LP64
189sixtyfour bits
190#endif
191 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
192 ])
193 if test $gl_cv_solaris_64bit = yes; then
194 acl_libdirstem=lib/64
195 case "$host_cpu" in
196 sparc*) acl_libdirstem2=lib/sparcv9 ;;
197 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
180 esac 198 esac
181 fi 199 fi
182 done 200 ;;
183 IFS="$acl_save_IFS" 201 *)
184 fi 202 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
203 if test -n "$searchpath"; then
204 acl_save_IFS="${IFS= }"; IFS=":"
205 for searchdir in $searchpath; do
206 if test -d "$searchdir"; then
207 case "$searchdir" in
208 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
209 *) searchdir=`cd "$searchdir" && pwd`
210 case "$searchdir" in
211 */lib64 ) acl_libdirstem=lib64 ;;
212 esac ;;
213 esac
214 fi
215 done
216 IFS="$acl_save_IFS"
217 fi
218 ;;
219 esac
220 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
185]) 221])
diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
index b2b7733..e960104 100644
--- a/gl/m4/localcharset.m4
+++ b/gl/m4/localcharset.m4
@@ -1,5 +1,5 @@
1# localcharset.m4 serial 5 1# localcharset.m4 serial 6
2dnl Copyright (C) 2002, 2004, 2006 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,
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,7 +8,7 @@ AC_DEFUN([gl_LOCALCHARSET],
8[ 8[
9 dnl Prerequisites of lib/localcharset.c. 9 dnl Prerequisites of lib/localcharset.c.
10 AC_REQUIRE([AM_LANGINFO_CODESET]) 10 AC_REQUIRE([AM_LANGINFO_CODESET])
11 AC_CHECK_DECLS_ONCE(getc_unlocked) 11 AC_CHECK_DECLS_ONCE([getc_unlocked])
12 12
13 dnl Prerequisites of the lib/Makefile.am snippet. 13 dnl Prerequisites of the lib/Makefile.am snippet.
14 AC_REQUIRE([AC_CANONICAL_HOST]) 14 AC_REQUIRE([AC_CANONICAL_HOST])
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
new file mode 100644
index 0000000..e471839
--- /dev/null
+++ b/gl/m4/locale-fr.m4
@@ -0,0 +1,204 @@
1# locale-fr.m4 serial 10
2dnl Copyright (C) 2003, 2005-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 From Bruno Haible.
8
9dnl Determine the name of a french locale with traditional encoding.
10AC_DEFUN([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 macosx=
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
35#include <locale.h>
36#include <time.h>
37#if HAVE_LANGINFO_CODESET
38# include <langinfo.h>
39#endif
40#include <stdlib.h>
41#include <string.h>
42struct tm t;
43char buf[16];
44int main () {
45 /* Check whether the given locale name is recognized by the system. */
46 if (setlocale (LC_ALL, "") == NULL) return 1;
47 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
48 On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
49 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
50 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
51 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
52 some unit tests fail. */
53#if HAVE_LANGINFO_CODESET
54 {
55 const char *cs = nl_langinfo (CODESET);
56 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 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 /* Check whether the decimal separator is a comma.
72 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
73 are nl_langinfo(RADIXCHAR) are both ".". */
74 if (localeconv () ->decimal_point[0] != ',') return 1;
75 return 0;
76}
77changequote([,])dnl
78 ])])
79 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
81 # 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
83 # LC_CTYPE, which is also set at the beginning of the configure script.
84 # Test for the usual locale name.
85 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
86 gt_cv_locale_fr=fr_FR
87 else
88 # Test for the locale name with explicit encoding suffix.
89 if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
90 gt_cv_locale_fr=fr_FR.ISO-8859-1
91 else
92 # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
93 if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
94 gt_cv_locale_fr=fr_FR.ISO8859-1
95 else
96 # Test for the HP-UX locale name.
97 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
98 gt_cv_locale_fr=fr_FR.iso88591
99 else
100 # Test for the Solaris 7 locale name.
101 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
102 gt_cv_locale_fr=fr
103 else
104 # None found.
105 gt_cv_locale_fr=none
106 fi
107 fi
108 fi
109 fi
110 fi
111 fi
112 rm -fr conftest*
113 fi
114 ])
115 LOCALE_FR=$gt_cv_locale_fr
116 AC_SUBST([LOCALE_FR])
117])
118
119dnl Determine the name of a french locale with UTF-8 encoding.
120AC_DEFUN([gt_LOCALE_FR_UTF8],
121[
122 AC_REQUIRE([AM_LANGINFO_CODESET])
123 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
124 AC_LANG_CONFTEST([AC_LANG_SOURCE([
125changequote(,)dnl
126#include <locale.h>
127#include <time.h>
128#if HAVE_LANGINFO_CODESET
129# include <langinfo.h>
130#endif
131#include <stdlib.h>
132#include <string.h>
133struct tm t;
134char buf[16];
135int main () {
136 /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
137 imitates locale dependent behaviour by looking at the environment
138 variables, and all locales use the UTF-8 encoding. */
139#if !(defined __BEOS__ || defined __HAIKU__)
140 /* Check whether the given locale name is recognized by the system. */
141 if (setlocale (LC_ALL, "") == NULL) return 1;
142 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
143 On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
144 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
145 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
146 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
147 some unit tests fail. */
148# if HAVE_LANGINFO_CODESET
149 {
150 const char *cs = nl_langinfo (CODESET);
151 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
152 return 1;
153 }
154# endif
155# ifdef __CYGWIN__
156 /* On Cygwin, avoid locale names without encoding suffix, because the
157 locale_charset() function relies on the encoding suffix. Note that
158 LC_ALL is set on the command line. */
159 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
160# endif
161 /* Check whether in the abbreviation of the second month, the second
162 character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
163 two bytes long, with UTF-8 encoding. */
164 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
165 if (strftime (buf, sizeof (buf), "%b", &t) < 4
166 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
167 return 1;
168#endif
169 /* Check whether the decimal separator is a comma.
170 On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
171 are nl_langinfo(RADIXCHAR) are both ".". */
172 if (localeconv () ->decimal_point[0] != ',') return 1;
173 return 0;
174}
175changequote([,])dnl
176 ])])
177 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
178 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
179 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
180 # configure script would override the LC_ALL setting. Likewise for
181 # LC_CTYPE, which is also set at the beginning of the configure script.
182 # Test for the usual locale name.
183 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
184 gt_cv_locale_fr_utf8=fr_FR
185 else
186 # Test for the locale name with explicit encoding suffix.
187 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
188 gt_cv_locale_fr_utf8=fr_FR.UTF-8
189 else
190 # Test for the Solaris 7 locale name.
191 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
192 gt_cv_locale_fr_utf8=fr.UTF-8
193 else
194 # None found.
195 gt_cv_locale_fr_utf8=none
196 fi
197 fi
198 fi
199 fi
200 rm -fr conftest*
201 ])
202 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
203 AC_SUBST([LOCALE_FR_UTF8])
204])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
new file mode 100644
index 0000000..c80c5af
--- /dev/null
+++ b/gl/m4/locale-ja.m4
@@ -0,0 +1,126 @@
1# locale-ja.m4 serial 6
2dnl Copyright (C) 2003, 2005-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 From Bruno Haible.
8
9dnl Determine the name of a japanese locale with EUC-JP encoding.
10AC_DEFUN([gt_LOCALE_JA],
11[
12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
15 macosx=
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
35#include <locale.h>
36#include <time.h>
37#if HAVE_LANGINFO_CODESET
38# include <langinfo.h>
39#endif
40#include <stdlib.h>
41#include <string.h>
42struct tm t;
43char buf[16];
44int main ()
45{
46 const char *p;
47 /* Check whether the given locale name is recognized by the system. */
48 if (setlocale (LC_ALL, "") == NULL) return 1;
49 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
50 On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
51 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
52 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
53 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
54 some unit tests fail. */
55#if HAVE_LANGINFO_CODESET
56 {
57 const char *cs = nl_langinfo (CODESET);
58 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
59 return 1;
60 }
61#endif
62#ifdef __CYGWIN__
63 /* On Cygwin, avoid locale names without encoding suffix, because the
64 locale_charset() function relies on the encoding suffix. Note that
65 LC_ALL is set on the command line. */
66 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
67#endif
68 /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
69 on Cygwin 1.5.x. */
70 if (MB_CUR_MAX == 1)
71 return 1;
72 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
73 This excludes the UTF-8 encoding. */
74 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
75 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
76 for (p = buf; *p != '\0'; p++)
77 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
78 return 1;
79 return 0;
80}
81changequote([,])dnl
82 ])])
83 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
85 # 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
87 # LC_CTYPE, which is also set at the beginning of the configure script.
88 # Test for the AIX locale name.
89 if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
90 gt_cv_locale_ja=ja_JP
91 else
92 # Test for the locale name with explicit encoding suffix.
93 if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
94 gt_cv_locale_ja=ja_JP.EUC-JP
95 else
96 # Test for the HP-UX, OSF/1, NetBSD locale name.
97 if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
98 gt_cv_locale_ja=ja_JP.eucJP
99 else
100 # Test for the IRIX, FreeBSD locale name.
101 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
102 gt_cv_locale_ja=ja_JP.EUC
103 else
104 # Test for the Solaris 7 locale name.
105 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
106 gt_cv_locale_ja=ja
107 else
108 # Special test for NetBSD 1.6.
109 if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
110 gt_cv_locale_ja=ja_JP.eucJP
111 else
112 # None found.
113 gt_cv_locale_ja=none
114 fi
115 fi
116 fi
117 fi
118 fi
119 fi
120 fi
121 rm -fr conftest*
122 fi
123 ])
124 LOCALE_JA=$gt_cv_locale_ja
125 AC_SUBST([LOCALE_JA])
126])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
new file mode 100644
index 0000000..ba7f9c5
--- /dev/null
+++ b/gl/m4/locale-zh.m4
@@ -0,0 +1,111 @@
1# locale-zh.m4 serial 5
2dnl Copyright (C) 2003, 2005-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 From Bruno Haible.
8
9dnl Determine the name of a chinese locale with GB18030 encoding.
10AC_DEFUN([gt_LOCALE_ZH_CN],
11[
12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
15 macosx=
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
35#include <locale.h>
36#include <stdlib.h>
37#include <time.h>
38#if HAVE_LANGINFO_CODESET
39# include <langinfo.h>
40#endif
41#include <stdlib.h>
42#include <string.h>
43struct tm t;
44char buf[16];
45int main ()
46{
47 const char *p;
48 /* Check whether the given locale name is recognized by the system. */
49 if (setlocale (LC_ALL, "") == NULL) return 1;
50 /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
51 On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
52 is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
53 On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
54 succeeds but then nl_langinfo(CODESET) is "646". In this situation,
55 some unit tests fail. */
56#if HAVE_LANGINFO_CODESET
57 {
58 const char *cs = nl_langinfo (CODESET);
59 if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
60 return 1;
61 }
62#endif
63#ifdef __CYGWIN__
64 /* On Cygwin, avoid locale names without encoding suffix, because the
65 locale_charset() function relies on the encoding suffix. Note that
66 LC_ALL is set on the command line. */
67 if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
68#endif
69 /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
70 This excludes the UTF-8 encoding. */
71 t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
72 if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
73 for (p = buf; *p != '\0'; p++)
74 if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
75 return 1;
76 /* Check whether a typical GB18030 multibyte sequence is recognized as a
77 single wide character. This excludes the GB2312 and GBK encodings. */
78 if (mblen ("\203\062\332\066", 5) != 4)
79 return 1;
80 return 0;
81}
82changequote([,])dnl
83 ])])
84 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
86 # 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
88 # LC_CTYPE, which is also set at the beginning of the configure script.
89 # Test for the locale name without encoding suffix.
90 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
91 gt_cv_locale_zh_CN=zh_CN
92 else
93 # Test for the locale name with explicit encoding suffix.
94 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
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
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
106 rm -fr conftest*
107 fi
108 ])
109 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
110 AC_SUBST([LOCALE_ZH_CN])
111])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index 9111933..b416e31 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,259 +1,33 @@
1# lock.m4 serial 7 (gettext-0.17) 1# lock.m4 serial 10 (gettext-0.18)
2dnl Copyright (C) 2005-2007 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.
6 6
7dnl From Bruno Haible. 7dnl From Bruno Haible.
8 8
9dnl Tests for a multithreading library to be used. 9AC_DEFUN([gl_LOCK],
10dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
11dnl USE_PTH_THREADS, USE_WIN32_THREADS
12dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
13dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
14dnl libtool).
15dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
16dnl programs that really need multithread functionality. The difference
17dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
18dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
19dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
20dnl multithread-safe programs.
21
22AC_DEFUN([gl_LOCK_EARLY],
23[
24 AC_REQUIRE([gl_LOCK_EARLY_BODY])
25])
26
27dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
28
29AC_DEFUN([gl_LOCK_EARLY_BODY],
30[
31 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
32 dnl influences the result of the autoconf tests that test for *_unlocked
33 dnl declarations, on AIX 5 at least. Therefore it must come early.
34 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
35 AC_BEFORE([$0], [gl_ARGP])dnl
36
37 AC_REQUIRE([AC_CANONICAL_HOST])
38 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
39 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
40 dnl AC_GNU_SOURCE.
41 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
42 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
43 [AC_REQUIRE([AC_GNU_SOURCE])])
44 dnl Check for multithreading.
45 AC_ARG_ENABLE(threads,
46AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
47AC_HELP_STRING([--disable-threads], [build without multithread safety]),
48 [gl_use_threads=$enableval],
49 [case "$host_os" in
50 dnl Disable multithreading by default on OSF/1, because it interferes
51 dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
52 dnl process gets an endless segmentation fault inside execvp().
53 osf*) gl_use_threads=no ;;
54 *) gl_use_threads=yes ;;
55 esac
56 ])
57 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
58 # For using <pthread.h>:
59 case "$host_os" in
60 osf*)
61 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
62 # groks <pthread.h>. cc also understands the flag -pthread, but
63 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
64 # 2. putting a flag into CPPFLAGS that has an effect on the linker
65 # causes the AC_TRY_LINK test below to succeed unexpectedly,
66 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
67 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
68 ;;
69 esac
70 # Some systems optimize for single-threaded programs by default, and
71 # need special flags to disable these optimizations. For example, the
72 # definition of 'errno' in <errno.h>.
73 case "$host_os" in
74 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
75 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
76 esac
77 fi
78])
79
80dnl The guts of gl_LOCK. Needs to be expanded only once.
81
82AC_DEFUN([gl_LOCK_BODY],
83[ 10[
84 AC_REQUIRE([gl_LOCK_EARLY_BODY]) 11 AC_REQUIRE([gl_THREADLIB])
85 gl_threads_api=none 12 if test "$gl_threads_api" = posix; then
86 LIBTHREAD= 13 # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
87 LTLIBTHREAD= 14 # pthread_rwlock_* functions.
88 LIBMULTITHREAD= 15 AC_CHECK_TYPE([pthread_rwlock_t],
89 LTLIBMULTITHREAD= 16 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
90 if test "$gl_use_threads" != no; then 17 [Define if the POSIX multithreading library has read/write locks.])],
91 dnl Check whether the compiler and linker support weak declarations. 18 [],
92 AC_MSG_CHECKING([whether imported symbols can be declared weak]) 19 [#include <pthread.h>])
93 gl_have_weak=no 20 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
94 AC_TRY_LINK([extern void xyzzy (); 21 AC_TRY_COMPILE([#include <pthread.h>],
95#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) 22 [#if __FreeBSD__ == 4
96 AC_MSG_RESULT([$gl_have_weak])
97 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
98 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
99 # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
100 AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
101 if test "$gl_have_pthread_h" = yes; then
102 # Other possible tests:
103 # -lpthreads (FSU threads, PCthreads)
104 # -lgthreads
105 gl_have_pthread=
106 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
107 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
108 # the second one only in libpthread, and lock.c needs it.
109 AC_TRY_LINK([#include <pthread.h>],
110 [pthread_mutex_lock((pthread_mutex_t*)0);
111 pthread_mutexattr_init((pthread_mutexattr_t*)0);],
112 [gl_have_pthread=yes])
113 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
114 # since it is defined as a macro on OSF/1.)
115 if test -n "$gl_have_pthread"; then
116 # The program links fine without libpthread. But it may actually
117 # need to link with libpthread in order to create multiple threads.
118 AC_CHECK_LIB(pthread, pthread_kill,
119 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
120 # On Solaris and HP-UX, most pthread functions exist also in libc.
121 # Therefore pthread_in_use() needs to actually try to create a
122 # thread: pthread_create from libc will fail, whereas
123 # pthread_create will actually create a thread.
124 case "$host_os" in
125 solaris* | hpux*)
126 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
127 [Define if the pthread_in_use() detection is hard.])
128 esac
129 ])
130 else
131 # Some library is needed. Try libpthread and libc_r.
132 AC_CHECK_LIB(pthread, pthread_kill,
133 [gl_have_pthread=yes
134 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
135 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
136 if test -z "$gl_have_pthread"; then
137 # For FreeBSD 4.
138 AC_CHECK_LIB(c_r, pthread_kill,
139 [gl_have_pthread=yes
140 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
141 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
142 fi
143 fi
144 if test -n "$gl_have_pthread"; then
145 gl_threads_api=posix
146 AC_DEFINE([USE_POSIX_THREADS], 1,
147 [Define if the POSIX multithreading library can be used.])
148 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
149 if test $gl_have_weak = yes; then
150 AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
151 [Define if references to the POSIX multithreading library should be made weak.])
152 LIBTHREAD=
153 LTLIBTHREAD=
154 fi
155 fi
156 # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
157 # pthread_rwlock_* functions.
158 AC_CHECK_TYPE([pthread_rwlock_t],
159 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
160 [Define if the POSIX multithreading library has read/write locks.])],
161 [],
162 [#include <pthread.h>])
163 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
164 AC_TRY_COMPILE([#include <pthread.h>],
165 [#if __FreeBSD__ == 4
166error "No, in FreeBSD 4.0 recursive mutexes actually don't work." 23error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
167#else 24#else
168int x = (int)PTHREAD_MUTEX_RECURSIVE; 25int x = (int)PTHREAD_MUTEX_RECURSIVE;
169return !x; 26return !x;
170#endif], 27#endif],
171 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, 28 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
172 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) 29 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
173 fi
174 fi
175 fi
176 if test -z "$gl_have_pthread"; then
177 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
178 gl_have_solaristhread=
179 gl_save_LIBS="$LIBS"
180 LIBS="$LIBS -lthread"
181 AC_TRY_LINK([#include <thread.h>
182#include <synch.h>],
183 [thr_self();],
184 [gl_have_solaristhread=yes])
185 LIBS="$gl_save_LIBS"
186 if test -n "$gl_have_solaristhread"; then
187 gl_threads_api=solaris
188 LIBTHREAD=-lthread
189 LTLIBTHREAD=-lthread
190 LIBMULTITHREAD="$LIBTHREAD"
191 LTLIBMULTITHREAD="$LTLIBTHREAD"
192 AC_DEFINE([USE_SOLARIS_THREADS], 1,
193 [Define if the old Solaris multithreading library can be used.])
194 if test $gl_have_weak = yes; then
195 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
196 [Define if references to the old Solaris multithreading library should be made weak.])
197 LIBTHREAD=
198 LTLIBTHREAD=
199 fi
200 fi
201 fi
202 fi
203 if test "$gl_use_threads" = pth; then
204 gl_save_CPPFLAGS="$CPPFLAGS"
205 AC_LIB_LINKFLAGS(pth)
206 gl_have_pth=
207 gl_save_LIBS="$LIBS"
208 LIBS="$LIBS -lpth"
209 AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
210 LIBS="$gl_save_LIBS"
211 if test -n "$gl_have_pth"; then
212 gl_threads_api=pth
213 LIBTHREAD="$LIBPTH"
214 LTLIBTHREAD="$LTLIBPTH"
215 LIBMULTITHREAD="$LIBTHREAD"
216 LTLIBMULTITHREAD="$LTLIBTHREAD"
217 AC_DEFINE([USE_PTH_THREADS], 1,
218 [Define if the GNU Pth multithreading library can be used.])
219 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
220 if test $gl_have_weak = yes; then
221 AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
222 [Define if references to the GNU Pth multithreading library should be made weak.])
223 LIBTHREAD=
224 LTLIBTHREAD=
225 fi
226 fi
227 else
228 CPPFLAGS="$gl_save_CPPFLAGS"
229 fi
230 fi
231 if test -z "$gl_have_pthread"; then
232 if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
233 if { case "$host_os" in
234 mingw*) true;;
235 *) false;;
236 esac
237 }; then
238 gl_threads_api=win32
239 AC_DEFINE([USE_WIN32_THREADS], 1,
240 [Define if the Win32 multithreading API can be used.])
241 fi
242 fi
243 fi
244 fi 30 fi
245 AC_MSG_CHECKING([for multithread API to use])
246 AC_MSG_RESULT([$gl_threads_api])
247 AC_SUBST(LIBTHREAD)
248 AC_SUBST(LTLIBTHREAD)
249 AC_SUBST(LIBMULTITHREAD)
250 AC_SUBST(LTLIBMULTITHREAD)
251])
252
253AC_DEFUN([gl_LOCK],
254[
255 AC_REQUIRE([gl_LOCK_EARLY])
256 AC_REQUIRE([gl_LOCK_BODY])
257 gl_PREREQ_LOCK 31 gl_PREREQ_LOCK
258]) 32])
259 33
@@ -261,56 +35,3 @@ AC_DEFUN([gl_LOCK],
261AC_DEFUN([gl_PREREQ_LOCK], [ 35AC_DEFUN([gl_PREREQ_LOCK], [
262 AC_REQUIRE([AC_C_INLINE]) 36 AC_REQUIRE([AC_C_INLINE])
263]) 37])
264
265dnl Survey of platforms:
266dnl
267dnl Platform Available Compiler Supports test-lock
268dnl flavours option weak result
269dnl --------------- --------- --------- -------- ---------
270dnl Linux 2.4/glibc posix -lpthread Y OK
271dnl
272dnl GNU Hurd/glibc posix
273dnl
274dnl FreeBSD 5.3 posix -lc_r Y
275dnl posix -lkse ? Y
276dnl posix -lpthread ? Y
277dnl posix -lthr Y
278dnl
279dnl FreeBSD 5.2 posix -lc_r Y
280dnl posix -lkse Y
281dnl posix -lthr Y
282dnl
283dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
284dnl
285dnl NetBSD 1.6 --
286dnl
287dnl OpenBSD 3.4 posix -lpthread Y OK
288dnl
289dnl MacOS X 10.[123] posix -lpthread Y OK
290dnl
291dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
292dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
293dnl
294dnl HP-UX 11 posix -lpthread N (cc) OK
295dnl Y (gcc)
296dnl
297dnl IRIX 6.5 posix -lpthread Y 0.5
298dnl
299dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
300dnl
301dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
302dnl -lpthread (gcc) Y
303dnl
304dnl Cygwin posix -lpthread Y OK
305dnl
306dnl Any of the above pth -lpth 0.0
307dnl
308dnl Mingw win32 N OK
309dnl
310dnl BeOS 5 --
311dnl
312dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
313dnl turned off:
314dnl OK if all three tests terminate OK,
315dnl 0.5 if the first test terminates OK but the second one loops endlessly,
316dnl 0.0 if the first test already loops endlessly.
diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4
index 15bf9da..eedc8d5 100644
--- a/gl/m4/longlong.m4
+++ b/gl/m4/longlong.m4
@@ -1,5 +1,5 @@
1# longlong.m4 serial 13 1# longlong.m4 serial 14
2dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 1999-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.
@@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
46 [ac_cv_type_long_long_int=yes])], 46 [ac_cv_type_long_long_int=yes])],
47 [ac_cv_type_long_long_int=no])]) 47 [ac_cv_type_long_long_int=no])])
48 if test $ac_cv_type_long_long_int = yes; then 48 if test $ac_cv_type_long_long_int = yes; then
49 AC_DEFINE([HAVE_LONG_LONG_INT], 1, 49 AC_DEFINE([HAVE_LONG_LONG_INT], [1],
50 [Define to 1 if the system has the type `long long int'.]) 50 [Define to 1 if the system has the type `long long int'.])
51 fi 51 fi
52]) 52])
@@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
69 [ac_cv_type_unsigned_long_long_int=yes], 69 [ac_cv_type_unsigned_long_long_int=yes],
70 [ac_cv_type_unsigned_long_long_int=no])]) 70 [ac_cv_type_unsigned_long_long_int=no])])
71 if test $ac_cv_type_unsigned_long_long_int = yes; then 71 if test $ac_cv_type_unsigned_long_long_int = yes; then
72 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, 72 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
73 [Define to 1 if the system has the type `unsigned long long int'.]) 73 [Define to 1 if the system has the type `unsigned long long int'.])
74 fi 74 fi
75]) 75])
diff --git a/gl/m4/ls-mntd-fs.m4 b/gl/m4/ls-mntd-fs.m4
index 21ac4e7..32ccb98 100644
--- a/gl/m4/ls-mntd-fs.m4
+++ b/gl/m4/ls-mntd-fs.m4
@@ -1,8 +1,7 @@
1#serial 26 1# serial 27
2# How to list mounted file systems. 2# How to list mounted file systems.
3 3
4# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software 4# Copyright (C) 1998-2004, 2006, 2009 Free Software Foundation, Inc.
5# Foundation, Inc.
6# 5#
7# This file is free software; the Free Software Foundation 6# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -20,27 +19,27 @@ dnl
20AC_DEFUN([AC_FUNC_GETMNTENT], 19AC_DEFUN([AC_FUNC_GETMNTENT],
21[# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, 20[# getmntent is in the standard C library on UNICOS, in -lsun on Irix 4,
22# -lseq on Dynix/PTX, -lgen on Unixware. 21# -lseq on Dynix/PTX, -lgen on Unixware.
23AC_SEARCH_LIBS(getmntent, [sun seq gen]) 22AC_SEARCH_LIBS([getmntent], [sun seq gen])
24AC_CHECK_FUNCS(getmntent) 23AC_CHECK_FUNCS([getmntent])
25]) 24])
26 25
27# gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 26# gl_LIST_MOUNTED_FILE_SYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
28AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], 27AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS],
29 [ 28 [
30AC_CHECK_FUNCS(listmntent getmntinfo) 29AC_CHECK_FUNCS([listmntent getmntinfo])
31AC_CHECK_HEADERS_ONCE(sys/param.h sys/statvfs.h) 30AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h])
32 31
33# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses 32# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
34# NGROUPS (as the array dimension for a struct member) without a definition. 33# NGROUPS (as the array dimension for a struct member) without a definition.
35AC_CHECK_HEADERS(sys/ucred.h, [], [], [#include <grp.h>]) 34AC_CHECK_HEADERS([sys/ucred.h], [], [], [#include <grp.h>])
36 35
37AC_CHECK_HEADERS(sys/mount.h, [], [], 36AC_CHECK_HEADERS([sys/mount.h], [], [],
38 [AC_INCLUDES_DEFAULT 37 [AC_INCLUDES_DEFAULT
39 [#if HAVE_SYS_PARAM_H 38 [#if HAVE_SYS_PARAM_H
40 #include <sys/param.h> 39 #include <sys/param.h>
41 #endif]]) 40 #endif]])
42 41
43AC_CHECK_HEADERS(mntent.h sys/fs_types.h) 42AC_CHECK_HEADERS([mntent.h sys/fs_types.h])
44 getfsstat_includes="\ 43 getfsstat_includes="\
45$ac_includes_default 44$ac_includes_default
46#if HAVE_SYS_PARAM_H 45#if HAVE_SYS_PARAM_H
@@ -78,9 +77,9 @@ AC_FUNC_GETMNTENT
78if test -z "$ac_list_mounted_fs"; then 77if test -z "$ac_list_mounted_fs"; then
79 # Cray UNICOS 9 78 # Cray UNICOS 9
80 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9]) 79 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
81 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent, 80 AC_CACHE_VAL([fu_cv_sys_mounted_cray_listmntent],
82 [fu_cv_sys_mounted_cray_listmntent=no 81 [fu_cv_sys_mounted_cray_listmntent=no
83 AC_EGREP_CPP(yes, 82 AC_EGREP_CPP([yes],
84 [#ifdef _CRAY 83 [#ifdef _CRAY
85yes 84yes
86#endif 85#endif
@@ -89,10 +88,10 @@ yes
89 ) 88 )
90 ] 89 ]
91 ) 90 )
92 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent) 91 AC_MSG_RESULT([$fu_cv_sys_mounted_cray_listmntent])
93 if test $fu_cv_sys_mounted_cray_listmntent = yes; then 92 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
94 ac_list_mounted_fs=found 93 ac_list_mounted_fs=found
95 AC_DEFINE(MOUNTED_LISTMNTENT, 1, 94 AC_DEFINE([MOUNTED_LISTMNTENT], [1],
96 [Define if there is a function named listmntent that can be used to 95 [Define if there is a function named listmntent that can be used to
97 list all mounted file systems. (UNICOS)]) 96 list all mounted file systems. (UNICOS)])
98 fi 97 fi
@@ -101,14 +100,14 @@ fi
101if test -z "$ac_list_mounted_fs"; then 100if test -z "$ac_list_mounted_fs"; then
102 # AIX. 101 # AIX.
103 AC_MSG_CHECKING([for mntctl function and struct vmount]) 102 AC_MSG_CHECKING([for mntctl function and struct vmount])
104 AC_CACHE_VAL(fu_cv_sys_mounted_vmount, 103 AC_CACHE_VAL([fu_cv_sys_mounted_vmount],
105 [AC_TRY_CPP([#include <fshelp.h>], 104 [AC_TRY_CPP([#include <fshelp.h>],
106 fu_cv_sys_mounted_vmount=yes, 105 fu_cv_sys_mounted_vmount=yes,
107 fu_cv_sys_mounted_vmount=no)]) 106 fu_cv_sys_mounted_vmount=no)])
108 AC_MSG_RESULT($fu_cv_sys_mounted_vmount) 107 AC_MSG_RESULT([$fu_cv_sys_mounted_vmount])
109 if test $fu_cv_sys_mounted_vmount = yes; then 108 if test $fu_cv_sys_mounted_vmount = yes; then
110 ac_list_mounted_fs=found 109 ac_list_mounted_fs=found
111 AC_DEFINE(MOUNTED_VMOUNT, 1, 110 AC_DEFINE([MOUNTED_VMOUNT], [1],
112 [Define if there is a function named mntctl that can be used to read 111 [Define if there is a function named mntctl that can be used to read
113 the list of mounted file systems, and there is a system header file 112 the list of mounted file systems, and there is a system header file
114 that declares `struct vmount.' (AIX)]) 113 that declares `struct vmount.' (AIX)])
@@ -123,7 +122,7 @@ if test $ac_cv_func_getmntent = yes; then
123 if test -z "$ac_list_mounted_fs"; then 122 if test -z "$ac_list_mounted_fs"; then
124 # 4.3BSD, SunOS, HP-UX, Dynix, Irix 123 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
125 AC_MSG_CHECKING([for one-argument getmntent function]) 124 AC_MSG_CHECKING([for one-argument getmntent function])
126 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1, 125 AC_CACHE_VAL([fu_cv_sys_mounted_getmntent1],
127 [AC_TRY_COMPILE([ 126 [AC_TRY_COMPILE([
128/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */ 127/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
129#include <stdio.h> 128#include <stdio.h>
@@ -145,10 +144,10 @@ if test $ac_cv_func_getmntent = yes; then
145 if (sizeof mnt && sizeof table) return 0;], 144 if (sizeof mnt && sizeof table) return 0;],
146 fu_cv_sys_mounted_getmntent1=yes, 145 fu_cv_sys_mounted_getmntent1=yes,
147 fu_cv_sys_mounted_getmntent1=no)]) 146 fu_cv_sys_mounted_getmntent1=no)])
148 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1) 147 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent1])
149 if test $fu_cv_sys_mounted_getmntent1 = yes; then 148 if test $fu_cv_sys_mounted_getmntent1 = yes; then
150 ac_list_mounted_fs=found 149 ac_list_mounted_fs=found
151 AC_DEFINE(MOUNTED_GETMNTENT1, 1, 150 AC_DEFINE([MOUNTED_GETMNTENT1], [1],
152 [Define if there is a function named getmntent for reading the list 151 [Define if there is a function named getmntent for reading the list
153 of mounted file systems, and that function takes a single argument. 152 of mounted file systems, and that function takes a single argument.
154 (4.3BSD, SunOS, HP-UX, Dynix, Irix)]) 153 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
@@ -158,17 +157,17 @@ if test $ac_cv_func_getmntent = yes; then
158 if test -z "$ac_list_mounted_fs"; then 157 if test -z "$ac_list_mounted_fs"; then
159 # SVR4 158 # SVR4
160 AC_MSG_CHECKING([for two-argument getmntent function]) 159 AC_MSG_CHECKING([for two-argument getmntent function])
161 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2, 160 AC_CACHE_VAL([fu_cv_sys_mounted_getmntent2],
162 [AC_EGREP_HEADER(getmntent, sys/mnttab.h, 161 [AC_EGREP_HEADER([getmntent], [sys/mnttab.h],
163 fu_cv_sys_mounted_getmntent2=yes, 162 fu_cv_sys_mounted_getmntent2=yes,
164 fu_cv_sys_mounted_getmntent2=no)]) 163 fu_cv_sys_mounted_getmntent2=no)])
165 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2) 164 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntent2])
166 if test $fu_cv_sys_mounted_getmntent2 = yes; then 165 if test $fu_cv_sys_mounted_getmntent2 = yes; then
167 ac_list_mounted_fs=found 166 ac_list_mounted_fs=found
168 AC_DEFINE(MOUNTED_GETMNTENT2, 1, 167 AC_DEFINE([MOUNTED_GETMNTENT2], [1],
169 [Define if there is a function named getmntent for reading the list of 168 [Define if there is a function named getmntent for reading the list of
170 mounted file systems, and that function takes two arguments. (SVR4)]) 169 mounted file systems, and that function takes two arguments. (SVR4)])
171 AC_CHECK_FUNCS(hasmntopt) 170 AC_CHECK_FUNCS([hasmntopt])
172 fi 171 fi
173 fi 172 fi
174 173
@@ -179,7 +178,7 @@ if test -z "$ac_list_mounted_fs"; then
179 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h 178 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
180 179
181 AC_MSG_CHECKING([for getfsstat function]) 180 AC_MSG_CHECKING([for getfsstat function])
182 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat, 181 AC_CACHE_VAL([fu_cv_sys_mounted_getfsstat],
183 [AC_TRY_LINK([ 182 [AC_TRY_LINK([
184#include <sys/types.h> 183#include <sys/types.h>
185#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME 184#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
@@ -194,10 +193,10 @@ if test -z "$ac_list_mounted_fs"; then
194 char *t = FS_TYPE (*stats); ], 193 char *t = FS_TYPE (*stats); ],
195 fu_cv_sys_mounted_getfsstat=yes, 194 fu_cv_sys_mounted_getfsstat=yes,
196 fu_cv_sys_mounted_getfsstat=no)]) 195 fu_cv_sys_mounted_getfsstat=no)])
197 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat) 196 AC_MSG_RESULT([$fu_cv_sys_mounted_getfsstat])
198 if test $fu_cv_sys_mounted_getfsstat = yes; then 197 if test $fu_cv_sys_mounted_getfsstat = yes; then
199 ac_list_mounted_fs=found 198 ac_list_mounted_fs=found
200 AC_DEFINE(MOUNTED_GETFSSTAT, 1, 199 AC_DEFINE([MOUNTED_GETFSSTAT], [1],
201 [Define if there is a function named getfsstat for reading the 200 [Define if there is a function named getfsstat for reading the
202 list of mounted file systems. (DEC Alpha running OSF/1)]) 201 list of mounted file systems. (DEC Alpha running OSF/1)])
203 fi 202 fi
@@ -206,17 +205,17 @@ fi
206if test -z "$ac_list_mounted_fs"; then 205if test -z "$ac_list_mounted_fs"; then
207 # SVR3 206 # SVR3
208 AC_MSG_CHECKING([for FIXME existence of three headers]) 207 AC_MSG_CHECKING([for FIXME existence of three headers])
209 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp, 208 AC_CACHE_VAL([fu_cv_sys_mounted_fread_fstyp],
210 [AC_TRY_CPP([ 209 [AC_TRY_CPP([
211#include <sys/statfs.h> 210#include <sys/statfs.h>
212#include <sys/fstyp.h> 211#include <sys/fstyp.h>
213#include <mnttab.h>], 212#include <mnttab.h>],
214 fu_cv_sys_mounted_fread_fstyp=yes, 213 fu_cv_sys_mounted_fread_fstyp=yes,
215 fu_cv_sys_mounted_fread_fstyp=no)]) 214 fu_cv_sys_mounted_fread_fstyp=no)])
216 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp) 215 AC_MSG_RESULT([$fu_cv_sys_mounted_fread_fstyp])
217 if test $fu_cv_sys_mounted_fread_fstyp = yes; then 216 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
218 ac_list_mounted_fs=found 217 ac_list_mounted_fs=found
219 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1, 218 AC_DEFINE([MOUNTED_FREAD_FSTYP], [1],
220 [Define if (like SVR2) there is no specific function for reading the 219 [Define if (like SVR2) there is no specific function for reading the
221 list of mounted file systems, and your system has these header files: 220 list of mounted file systems, and your system has these header files:
222 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)]) 221 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
@@ -226,16 +225,16 @@ fi
226if test -z "$ac_list_mounted_fs"; then 225if test -z "$ac_list_mounted_fs"; then
227 # 4.4BSD and DEC OSF/1. 226 # 4.4BSD and DEC OSF/1.
228 AC_MSG_CHECKING([for getmntinfo function]) 227 AC_MSG_CHECKING([for getmntinfo function])
229 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo, 228 AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo],
230 [ 229 [
231 test "$ac_cv_func_getmntinfo" = yes \ 230 test "$ac_cv_func_getmntinfo" = yes \
232 && fu_cv_sys_mounted_getmntinfo=yes \ 231 && fu_cv_sys_mounted_getmntinfo=yes \
233 || fu_cv_sys_mounted_getmntinfo=no 232 || fu_cv_sys_mounted_getmntinfo=no
234 ]) 233 ])
235 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo) 234 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo])
236 if test $fu_cv_sys_mounted_getmntinfo = yes; then 235 if test $fu_cv_sys_mounted_getmntinfo = yes; then
237 AC_MSG_CHECKING([whether getmntinfo returns statvfs structures]) 236 AC_MSG_CHECKING([whether getmntinfo returns statvfs structures])
238 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo2, 237 AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo2],
239 [ 238 [
240 AC_TRY_COMPILE([ 239 AC_TRY_COMPILE([
241#if HAVE_SYS_PARAM_H 240#if HAVE_SYS_PARAM_H
@@ -256,13 +255,13 @@ extern int getmntinfo (struct statfs **, int);
256 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2]) 255 AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2])
257 if test $fu_cv_sys_mounted_getmntinfo2 = no; then 256 if test $fu_cv_sys_mounted_getmntinfo2 = no; then
258 ac_list_mounted_fs=found 257 ac_list_mounted_fs=found
259 AC_DEFINE(MOUNTED_GETMNTINFO, 1, 258 AC_DEFINE([MOUNTED_GETMNTINFO], [1],
260 [Define if there is a function named getmntinfo for reading the 259 [Define if there is a function named getmntinfo for reading the
261 list of mounted file systems and it returns an array of 260 list of mounted file systems and it returns an array of
262 'struct statfs'. (4.4BSD, Darwin)]) 261 'struct statfs'. (4.4BSD, Darwin)])
263 else 262 else
264 ac_list_mounted_fs=found 263 ac_list_mounted_fs=found
265 AC_DEFINE(MOUNTED_GETMNTINFO2, 1, 264 AC_DEFINE([MOUNTED_GETMNTINFO2], [1],
266 [Define if there is a function named getmntinfo for reading the 265 [Define if there is a function named getmntinfo for reading the
267 list of mounted file systems and it returns an array of 266 list of mounted file systems and it returns an array of
268 'struct statvfs'. (NetBSD 3.0)]) 267 'struct statvfs'. (NetBSD 3.0)])
@@ -273,16 +272,16 @@ fi
273if test -z "$ac_list_mounted_fs"; then 272if test -z "$ac_list_mounted_fs"; then
274 # Ultrix 273 # Ultrix
275 AC_MSG_CHECKING([for getmnt function]) 274 AC_MSG_CHECKING([for getmnt function])
276 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt, 275 AC_CACHE_VAL([fu_cv_sys_mounted_getmnt],
277 [AC_TRY_CPP([ 276 [AC_TRY_CPP([
278#include <sys/fs_types.h> 277#include <sys/fs_types.h>
279#include <sys/mount.h>], 278#include <sys/mount.h>],
280 fu_cv_sys_mounted_getmnt=yes, 279 fu_cv_sys_mounted_getmnt=yes,
281 fu_cv_sys_mounted_getmnt=no)]) 280 fu_cv_sys_mounted_getmnt=no)])
282 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt) 281 AC_MSG_RESULT([$fu_cv_sys_mounted_getmnt])
283 if test $fu_cv_sys_mounted_getmnt = yes; then 282 if test $fu_cv_sys_mounted_getmnt = yes; then
284 ac_list_mounted_fs=found 283 ac_list_mounted_fs=found
285 AC_DEFINE(MOUNTED_GETMNT, 1, 284 AC_DEFINE([MOUNTED_GETMNT], [1],
286 [Define if there is a function named getmnt for reading the list of 285 [Define if there is a function named getmnt for reading the list of
287 mounted file systems. (Ultrix)]) 286 mounted file systems. (Ultrix)])
288 fi 287 fi
@@ -290,8 +289,8 @@ fi
290 289
291if test -z "$ac_list_mounted_fs"; then 290if test -z "$ac_list_mounted_fs"; then
292 # BeOS 291 # BeOS
293 AC_CHECK_FUNCS(next_dev fs_stat_dev) 292 AC_CHECK_FUNCS([next_dev fs_stat_dev])
294 AC_CHECK_HEADERS(fs_info.h) 293 AC_CHECK_HEADERS([fs_info.h])
295 AC_MSG_CHECKING([for BEOS mounted file system support functions]) 294 AC_MSG_CHECKING([for BEOS mounted file system support functions])
296 if test $ac_cv_header_fs_info_h = yes \ 295 if test $ac_cv_header_fs_info_h = yes \
297 && test $ac_cv_func_next_dev = yes \ 296 && test $ac_cv_func_next_dev = yes \
@@ -300,10 +299,10 @@ if test -z "$ac_list_mounted_fs"; then
300 else 299 else
301 fu_result=no 300 fu_result=no
302 fi 301 fi
303 AC_MSG_RESULT($fu_result) 302 AC_MSG_RESULT([$fu_result])
304 if test $fu_result = yes; then 303 if test $fu_result = yes; then
305 ac_list_mounted_fs=found 304 ac_list_mounted_fs=found
306 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1, 305 AC_DEFINE([MOUNTED_FS_STAT_DEV], [1],
307 [Define if there are functions named next_dev and fs_stat_dev for 306 [Define if there are functions named next_dev and fs_stat_dev for
308 reading the list of mounted file systems. (BeOS)]) 307 reading the list of mounted file systems. (BeOS)])
309 fi 308 fi
@@ -312,14 +311,14 @@ fi
312if test -z "$ac_list_mounted_fs"; then 311if test -z "$ac_list_mounted_fs"; then
313 # SVR2 312 # SVR2
314 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab]) 313 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
315 AC_CACHE_VAL(fu_cv_sys_mounted_fread, 314 AC_CACHE_VAL([fu_cv_sys_mounted_fread],
316 [AC_TRY_CPP([#include <mnttab.h>], 315 [AC_TRY_CPP([#include <mnttab.h>],
317 fu_cv_sys_mounted_fread=yes, 316 fu_cv_sys_mounted_fread=yes,
318 fu_cv_sys_mounted_fread=no)]) 317 fu_cv_sys_mounted_fread=no)])
319 AC_MSG_RESULT($fu_cv_sys_mounted_fread) 318 AC_MSG_RESULT([$fu_cv_sys_mounted_fread])
320 if test $fu_cv_sys_mounted_fread = yes; then 319 if test $fu_cv_sys_mounted_fread = yes; then
321 ac_list_mounted_fs=found 320 ac_list_mounted_fs=found
322 AC_DEFINE(MOUNTED_FREAD, 1, 321 AC_DEFINE([MOUNTED_FREAD], [1],
323 [Define if there is no specific function for reading the list of 322 [Define if there is no specific function for reading the list of
324 mounted file systems. fread will be used to read /etc/mnttab. 323 mounted file systems. fread will be used to read /etc/mnttab.
325 (SVR2) ]) 324 (SVR2) ])
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 764f2a9..8070171 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,5 @@
1# malloc.m4 serial 8 1# malloc.m4 serial 9
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.
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
13 AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) 13 AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
14 if test $gl_cv_func_malloc_posix = yes; then 14 if test $gl_cv_func_malloc_posix = yes; then
15 HAVE_MALLOC_POSIX=1 15 HAVE_MALLOC_POSIX=1
16 AC_DEFINE([HAVE_MALLOC_POSIX], 1, 16 AC_DEFINE([HAVE_MALLOC_POSIX], [1],
17 [Define if the 'malloc' function is POSIX compliant.]) 17 [Define if the 'malloc' function is POSIX compliant.])
18 else 18 else
19 AC_LIBOBJ([malloc]) 19 AC_LIBOBJ([malloc])
diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4
index dd99e7f..d941bc3 100644
--- a/gl/m4/math_h.m4
+++ b/gl/m4/math_h.m4
@@ -1,4 +1,4 @@
1# math_h.m4 serial 9 1# math_h.m4 serial 14
2dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2008 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,31 @@ AC_DEFUN([gl_MATH_H],
8[ 8[
9 AC_REQUIRE([gl_MATH_H_DEFAULTS]) 9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 gl_CHECK_NEXT_HEADERS([math.h]) 10 gl_CHECK_NEXT_HEADERS([math.h])
11 AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
12 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
13 [[/* Solaris 10 has a broken definition of NAN. Other platforms
14 fail to provide NAN, or provide it only in C99 mode; this
15 test only needs to fail when NAN is provided but wrong. */
16 float f = 1.0f;
17#ifdef NAN
18 f = NAN;
19#endif
20 return f == 0;]])],
21 [gl_cv_header_math_nan_works=yes],
22 [gl_cv_header_math_nan_works=no])])
23 if test $gl_cv_header_math_nan_works = no; then
24 REPLACE_NAN=1
25 fi
26 AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
27 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
28 [[/* Solaris 10 has a broken definition of HUGE_VAL. */
29 double d = HUGE_VAL;
30 return d == 0;]])],
31 [gl_cv_header_math_huge_val_works=yes],
32 [gl_cv_header_math_huge_val_works=no])])
33 if test $gl_cv_header_math_huge_val_works = no; then
34 REPLACE_HUGE_VAL=1
35 fi
11]) 36])
12 37
13AC_DEFUN([gl_MATH_MODULE_INDICATOR], 38AC_DEFUN([gl_MATH_MODULE_INDICATOR],
@@ -26,6 +51,11 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
26 GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) 51 GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
27 GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) 52 GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
28 GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) 53 GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
54 GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF])
55 GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
56 GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
57 GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
58 GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
29 GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) 59 GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
30 GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL]) 60 GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL])
31 GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) 61 GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
@@ -36,6 +66,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
36 GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) 66 GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
37 GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) 67 GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
38 dnl Assume proper GNU behavior unless another module says otherwise. 68 dnl Assume proper GNU behavior unless another module says otherwise.
69 HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
70 HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
71 HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
39 HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) 72 HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
40 HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) 73 HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
41 HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) 74 HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
@@ -49,18 +82,22 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
49 HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) 82 HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
50 HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) 83 HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
51 HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) 84 HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
52 HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
53 REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) 85 REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
54 REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) 86 REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
55 REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) 87 REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
56 REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) 88 REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
57 REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) 89 REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
58 REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) 90 REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
91 REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
59 REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) 92 REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
93 REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
94 REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
60 REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) 95 REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
96 REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
61 REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) 97 REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
62 REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) 98 REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
63 REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) 99 REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
64 REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) 100 REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
65 REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) 101 REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
102 REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
66]) 103])
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
new file mode 100644
index 0000000..726497b
--- /dev/null
+++ b/gl/m4/mbrtowc.m4
@@ -0,0 +1,325 @@
1# mbrtowc.m4 serial 13
2dnl Copyright (C) 2001-2002, 2004-2005, 2008, 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
7AC_DEFUN([gl_FUNC_MBRTOWC],
8[
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10
11 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 gl_MBSTATE_T_BROKEN
13 if test $REPLACE_MBSTATE_T = 1; then
14 REPLACE_MBRTOWC=1
15 fi
16 AC_CHECK_FUNCS_ONCE([mbrtowc])
17 if test $ac_cv_func_mbrtowc = no; then
18 HAVE_MBRTOWC=0
19 fi
20 if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then
21 gl_MBRTOWC_NULL_ARG
22 gl_MBRTOWC_RETVAL
23 gl_MBRTOWC_NUL_RETVAL
24 case "$gl_cv_func_mbrtowc_null_arg" in
25 *yes) ;;
26 *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
27 [Define if the mbrtowc function has the NULL string argument bug.])
28 REPLACE_MBRTOWC=1
29 ;;
30 esac
31 case "$gl_cv_func_mbrtowc_retval" in
32 *yes) ;;
33 *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
34 [Define if the mbrtowc function returns a wrong return value.])
35 REPLACE_MBRTOWC=1
36 ;;
37 esac
38 case "$gl_cv_func_mbrtowc_nul_retval" in
39 *yes) ;;
40 *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
41 [Define if the mbrtowc function does not return 0 for a NUL character.])
42 REPLACE_MBRTOWC=1
43 ;;
44 esac
45 fi
46 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
47 gl_REPLACE_WCHAR_H
48 AC_LIBOBJ([mbrtowc])
49 gl_PREREQ_MBRTOWC
50 fi
51])
52
53dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
54dnl redefines the semantics of the given mbstate_t type.
55dnl Result is REPLACE_MBSTATE_T.
56dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
57dnl avoid inconsistencies.
58
59AC_DEFUN([gl_MBSTATE_T_BROKEN],
60[
61 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
62
63 AC_REQUIRE([AC_TYPE_MBSTATE_T])
64 AC_CHECK_FUNCS_ONCE([mbsinit])
65 AC_CHECK_FUNCS_ONCE([mbrtowc])
66 if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
67 gl_MBRTOWC_INCOMPLETE_STATE
68 case "$gl_cv_func_mbrtowc_incomplete_state" in
69 *yes) REPLACE_MBSTATE_T=0 ;;
70 *) REPLACE_MBSTATE_T=1 ;;
71 esac
72 else
73 REPLACE_MBSTATE_T=1
74 fi
75 if test $REPLACE_MBSTATE_T = 1; then
76 gl_REPLACE_WCHAR_H
77 fi
78])
79
80dnl Test whether mbrtowc puts the state into non-initial state when parsing an
81dnl incomplete multibyte character.
82dnl Result is gl_cv_func_mbrtowc_incomplete_state.
83
84AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
85[
86 AC_REQUIRE([AC_PROG_CC])
87 AC_REQUIRE([gt_LOCALE_JA])
88 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
89 AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
90 [gl_cv_func_mbrtowc_incomplete_state],
91 [
92 dnl Initial guess, used when cross-compiling or when no suitable locale
93 dnl is present.
94changequote(,)dnl
95 case "$host_os" in
96 # Guess no on AIX and OSF/1.
97 osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
98 # Guess yes otherwise.
99 *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
100 esac
101changequote([,])dnl
102 if test $LOCALE_JA != none; then
103 AC_TRY_RUN([
104#include <locale.h>
105#include <string.h>
106#include <wchar.h>
107int main ()
108{
109 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
110 {
111 const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
112 mbstate_t state;
113 wchar_t wc;
114
115 memset (&state, '\0', sizeof (mbstate_t));
116 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
117 if (mbsinit (&state))
118 return 1;
119 }
120 return 0;
121}],
122 [gl_cv_func_mbrtowc_incomplete_state=yes],
123 [gl_cv_func_mbrtowc_incomplete_state=no],
124 [])
125 fi
126 ])
127])
128
129dnl Test whether mbrtowc supports a NULL string argument correctly.
130dnl Result is gl_cv_func_mbrtowc_null_arg.
131
132AC_DEFUN([gl_MBRTOWC_NULL_ARG],
133[
134 AC_REQUIRE([AC_PROG_CC])
135 AC_REQUIRE([gt_LOCALE_FR_UTF8])
136 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
137 AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
138 [gl_cv_func_mbrtowc_null_arg],
139 [
140 dnl Initial guess, used when cross-compiling or when no suitable locale
141 dnl is present.
142changequote(,)dnl
143 case "$host_os" in
144 # Guess no on OSF/1.
145 osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
146 # Guess yes otherwise.
147 *) gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
148 esac
149changequote([,])dnl
150 if test $LOCALE_FR_UTF8 != none; then
151 AC_TRY_RUN([
152#include <locale.h>
153#include <string.h>
154#include <wchar.h>
155int main ()
156{
157 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
158 {
159 mbstate_t state;
160 wchar_t wc;
161 int ret;
162
163 memset (&state, '\0', sizeof (mbstate_t));
164 wc = (wchar_t) 0xBADFACE;
165 mbrtowc (&wc, NULL, 5, &state);
166 /* Check that wc was not modified. */
167 if (wc != (wchar_t) 0xBADFACE)
168 return 1;
169 }
170 return 0;
171}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [])
172 fi
173 ])
174])
175
176dnl Test whether mbrtowc, when parsing the end of a multibyte character,
177dnl correctly returns the number of bytes that were needed to complete the
178dnl character (not the total number of bytes of the multibyte character).
179dnl Result is gl_cv_func_mbrtowc_retval.
180
181AC_DEFUN([gl_MBRTOWC_RETVAL],
182[
183 AC_REQUIRE([AC_PROG_CC])
184 AC_REQUIRE([gt_LOCALE_FR_UTF8])
185 AC_REQUIRE([gt_LOCALE_JA])
186 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
187 AC_CACHE_CHECK([whether mbrtowc has a correct return value],
188 [gl_cv_func_mbrtowc_retval],
189 [
190 dnl Initial guess, used when cross-compiling or when no suitable locale
191 dnl is present.
192changequote(,)dnl
193 case "$host_os" in
194 # Guess no on HP-UX and Solaris.
195 hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
196 # Guess yes otherwise.
197 *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
198 esac
199changequote([,])dnl
200 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
201 AC_TRY_RUN([
202#include <locale.h>
203#include <string.h>
204#include <wchar.h>
205int main ()
206{
207 /* This fails on Solaris. */
208 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
209 {
210 char input[] = "B\303\274\303\237er"; /* "Büßer" */
211 mbstate_t state;
212 wchar_t wc;
213
214 memset (&state, '\0', sizeof (mbstate_t));
215 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
216 {
217 input[1] = '\0';
218 if (mbrtowc (&wc, input + 2, 5, &state) != 1)
219 return 1;
220 }
221 }
222 /* This fails on HP-UX 11.11. */
223 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
224 {
225 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
226 mbstate_t state;
227 wchar_t wc;
228
229 memset (&state, '\0', sizeof (mbstate_t));
230 if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
231 {
232 input[1] = '\0';
233 if (mbrtowc (&wc, input + 2, 5, &state) != 2)
234 return 1;
235 }
236 }
237 return 0;
238}],
239 [gl_cv_func_mbrtowc_retval=yes],
240 [gl_cv_func_mbrtowc_retval=no],
241 [])
242 fi
243 ])
244])
245
246dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0.
247dnl Result is gl_cv_func_mbrtowc_nul_retval.
248
249AC_DEFUN([gl_MBRTOWC_NUL_RETVAL],
250[
251 AC_REQUIRE([AC_PROG_CC])
252 AC_REQUIRE([gt_LOCALE_ZH_CN])
253 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
254 AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character],
255 [gl_cv_func_mbrtowc_nul_retval],
256 [
257 dnl Initial guess, used when cross-compiling or when no suitable locale
258 dnl is present.
259changequote(,)dnl
260 case "$host_os" in
261 # Guess no on Solaris 9.
262 solaris2.9) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
263 # Guess yes otherwise.
264 *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
265 esac
266changequote([,])dnl
267 if test $LOCALE_ZH_CN != none; then
268 AC_TRY_RUN([
269#include <locale.h>
270#include <string.h>
271#include <wchar.h>
272int main ()
273{
274 /* This fails on Solaris 9. */
275 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
276 {
277 mbstate_t state;
278 wchar_t wc;
279
280 memset (&state, '\0', sizeof (mbstate_t));
281 if (mbrtowc (&wc, "", 1, &state) != 0)
282 return 1;
283 }
284 return 0;
285}],
286 [gl_cv_func_mbrtowc_nul_retval=yes],
287 [gl_cv_func_mbrtowc_nul_retval=no],
288 [])
289 fi
290 ])
291])
292
293# Prerequisites of lib/mbrtowc.c.
294AC_DEFUN([gl_PREREQ_MBRTOWC], [
295 :
296])
297
298
299dnl From Paul Eggert
300
301dnl This override of an autoconf macro can be removed when autoconf 2.60 or
302dnl newer can be assumed everywhere.
303
304m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[
305AC_DEFUN([AC_FUNC_MBRTOWC],
306[
307 dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
308 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
309 gl_cv_func_mbrtowc,
310 [AC_LINK_IFELSE(
311 [AC_LANG_PROGRAM(
312 [[#include <wchar.h>]],
313 [[wchar_t wc;
314 char const s[] = "";
315 size_t n = 1;
316 mbstate_t state;
317 return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
318 gl_cv_func_mbrtowc=yes,
319 gl_cv_func_mbrtowc=no)])
320 if test $gl_cv_func_mbrtowc = yes; then
321 AC_DEFINE([HAVE_MBRTOWC], [1],
322 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
323 fi
324])
325])
diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
new file mode 100644
index 0000000..03b055c
--- /dev/null
+++ b/gl/m4/mbsinit.m4
@@ -0,0 +1,30 @@
1# mbsinit.m4 serial 3
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_FUNC_MBSINIT],
8[
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10
11 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 gl_MBSTATE_T_BROKEN
13 if test $REPLACE_MBSTATE_T = 1; then
14 REPLACE_MBSINIT=1
15 fi
16 AC_CHECK_FUNCS_ONCE([mbsinit])
17 if test $ac_cv_func_mbsinit = no; then
18 HAVE_MBSINIT=0
19 fi
20 if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
21 gl_REPLACE_WCHAR_H
22 AC_LIBOBJ([mbsinit])
23 gl_PREREQ_MBSINIT
24 fi
25])
26
27# Prerequisites of lib/mbsinit.c.
28AC_DEFUN([gl_PREREQ_MBSINIT], [
29 :
30])
diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
index df2a275..d4ec6f0 100644
--- a/gl/m4/mbstate_t.m4
+++ b/gl/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
1# mbstate_t.m4 serial 9 1# mbstate_t.m4 serial 12
2dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 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.
@@ -13,18 +13,22 @@ dnl with or without modifications, as long as this notice is preserved.
13# AC_TYPE_MBSTATE_T 13# AC_TYPE_MBSTATE_T
14# ----------------- 14# -----------------
15AC_DEFUN([AC_TYPE_MBSTATE_T], 15AC_DEFUN([AC_TYPE_MBSTATE_T],
16 [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, 16[
17 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
18
19 AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
17 [AC_COMPILE_IFELSE( 20 [AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM( 21 [AC_LANG_PROGRAM(
19 [AC_INCLUDES_DEFAULT 22 [AC_INCLUDES_DEFAULT[
20# include <wchar.h>], 23# include <wchar.h>]],
21 [mbstate_t x; return sizeof x;])], 24 [[mbstate_t x; return sizeof x;]])],
22 [ac_cv_type_mbstate_t=yes], 25 [ac_cv_type_mbstate_t=yes],
23 [ac_cv_type_mbstate_t=no])]) 26 [ac_cv_type_mbstate_t=no])])
24 if test $ac_cv_type_mbstate_t = yes; then 27 if test $ac_cv_type_mbstate_t = yes; then
25 AC_DEFINE([HAVE_MBSTATE_T], 1, 28 AC_DEFINE([HAVE_MBSTATE_T], [1],
26 [Define to 1 if <wchar.h> declares mbstate_t.]) 29 [Define to 1 if <wchar.h> declares mbstate_t.])
27 else 30 else
28 AC_DEFINE([mbstate_t], int, 31 AC_DEFINE([mbstate_t], [int],
29 [Define to a type if <wchar.h> does not define.]) 32 [Define to a type if <wchar.h> does not define.])
30 fi]) 33 fi
34])
diff --git a/gl/m4/mountlist.m4 b/gl/m4/mountlist.m4
index c25f44e..f62c57a 100644
--- a/gl/m4/mountlist.m4
+++ b/gl/m4/mountlist.m4
@@ -1,5 +1,5 @@
1#serial 9 1# serial 10
2dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-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.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_MOUNTLIST],
9 gl_LIST_MOUNTED_FILE_SYSTEMS([gl_cv_list_mounted_fs=yes], 9 gl_LIST_MOUNTED_FILE_SYSTEMS([gl_cv_list_mounted_fs=yes],
10 [gl_cv_list_mounted_fs=no]) 10 [gl_cv_list_mounted_fs=no])
11 if test $gl_cv_list_mounted_fs = yes; then 11 if test $gl_cv_list_mounted_fs = yes; then
12 AC_LIBOBJ(mountlist) 12 AC_LIBOBJ([mountlist])
13 gl_PREREQ_MOUNTLIST_EXTRA 13 gl_PREREQ_MOUNTLIST_EXTRA
14 fi 14 fi
15]) 15])
@@ -18,6 +18,6 @@ AC_DEFUN([gl_MOUNTLIST],
18AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA], 18AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
19[ 19[
20 dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h. 20 dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h.
21 AC_CHECK_HEADERS(sys/mntent.h) 21 AC_CHECK_HEADERS([sys/mntent.h])
22 gl_FSTYPENAME 22 gl_FSTYPENAME
23]) 23])
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
new file mode 100644
index 0000000..7b73e15
--- /dev/null
+++ b/gl/m4/multiarch.m4
@@ -0,0 +1,74 @@
1# multiarch.m4 serial 3
2dnl Copyright (C) 2008 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
7# Determine whether the compiler is or may be producing universal binaries.
8#
9# On MacOS X 10.5 and later systems, the user can create libraries and
10# executables that work on multiple system types--known as "fat" or
11# "universal" binaries--by specifying multiple '-arch' options to the
12# compiler but only a single '-arch' option to the preprocessor. Like
13# this:
14#
15# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
16# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
17# CPP="gcc -E" CXXCPP="g++ -E"
18#
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.
21
22AC_DEFUN([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[
33 dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
34 gl_cv_c_multiarch=no
35 AC_COMPILE_IFELSE(
36 [AC_LANG_SOURCE(
37 [[#ifndef __APPLE_CC__
38 not a universal capable compiler
39 #endif
40 typedef int dummy;
41 ]])],
42 [
43 dnl Check for potential -arch flags. It is not universal unless
44 dnl there are at least two -arch flags with different values.
45 arch=
46 prev=
47 for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
48 if test -n "$prev"; then
49 case $word in
50 i?86 | x86_64 | ppc | ppc64)
51 if test -z "$arch" || test "$arch" = "$word"; then
52 arch="$word"
53 else
54 gl_cv_c_multiarch=yes
55 fi
56 ;;
57 esac
58 prev=
59 else
60 if test "x$word" = "x-arch"; then
61 prev=arch
62 fi
63 fi
64 done
65 ])
66 if test $gl_cv_c_multiarch = yes; then
67 AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
68 [Define if the compiler is building for multiple architectures of Apple platforms at once.])
69 APPLE_UNIVERSAL_BUILD=1
70 else
71 APPLE_UNIVERSAL_BUILD=0
72 fi
73 AC_SUBST([APPLE_UNIVERSAL_BUILD])
74])
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
new file mode 100644
index 0000000..5a12251
--- /dev/null
+++ b/gl/m4/netdb_h.m4
@@ -0,0 +1,45 @@
1# netdb_h.m4 serial 5
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_HEADER_NETDB],
8[
9 AC_REQUIRE([gl_NETDB_H_DEFAULTS])
10 gl_CHECK_NEXT_HEADERS([netdb.h])
11 if test $ac_cv_header_netdb_h = yes; then
12 AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM([[
14 #include <netdb.h>
15 struct addrinfo a;
16 int b = EAI_OVERFLOW;
17 int c = AI_NUMERICSERV;
18 ]])],
19 [NETDB_H=''], [NETDB_H='netdb.h'])
20 HAVE_NETDB_H=1
21 else
22 NETDB_H='netdb.h'
23 HAVE_NETDB_H=0
24 fi
25 AC_SUBST([HAVE_NETDB_H])
26 AC_SUBST([NETDB_H])
27])
28
29AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
30[
31 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
32 AC_REQUIRE([gl_NETDB_H_DEFAULTS])
33 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
34])
35
36AC_DEFUN([gl_NETDB_H_DEFAULTS],
37[
38 GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO])
39 dnl Assume proper GNU behavior unless another module says otherwise.
40 HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO])
41 HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO])
42 HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
43 HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
44 HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
45])
diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4
index 096be74..47fd9cc 100644
--- a/gl/m4/netinet_in_h.m4
+++ b/gl/m4/netinet_in_h.m4
@@ -1,5 +1,5 @@
1# netinet_in_h.m4 serial 3 1# netinet_in_h.m4 serial 4
2dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2008 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,7 +9,7 @@ AC_DEFUN([gl_HEADER_NETINET_IN],
9 AC_CACHE_CHECK([whether <netinet/in.h> is self-contained], 9 AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
10 [gl_cv_header_netinet_in_h_selfcontained], 10 [gl_cv_header_netinet_in_h_selfcontained],
11 [ 11 [
12 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netinet/in.h>], [])], 12 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
13 [gl_cv_header_netinet_in_h_selfcontained=yes], 13 [gl_cv_header_netinet_in_h_selfcontained=yes],
14 [gl_cv_header_netinet_in_h_selfcontained=no]) 14 [gl_cv_header_netinet_in_h_selfcontained=no])
15 ]) 15 ])
diff --git a/gl/m4/nls.m4 b/gl/m4/nls.m4
index 7967cc2..0b36434 100644
--- a/gl/m4/nls.m4
+++ b/gl/m4/nls.m4
@@ -1,5 +1,5 @@
1# nls.m4 serial 3 (gettext-0.15) 1# nls.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-2003, 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -17,15 +17,15 @@ dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. 17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. 18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
19 19
20AC_PREREQ(2.50) 20AC_PREREQ([2.50])
21 21
22AC_DEFUN([AM_NLS], 22AC_DEFUN([AM_NLS],
23[ 23[
24 AC_MSG_CHECKING([whether NLS is requested]) 24 AC_MSG_CHECKING([whether NLS is requested])
25 dnl Default is enabled NLS 25 dnl Default is enabled NLS
26 AC_ARG_ENABLE(nls, 26 AC_ARG_ENABLE([nls],
27 [ --disable-nls do not use Native Language Support], 27 [ --disable-nls do not use Native Language Support],
28 USE_NLS=$enableval, USE_NLS=yes) 28 USE_NLS=$enableval, USE_NLS=yes)
29 AC_MSG_RESULT($USE_NLS) 29 AC_MSG_RESULT([$USE_NLS])
30 AC_SUBST(USE_NLS) 30 AC_SUBST([USE_NLS])
31]) 31])
diff --git a/gl/m4/onceonly_2_57.m4 b/gl/m4/onceonly.m4
index 15884b3..108cd6c 100644
--- a/gl/m4/onceonly_2_57.m4
+++ b/gl/m4/onceonly.m4
@@ -1,5 +1,5 @@
1# onceonly_2_57.m4 serial 4 1# onceonly.m4 serial 6
2dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU 3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General 4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program 5dnl Public License, this file may be distributed as part of a program
@@ -21,19 +21,23 @@ dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
21dnl empty, and the check will be inserted before the body of the AC_DEFUNed 21dnl empty, and the check will be inserted before the body of the AC_DEFUNed
22dnl function. 22dnl function.
23 23
24dnl This is like onceonly.m4, except that it uses diversions to named sections 24dnl The original code implemented AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE
25dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, 25dnl in terms of AC_DEFUN and AC_REQUIRE. This implementation uses diversions to
26dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The 26dnl named sections DEFAULTS and INIT_PREPARE in order to check all requested
27dnl size reduction is ca. 9%. 27dnl headers at once, thus reducing the size of 'configure'. It is known to work
28dnl with autoconf 2.57..2.62 at least . The size reduction is ca. 9%.
28 29
29dnl Autoconf version 2.57 or newer is recommended. 30dnl Autoconf version 2.59 plus gnulib is required; this file is not needed
30AC_PREREQ(2.57) 31dnl with Autoconf 2.60 or greater. But note that autoconf's implementation of
32dnl AC_CHECK_DECLS_ONCE expects a comma-separated list of symbols as first
33dnl argument!
34AC_PREREQ([2.59])
31 35
32# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of 36# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
33# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). 37# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
34AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ 38AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
35 : 39 :
36 AC_FOREACH([gl_HEADER_NAME], [$1], [ 40 m4_foreach_w([gl_HEADER_NAME], [$1], [
37 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, 41 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
38 [./-], [___])), [ 42 [./-], [___])), [
39 m4_divert_text([INIT_PREPARE], 43 m4_divert_text([INIT_PREPARE],
@@ -56,7 +60,7 @@ m4_define([gl_HEADERS_EXPANSION], [
56# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). 60# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
57AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ 61AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
58 : 62 :
59 AC_FOREACH([gl_FUNC_NAME], [$1], [ 63 m4_foreach_w([gl_FUNC_NAME], [$1], [
60 AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ 64 AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
61 m4_divert_text([INIT_PREPARE], 65 m4_divert_text([INIT_PREPARE],
62 [gl_func_list="$gl_func_list gl_FUNC_NAME"]) 66 [gl_func_list="$gl_func_list gl_FUNC_NAME"])
@@ -77,7 +81,7 @@ m4_define([gl_FUNCS_EXPANSION], [
77# AC_CHECK_DECLS(DECL1, DECL2, ...). 81# AC_CHECK_DECLS(DECL1, DECL2, ...).
78AC_DEFUN([AC_CHECK_DECLS_ONCE], [ 82AC_DEFUN([AC_CHECK_DECLS_ONCE], [
79 : 83 :
80 AC_FOREACH([gl_DECL_NAME], [$1], [ 84 m4_foreach_w([gl_DECL_NAME], [$1], [
81 AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ 85 AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
82 AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) 86 AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
83 ]) 87 ])
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
new file mode 100644
index 0000000..6e286c9
--- /dev/null
+++ b/gl/m4/open.m4
@@ -0,0 +1,66 @@
1# open.m4 serial 5
2dnl Copyright (C) 2007-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
7AC_DEFUN([gl_FUNC_OPEN],
8[
9 AC_REQUIRE([AC_CANONICAL_HOST])
10 case "$host_os" in
11 mingw* | pw*)
12 gl_REPLACE_OPEN
13 ;;
14 *)
15 dnl open("foo/") should not create a file when the file name has a
16 dnl trailing slash.
17 AC_CACHE_CHECK([whether open recognizes a trailing slash],
18 [gl_cv_func_open_slash],
19 [
20 AC_TRY_RUN([
21#include <fcntl.h>
22#if HAVE_UNISTD_H
23# include <unistd.h>
24#endif
25int main ()
26{
27 return open ("conftest.sl/", O_CREAT, 0600) >= 0;
28}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no],
29 [
30changequote(,)dnl
31 case "$host_os" in
32 solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;;
33 hpux*) gl_cv_func_open_slash="guessing no" ;;
34 *) gl_cv_func_open_slash="guessing yes" ;;
35 esac
36changequote([,])dnl
37 ])
38 rm -f conftest.sl
39 ])
40 case "$gl_cv_func_open_slash" in
41 *no)
42 AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
43 [Define to 1 if open() fails to recognize a trailing slash.])
44 gl_REPLACE_OPEN
45 ;;
46 esac
47 ;;
48 esac
49])
50
51AC_DEFUN([gl_REPLACE_OPEN],
52[
53 AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
54 if test $REPLACE_OPEN != 1; then
55 AC_LIBOBJ([open])
56 gl_PREREQ_OPEN
57 fi
58 REPLACE_OPEN=1
59])
60
61# Prerequisites of lib/open.c.
62AC_DEFUN([gl_PREREQ_OPEN],
63[
64 AC_REQUIRE([AC_C_INLINE])
65 :
66])
diff --git a/gl/m4/po.m4 b/gl/m4/po.m4
index 0734762..2284fa5 100644
--- a/gl/m4/po.m4
+++ b/gl/m4/po.m4
@@ -1,5 +1,5 @@
1# po.m4 serial 15 (gettext-0.17) 1# po.m4 serial 17 (gettext-0.18)
2dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-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.
@@ -17,7 +17,7 @@ dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. 17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. 18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
19 19
20AC_PREREQ(2.50) 20AC_PREREQ([2.50])
21 21
22dnl Checks for all prerequisites of the po subdirectory. 22dnl Checks for all prerequisites of the po subdirectory.
23AC_DEFUN([AM_PO_SUBDIRS], 23AC_DEFUN([AM_PO_SUBDIRS],
@@ -41,7 +41,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
41 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && 41 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
42 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], 42 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
43 :) 43 :)
44 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) 44 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
45 45
46 dnl Test whether it is GNU msgfmt >= 0.15. 46 dnl Test whether it is GNU msgfmt >= 0.15.
47changequote(,)dnl 47changequote(,)dnl
diff --git a/gl/m4/printf-posix.m4 b/gl/m4/printf-posix.m4
index 14ba612..5922d27 100644
--- a/gl/m4/printf-posix.m4
+++ b/gl/m4/printf-posix.m4
@@ -1,5 +1,5 @@
1# printf-posix.m4 serial 3 (gettext-0.17) 1# printf-posix.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2003, 2007 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -27,17 +27,18 @@ int main ()
27 return (strcmp (buf, "55 33") != 0); 27 return (strcmp (buf, "55 33") != 0);
28}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 28}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
29 [ 29 [
30 AC_EGREP_CPP(notposix, [ 30 AC_EGREP_CPP([notposix], [
31#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 31#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
32 notposix 32 notposix
33#endif 33#endif
34 ], gt_cv_func_printf_posix="guessing no", 34 ],
35 gt_cv_func_printf_posix="guessing yes") 35 [gt_cv_func_printf_posix="guessing no"],
36 [gt_cv_func_printf_posix="guessing yes"])
36 ]) 37 ])
37 ]) 38 ])
38 case $gt_cv_func_printf_posix in 39 case $gt_cv_func_printf_posix in
39 *yes) 40 *yes)
40 AC_DEFINE(HAVE_POSIX_PRINTF, 1, 41 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
41 [Define if your printf() function supports format strings with positions.]) 42 [Define if your printf() function supports format strings with positions.])
42 ;; 43 ;;
43 esac 44 esac
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
new file mode 100644
index 0000000..4d10993
--- /dev/null
+++ b/gl/m4/printf.m4
@@ -0,0 +1,1322 @@
1# printf.m4 serial 26
2dnl Copyright (C) 2003, 2007-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 Test whether the *printf family of functions supports the 'j', 'z', 't',
8dnl 'L' size specifiers. (ISO C99, POSIX:2001)
9dnl Result is gl_cv_func_printf_sizes_c99.
10
11AC_DEFUN([gl_PRINTF_SIZES_C99],
12[
13 AC_REQUIRE([AC_PROG_CC])
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
16 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
17 AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
18 [gl_cv_func_printf_sizes_c99],
19 [
20 AC_TRY_RUN([
21#include <stddef.h>
22#include <stdio.h>
23#include <string.h>
24#include <sys/types.h>
25#if HAVE_STDINT_H_WITH_UINTMAX
26# include <stdint.h>
27#endif
28#if HAVE_INTTYPES_H_WITH_UINTMAX
29# include <inttypes.h>
30#endif
31static char buf[100];
32int main ()
33{
34#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
35 buf[0] = '\0';
36 if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
37 || strcmp (buf, "12345671 33") != 0)
38 return 1;
39#endif
40 buf[0] = '\0';
41 if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
42 || strcmp (buf, "12345672 33") != 0)
43 return 1;
44 buf[0] = '\0';
45 if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
46 || strcmp (buf, "12345673 33") != 0)
47 return 1;
48 buf[0] = '\0';
49 if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
50 || strcmp (buf, "1.5 33") != 0)
51 return 1;
52 return 0;
53}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
54 [
55changequote(,)dnl
56 case "$host_os" in
57 # Guess yes on glibc systems.
58 *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
59 # Guess yes on FreeBSD >= 5.
60 freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
61 freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
62 # Guess yes on MacOS X >= 10.3.
63 darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
64 darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
65 # Guess yes on OpenBSD >= 3.9.
66 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
67 gl_cv_func_printf_sizes_c99="guessing no";;
68 openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
69 # Guess yes on Solaris >= 2.10.
70 solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
71 solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
72 # Guess yes on NetBSD >= 3.
73 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
74 gl_cv_func_printf_sizes_c99="guessing no";;
75 netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
76 # If we don't know, assume the worst.
77 *) gl_cv_func_printf_sizes_c99="guessing no";;
78 esac
79changequote([,])dnl
80 ])
81 ])
82])
83
84dnl Test whether the *printf family of functions supports 'long double'
85dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
86dnl Result is gl_cv_func_printf_long_double.
87
88AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
89[
90 AC_REQUIRE([AC_PROG_CC])
91 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
92 AC_CACHE_CHECK([whether printf supports 'long double' arguments],
93 [gl_cv_func_printf_long_double],
94 [
95 AC_TRY_RUN([
96#include <stdio.h>
97#include <string.h>
98static char buf[10000];
99int main ()
100{
101 buf[0] = '\0';
102 if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
103 || strcmp (buf, "1.750000 33") != 0)
104 return 1;
105 buf[0] = '\0';
106 if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
107 || strcmp (buf, "1.750000e+00 33") != 0)
108 return 1;
109 buf[0] = '\0';
110 if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
111 || strcmp (buf, "1.75 33") != 0)
112 return 1;
113 return 0;
114}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
115 [
116changequote(,)dnl
117 case "$host_os" in
118 beos*) gl_cv_func_printf_long_double="guessing no";;
119 mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
120 *) gl_cv_func_printf_long_double="guessing yes";;
121 esac
122changequote([,])dnl
123 ])
124 ])
125])
126
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)
129dnl Result is gl_cv_func_printf_infinite.
130
131AC_DEFUN([gl_PRINTF_INFINITE],
132[
133 AC_REQUIRE([AC_PROG_CC])
134 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
135 AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
136 [gl_cv_func_printf_infinite],
137 [
138 AC_TRY_RUN([
139#include <stdio.h>
140#include <string.h>
141static int
142strisnan (const char *string, size_t start_index, size_t end_index)
143{
144 if (start_index < end_index)
145 {
146 if (string[start_index] == '-')
147 start_index++;
148 if (start_index + 3 <= end_index
149 && memcmp (string + start_index, "nan", 3) == 0)
150 {
151 start_index += 3;
152 if (start_index == end_index
153 || (string[start_index] == '(' && string[end_index - 1] == ')'))
154 return 1;
155 }
156 }
157 return 0;
158}
159static char buf[10000];
160static double zero = 0.0;
161int main ()
162{
163 if (sprintf (buf, "%f", 1.0 / 0.0) < 0
164 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
165 return 1;
166 if (sprintf (buf, "%f", -1.0 / 0.0) < 0
167 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
168 return 1;
169 if (sprintf (buf, "%f", zero / zero) < 0
170 || !strisnan (buf, 0, strlen (buf)))
171 return 1;
172 if (sprintf (buf, "%e", 1.0 / 0.0) < 0
173 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
174 return 1;
175 if (sprintf (buf, "%e", -1.0 / 0.0) < 0
176 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
177 return 1;
178 if (sprintf (buf, "%e", zero / zero) < 0
179 || !strisnan (buf, 0, strlen (buf)))
180 return 1;
181 if (sprintf (buf, "%g", 1.0 / 0.0) < 0
182 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
183 return 1;
184 if (sprintf (buf, "%g", -1.0 / 0.0) < 0
185 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
186 return 1;
187 if (sprintf (buf, "%g", zero / zero) < 0
188 || !strisnan (buf, 0, strlen (buf)))
189 return 1;
190 return 0;
191}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
192 [
193changequote(,)dnl
194 case "$host_os" in
195 # Guess yes on glibc systems.
196 *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
197 # Guess yes on FreeBSD >= 6.
198 freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
199 freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
200 # Guess yes on MacOS X >= 10.3.
201 darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
202 darwin*) gl_cv_func_printf_infinite="guessing yes";;
203 # Guess yes on HP-UX >= 11.
204 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
205 hpux*) gl_cv_func_printf_infinite="guessing yes";;
206 # Guess yes on NetBSD >= 3.
207 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
208 gl_cv_func_printf_infinite="guessing no";;
209 netbsd*) gl_cv_func_printf_infinite="guessing yes";;
210 # Guess yes on BeOS.
211 beos*) gl_cv_func_printf_infinite="guessing yes";;
212 # If we don't know, assume the worst.
213 *) gl_cv_func_printf_infinite="guessing no";;
214 esac
215changequote([,])dnl
216 ])
217 ])
218])
219
220dnl Test whether the *printf family of functions supports infinite and NaN
221dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
222dnl Result is gl_cv_func_printf_infinite_long_double.
223
224AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
225[
226 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
227 AC_REQUIRE([AC_PROG_CC])
228 AC_REQUIRE([AC_C_BIGENDIAN])
229 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
230 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.
232 if test -n "$gl_printf_safe"; then
233 AC_DEFINE([CHECK_PRINTF_SAFE], [1],
234 [Define if you wish *printf() functions that have a safe handling of
235 non-IEEE-754 'long double' values.])
236 fi
237 case "$gl_cv_func_printf_long_double" in
238 *yes)
239 AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
240 [gl_cv_func_printf_infinite_long_double],
241 [
242 AC_TRY_RUN([
243]GL_NOCRASH[
244#include <float.h>
245#include <stdio.h>
246#include <string.h>
247static int
248strisnan (const char *string, size_t start_index, size_t end_index)
249{
250 if (start_index < end_index)
251 {
252 if (string[start_index] == '-')
253 start_index++;
254 if (start_index + 3 <= end_index
255 && memcmp (string + start_index, "nan", 3) == 0)
256 {
257 start_index += 3;
258 if (start_index == end_index
259 || (string[start_index] == '(' && string[end_index - 1] == ')'))
260 return 1;
261 }
262 }
263 return 0;
264}
265static char buf[10000];
266static long double zeroL = 0.0L;
267int main ()
268{
269 nocrash_init();
270 if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
271 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
272 return 1;
273 if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
274 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
275 return 1;
276 if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
277 || !strisnan (buf, 0, strlen (buf)))
278 return 1;
279 if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
280 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
281 return 1;
282 if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
283 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
284 return 1;
285 if (sprintf (buf, "%Le", zeroL / zeroL) < 0
286 || !strisnan (buf, 0, strlen (buf)))
287 return 1;
288 if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
289 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
290 return 1;
291 if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
292 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
293 return 1;
294 if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
295 || !strisnan (buf, 0, strlen (buf)))
296 return 1;
297#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
298/* Representation of an 80-bit 'long double' as an initializer for a sequence
299 of 'unsigned int' words. */
300# ifdef WORDS_BIGENDIAN
301# define LDBL80_WORDS(exponent,manthi,mantlo) \
302 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
303 ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
304 (unsigned int) (mantlo) << 16 \
305 }
306# else
307# define LDBL80_WORDS(exponent,manthi,mantlo) \
308 { mantlo, manthi, exponent }
309# endif
310 { /* Quiet NaN. */
311 static union { unsigned int word[4]; long double value; } x =
312 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
313 if (sprintf (buf, "%Lf", x.value) < 0
314 || !strisnan (buf, 0, strlen (buf)))
315 return 1;
316 if (sprintf (buf, "%Le", x.value) < 0
317 || !strisnan (buf, 0, strlen (buf)))
318 return 1;
319 if (sprintf (buf, "%Lg", x.value) < 0
320 || !strisnan (buf, 0, strlen (buf)))
321 return 1;
322 }
323 {
324 /* Signalling NaN. */
325 static union { unsigned int word[4]; long double value; } x =
326 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
327 if (sprintf (buf, "%Lf", x.value) < 0
328 || !strisnan (buf, 0, strlen (buf)))
329 return 1;
330 if (sprintf (buf, "%Le", x.value) < 0
331 || !strisnan (buf, 0, strlen (buf)))
332 return 1;
333 if (sprintf (buf, "%Lg", x.value) < 0
334 || !strisnan (buf, 0, strlen (buf)))
335 return 1;
336 }
337 { /* Pseudo-NaN. */
338 static union { unsigned int word[4]; long double value; } x =
339 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
340 if (sprintf (buf, "%Lf", x.value) < 0
341 || !strisnan (buf, 0, strlen (buf)))
342 return 1;
343 if (sprintf (buf, "%Le", x.value) < 0
344 || !strisnan (buf, 0, strlen (buf)))
345 return 1;
346 if (sprintf (buf, "%Lg", x.value) < 0
347 || !strisnan (buf, 0, strlen (buf)))
348 return 1;
349 }
350 { /* Pseudo-Infinity. */
351 static union { unsigned int word[4]; long double value; } x =
352 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
353 if (sprintf (buf, "%Lf", x.value) < 0
354 || !strisnan (buf, 0, strlen (buf)))
355 return 1;
356 if (sprintf (buf, "%Le", x.value) < 0
357 || !strisnan (buf, 0, strlen (buf)))
358 return 1;
359 if (sprintf (buf, "%Lg", x.value) < 0
360 || !strisnan (buf, 0, strlen (buf)))
361 return 1;
362 }
363 { /* Pseudo-Zero. */
364 static union { unsigned int word[4]; long double value; } x =
365 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
366 if (sprintf (buf, "%Lf", x.value) < 0
367 || !strisnan (buf, 0, strlen (buf)))
368 return 1;
369 if (sprintf (buf, "%Le", x.value) < 0
370 || !strisnan (buf, 0, strlen (buf)))
371 return 1;
372 if (sprintf (buf, "%Lg", x.value) < 0
373 || !strisnan (buf, 0, strlen (buf)))
374 return 1;
375 }
376 { /* Unnormalized number. */
377 static union { unsigned int word[4]; long double value; } x =
378 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
379 if (sprintf (buf, "%Lf", x.value) < 0
380 || !strisnan (buf, 0, strlen (buf)))
381 return 1;
382 if (sprintf (buf, "%Le", x.value) < 0
383 || !strisnan (buf, 0, strlen (buf)))
384 return 1;
385 if (sprintf (buf, "%Lg", x.value) < 0
386 || !strisnan (buf, 0, strlen (buf)))
387 return 1;
388 }
389 { /* Pseudo-Denormal. */
390 static union { unsigned int word[4]; long double value; } x =
391 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
392 if (sprintf (buf, "%Lf", x.value) < 0
393 || !strisnan (buf, 0, strlen (buf)))
394 return 1;
395 if (sprintf (buf, "%Le", x.value) < 0
396 || !strisnan (buf, 0, strlen (buf)))
397 return 1;
398 if (sprintf (buf, "%Lg", x.value) < 0
399 || !strisnan (buf, 0, strlen (buf)))
400 return 1;
401 }
402#endif
403 return 0;
404}],
405 [gl_cv_func_printf_infinite_long_double=yes],
406 [gl_cv_func_printf_infinite_long_double=no],
407 [
408changequote(,)dnl
409 case "$host_cpu" in
410 # Guess no on ia64, x86_64, i386.
411 ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
412 *)
413 case "$host_os" in
414 # Guess yes on glibc systems.
415 *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
416 # Guess yes on FreeBSD >= 6.
417 freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
418 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
419 # Guess yes on MacOS X >= 10.3.
420 darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
421 darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
422 # Guess yes on HP-UX >= 11.
423 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
424 hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
425 # Guess yes on NetBSD >= 3.
426 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
427 gl_cv_func_printf_infinite_long_double="guessing no";;
428 netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
429 # If we don't know, assume the worst.
430 *) gl_cv_func_printf_infinite_long_double="guessing no";;
431 esac
432 ;;
433 esac
434changequote([,])dnl
435 ])
436 ])
437 ;;
438 *)
439 gl_cv_func_printf_infinite_long_double="irrelevant"
440 ;;
441 esac
442])
443
444dnl Test whether the *printf family of functions supports the 'a' and 'A'
445dnl conversion specifier for hexadecimal output of floating-point numbers.
446dnl (ISO C99, POSIX:2001)
447dnl Result is gl_cv_func_printf_directive_a.
448
449AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
450[
451 AC_REQUIRE([AC_PROG_CC])
452 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
453 AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
454 [gl_cv_func_printf_directive_a],
455 [
456 AC_TRY_RUN([
457#include <stdio.h>
458#include <string.h>
459static char buf[100];
460int main ()
461{
462 if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
463 || (strcmp (buf, "0x1.922p+1 33") != 0
464 && strcmp (buf, "0x3.244p+0 33") != 0
465 && strcmp (buf, "0x6.488p-1 33") != 0
466 && strcmp (buf, "0xc.91p-2 33") != 0))
467 return 1;
468 if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
469 || (strcmp (buf, "-0X1.922P+1 33") != 0
470 && strcmp (buf, "-0X3.244P+0 33") != 0
471 && strcmp (buf, "-0X6.488P-1 33") != 0
472 && strcmp (buf, "-0XC.91P-2 33") != 0))
473 return 1;
474 /* This catches a FreeBSD 6.1 bug: it doesn't round. */
475 if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
476 || (strcmp (buf, "0x1.83p+0 33") != 0
477 && strcmp (buf, "0x3.05p-1 33") != 0
478 && strcmp (buf, "0x6.0ap-2 33") != 0
479 && strcmp (buf, "0xc.14p-3 33") != 0))
480 return 1;
481 /* This catches a FreeBSD 6.1 bug. See
482 <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
483 if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
484 || buf[0] == '0')
485 return 1;
486 /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
487 if (sprintf (buf, "%.1a", 1.999) < 0
488 || (strcmp (buf, "0x1.0p+1") != 0
489 && strcmp (buf, "0x2.0p+0") != 0
490 && strcmp (buf, "0x4.0p-1") != 0
491 && strcmp (buf, "0x8.0p-2") != 0))
492 return 1;
493 /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
494 glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
495 if (sprintf (buf, "%.1La", 1.999L) < 0
496 || (strcmp (buf, "0x1.0p+1") != 0
497 && strcmp (buf, "0x2.0p+0") != 0
498 && strcmp (buf, "0x4.0p-1") != 0
499 && strcmp (buf, "0x8.0p-2") != 0))
500 return 1;
501 return 0;
502}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
503 [
504 case "$host_os" in
505 # Guess yes on glibc >= 2.5 systems.
506 *-gnu*)
507 AC_EGREP_CPP([BZ2908], [
508 #include <features.h>
509 #ifdef __GNU_LIBRARY__
510 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
511 BZ2908
512 #endif
513 #endif
514 ],
515 [gl_cv_func_printf_directive_a="guessing yes"],
516 [gl_cv_func_printf_directive_a="guessing no"])
517 ;;
518 # If we don't know, assume the worst.
519 *) gl_cv_func_printf_directive_a="guessing no";;
520 esac
521 ])
522 ])
523])
524
525dnl Test whether the *printf family of functions supports the %F format
526dnl directive. (ISO C99, POSIX:2001)
527dnl Result is gl_cv_func_printf_directive_f.
528
529AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
530[
531 AC_REQUIRE([AC_PROG_CC])
532 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
533 AC_CACHE_CHECK([whether printf supports the 'F' directive],
534 [gl_cv_func_printf_directive_f],
535 [
536 AC_TRY_RUN([
537#include <stdio.h>
538#include <string.h>
539static char buf[100];
540int main ()
541{
542 if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
543 || strcmp (buf, "1234567.000000 33") != 0)
544 return 1;
545 if (sprintf (buf, "%F", 1.0 / 0.0) < 0
546 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
547 return 1;
548 /* This catches a Cygwin 2007 bug. */
549 if (sprintf (buf, "%.F", 1234.0) < 0
550 || strcmp (buf, "1234") != 0)
551 return 1;
552 return 0;
553}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
554 [
555changequote(,)dnl
556 case "$host_os" in
557 # Guess yes on glibc systems.
558 *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
559 # Guess yes on FreeBSD >= 6.
560 freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
561 freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
562 # Guess yes on MacOS X >= 10.3.
563 darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
564 darwin*) gl_cv_func_printf_directive_f="guessing yes";;
565 # Guess yes on Solaris >= 2.10.
566 solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
567 solaris*) gl_cv_func_printf_directive_f="guessing yes";;
568 # If we don't know, assume the worst.
569 *) gl_cv_func_printf_directive_f="guessing no";;
570 esac
571changequote([,])dnl
572 ])
573 ])
574])
575
576dnl Test whether the *printf family of functions supports the %n format
577dnl directive. (ISO C99, POSIX:2001)
578dnl Result is gl_cv_func_printf_directive_n.
579
580AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
581[
582 AC_REQUIRE([AC_PROG_CC])
583 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
584 AC_CACHE_CHECK([whether printf supports the 'n' directive],
585 [gl_cv_func_printf_directive_n],
586 [
587 AC_TRY_RUN([
588#include <stdio.h>
589#include <string.h>
590static char fmtstring[10];
591static char buf[100];
592int main ()
593{
594 int count = -1;
595 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
596 support %n in format strings in read-only memory but not in writable
597 memory. */
598 strcpy (fmtstring, "%d %n");
599 if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
600 || strcmp (buf, "123 ") != 0
601 || count != 4)
602 return 1;
603 return 0;
604}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
605 [
606changequote(,)dnl
607 case "$host_os" in
608 *) gl_cv_func_printf_directive_n="guessing yes";;
609 esac
610changequote([,])dnl
611 ])
612 ])
613])
614
615dnl Test whether the *printf family of functions supports POSIX/XSI format
616dnl strings with positions. (POSIX:2001)
617dnl Result is gl_cv_func_printf_positions.
618
619AC_DEFUN([gl_PRINTF_POSITIONS],
620[
621 AC_REQUIRE([AC_PROG_CC])
622 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
623 AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
624 [gl_cv_func_printf_positions],
625 [
626 AC_TRY_RUN([
627#include <stdio.h>
628#include <string.h>
629/* The string "%2$d %1$d", with dollar characters protected from the shell's
630 dollar expansion (possibly an autoconf bug). */
631static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
632static char buf[100];
633int main ()
634{
635 sprintf (buf, format, 33, 55);
636 return (strcmp (buf, "55 33") != 0);
637}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
638 [
639changequote(,)dnl
640 case "$host_os" in
641 netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
642 gl_cv_func_printf_positions="guessing no";;
643 beos*) gl_cv_func_printf_positions="guessing no";;
644 mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
645 *) gl_cv_func_printf_positions="guessing yes";;
646 esac
647changequote([,])dnl
648 ])
649 ])
650])
651
652dnl Test whether the *printf family of functions supports POSIX/XSI format
653dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
654dnl Result is gl_cv_func_printf_flag_grouping.
655
656AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
657[
658 AC_REQUIRE([AC_PROG_CC])
659 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
660 AC_CACHE_CHECK([whether printf supports the grouping flag],
661 [gl_cv_func_printf_flag_grouping],
662 [
663 AC_TRY_RUN([
664#include <stdio.h>
665#include <string.h>
666static char buf[100];
667int main ()
668{
669 if (sprintf (buf, "%'d %d", 1234567, 99) < 0
670 || buf[strlen (buf) - 1] != '9')
671 return 1;
672 return 0;
673}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
674 [
675changequote(,)dnl
676 case "$host_os" in
677 cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
678 netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
679 mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
680 *) gl_cv_func_printf_flag_grouping="guessing yes";;
681 esac
682changequote([,])dnl
683 ])
684 ])
685])
686
687dnl Test whether the *printf family of functions supports the - flag correctly.
688dnl (ISO C99.) See
689dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
690dnl Result is gl_cv_func_printf_flag_leftadjust.
691
692AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
693[
694 AC_REQUIRE([AC_PROG_CC])
695 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
696 AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
697 [gl_cv_func_printf_flag_leftadjust],
698 [
699 AC_TRY_RUN([
700#include <stdio.h>
701#include <string.h>
702static char buf[100];
703int main ()
704{
705 /* Check that a '-' flag is not annihilated by a negative width. */
706 if (sprintf (buf, "a%-*sc", -3, "b") < 0
707 || strcmp (buf, "ab c") != 0)
708 return 1;
709 return 0;
710}],
711 [gl_cv_func_printf_flag_leftadjust=yes],
712 [gl_cv_func_printf_flag_leftadjust=no],
713 [
714changequote(,)dnl
715 case "$host_os" in
716 # Guess yes on HP-UX 11.
717 hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
718 # Guess no on HP-UX 10 and older.
719 hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
720 # Guess yes otherwise.
721 *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
722 esac
723changequote([,])dnl
724 ])
725 ])
726])
727
728dnl Test whether the *printf family of functions supports padding of non-finite
729dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
730dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
731dnl Result is gl_cv_func_printf_flag_zero.
732
733AC_DEFUN([gl_PRINTF_FLAG_ZERO],
734[
735 AC_REQUIRE([AC_PROG_CC])
736 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
737 AC_CACHE_CHECK([whether printf supports the zero flag correctly],
738 [gl_cv_func_printf_flag_zero],
739 [
740 AC_TRY_RUN([
741#include <stdio.h>
742#include <string.h>
743static char buf[100];
744int main ()
745{
746 if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
747 || (strcmp (buf, " inf") != 0
748 && strcmp (buf, " infinity") != 0))
749 return 1;
750 return 0;
751}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
752 [
753changequote(,)dnl
754 case "$host_os" in
755 # Guess yes on glibc systems.
756 *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
757 # Guess yes on BeOS.
758 beos*) gl_cv_func_printf_flag_zero="guessing yes";;
759 # If we don't know, assume the worst.
760 *) gl_cv_func_printf_flag_zero="guessing no";;
761 esac
762changequote([,])dnl
763 ])
764 ])
765])
766
767dnl Test whether the *printf family of functions supports large precisions.
768dnl On mingw, precisions larger than 512 are treated like 512, in integer,
769dnl floating-point or pointer output. On BeOS, precisions larger than 1044
770dnl crash the program.
771dnl Result is gl_cv_func_printf_precision.
772
773AC_DEFUN([gl_PRINTF_PRECISION],
774[
775 AC_REQUIRE([AC_PROG_CC])
776 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
777 AC_CACHE_CHECK([whether printf supports large precisions],
778 [gl_cv_func_printf_precision],
779 [
780 AC_TRY_RUN([
781#include <stdio.h>
782#include <string.h>
783static char buf[5000];
784int main ()
785{
786#ifdef __BEOS__
787 /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
788 return 1;
789#endif
790 if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
791 return 1;
792 return 0;
793}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
794 [
795changequote(,)dnl
796 case "$host_os" in
797 # Guess no only on native Win32 and BeOS systems.
798 mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
799 beos*) gl_cv_func_printf_precision="guessing no" ;;
800 *) gl_cv_func_printf_precision="guessing yes" ;;
801 esac
802changequote([,])dnl
803 ])
804 ])
805])
806
807dnl Test whether the *printf family of functions recovers gracefully in case
808dnl of an out-of-memory condition, or whether it crashes the entire program.
809dnl Result is gl_cv_func_printf_enomem.
810
811AC_DEFUN([gl_PRINTF_ENOMEM],
812[
813 AC_REQUIRE([AC_PROG_CC])
814 AC_REQUIRE([gl_MULTIARCH])
815 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
816 AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
817 [gl_cv_func_printf_enomem],
818 [
819 gl_cv_func_printf_enomem="guessing no"
820 if test "$cross_compiling" = no; then
821 if test $APPLE_UNIVERSAL_BUILD = 0; then
822 AC_LANG_CONFTEST([AC_LANG_SOURCE([
823]GL_NOCRASH[
824changequote(,)dnl
825#include <stdio.h>
826#include <sys/types.h>
827#include <sys/time.h>
828#include <sys/resource.h>
829#include <errno.h>
830int main()
831{
832 struct rlimit limit;
833 int ret;
834 nocrash_init ();
835 /* Some printf implementations allocate temporary space with malloc. */
836 /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
837#ifdef RLIMIT_DATA
838 if (getrlimit (RLIMIT_DATA, &limit) < 0)
839 return 77;
840 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
841 limit.rlim_max = 5000000;
842 limit.rlim_cur = limit.rlim_max;
843 if (setrlimit (RLIMIT_DATA, &limit) < 0)
844 return 77;
845#endif
846 /* On Linux systems, malloc() is limited by RLIMIT_AS. */
847#ifdef RLIMIT_AS
848 if (getrlimit (RLIMIT_AS, &limit) < 0)
849 return 77;
850 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
851 limit.rlim_max = 5000000;
852 limit.rlim_cur = limit.rlim_max;
853 if (setrlimit (RLIMIT_AS, &limit) < 0)
854 return 77;
855#endif
856 /* Some printf implementations allocate temporary space on the stack. */
857#ifdef RLIMIT_STACK
858 if (getrlimit (RLIMIT_STACK, &limit) < 0)
859 return 77;
860 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
861 limit.rlim_max = 5000000;
862 limit.rlim_cur = limit.rlim_max;
863 if (setrlimit (RLIMIT_STACK, &limit) < 0)
864 return 77;
865#endif
866 ret = printf ("%.5000000f", 1.0);
867 return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
868}
869changequote([,])dnl
870 ])])
871 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
872 (./conftest
873 result=$?
874 if test $result != 0 && test $result != 77; then result=1; fi
875 exit $result
876 ) >/dev/null 2>/dev/null
877 case $? in
878 0) gl_cv_func_printf_enomem="yes" ;;
879 77) gl_cv_func_printf_enomem="guessing no" ;;
880 *) gl_cv_func_printf_enomem="no" ;;
881 esac
882 else
883 gl_cv_func_printf_enomem="guessing no"
884 fi
885 rm -fr conftest*
886 else
887 dnl A universal build on Apple MacOS X platforms.
888 dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
889 dnl But we need a configuration result that is valid in both modes.
890 gl_cv_func_printf_enomem="guessing no"
891 fi
892 fi
893 if test "$gl_cv_func_printf_enomem" = "guessing no"; then
894changequote(,)dnl
895 case "$host_os" in
896 # Guess yes on glibc systems.
897 *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
898 # Guess yes on Solaris.
899 solaris*) gl_cv_func_printf_enomem="guessing yes";;
900 # Guess yes on AIX.
901 aix*) gl_cv_func_printf_enomem="guessing yes";;
902 # Guess yes on HP-UX/hppa.
903 hpux*) case "$host_cpu" in
904 hppa*) gl_cv_func_printf_enomem="guessing yes";;
905 *) gl_cv_func_printf_enomem="guessing no";;
906 esac
907 ;;
908 # Guess yes on IRIX.
909 irix*) gl_cv_func_printf_enomem="guessing yes";;
910 # Guess yes on OSF/1.
911 osf*) gl_cv_func_printf_enomem="guessing yes";;
912 # Guess yes on BeOS.
913 beos*) gl_cv_func_printf_enomem="guessing yes";;
914 # Guess yes on Haiku.
915 haiku*) gl_cv_func_printf_enomem="guessing yes";;
916 # If we don't know, assume the worst.
917 *) gl_cv_func_printf_enomem="guessing no";;
918 esac
919changequote([,])dnl
920 fi
921 ])
922])
923
924dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
925dnl Result is ac_cv_func_snprintf.
926
927AC_DEFUN([gl_SNPRINTF_PRESENCE],
928[
929 AC_CHECK_FUNCS_ONCE([snprintf])
930])
931
932dnl Test whether the string produced by the snprintf function is always NUL
933dnl terminated. (ISO C99, POSIX:2001)
934dnl Result is gl_cv_func_snprintf_truncation_c99.
935
936AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
937[
938 AC_REQUIRE([AC_PROG_CC])
939 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
940 AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
941 [gl_cv_func_snprintf_truncation_c99],
942 [
943 AC_TRY_RUN([
944#include <stdio.h>
945#include <string.h>
946static char buf[100];
947int main ()
948{
949 strcpy (buf, "ABCDEF");
950 snprintf (buf, 3, "%d %d", 4567, 89);
951 if (memcmp (buf, "45\0DEF", 6) != 0)
952 return 1;
953 return 0;
954}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
955 [
956changequote(,)dnl
957 case "$host_os" in
958 # Guess yes on glibc systems.
959 *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
960 # Guess yes on FreeBSD >= 5.
961 freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
962 freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
963 # Guess yes on MacOS X >= 10.3.
964 darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
965 darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
966 # Guess yes on OpenBSD >= 3.9.
967 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
968 gl_cv_func_snprintf_truncation_c99="guessing no";;
969 openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
970 # Guess yes on Solaris >= 2.6.
971 solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
972 solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
973 # Guess yes on AIX >= 4.
974 aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
975 aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
976 # Guess yes on HP-UX >= 11.
977 hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
978 hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
979 # Guess yes on IRIX >= 6.5.
980 irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
981 # Guess yes on OSF/1 >= 5.
982 osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
983 osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
984 # Guess yes on NetBSD >= 3.
985 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
986 gl_cv_func_snprintf_truncation_c99="guessing no";;
987 netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
988 # Guess yes on BeOS.
989 beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
990 # If we don't know, assume the worst.
991 *) gl_cv_func_snprintf_truncation_c99="guessing no";;
992 esac
993changequote([,])dnl
994 ])
995 ])
996])
997
998dnl Test whether the return value of the snprintf function is the number
999dnl of bytes (excluding the terminating NUL) that would have been produced
1000dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
1001dnl For example, this test program fails on IRIX 6.5:
1002dnl ---------------------------------------------------------------------
1003dnl #include <stdio.h>
1004dnl int main()
1005dnl {
1006dnl static char buf[8];
1007dnl int retval = snprintf (buf, 3, "%d", 12345);
1008dnl return retval >= 0 && retval < 3;
1009dnl }
1010dnl ---------------------------------------------------------------------
1011dnl Result is gl_cv_func_snprintf_retval_c99.
1012
1013AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
1014[
1015 AC_REQUIRE([AC_PROG_CC])
1016 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1017 AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
1018 [gl_cv_func_snprintf_retval_c99],
1019 [
1020 AC_TRY_RUN([
1021#include <stdio.h>
1022#include <string.h>
1023static char buf[100];
1024int main ()
1025{
1026 strcpy (buf, "ABCDEF");
1027 if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
1028 return 1;
1029 return 0;
1030}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
1031 [
1032changequote(,)dnl
1033 case "$host_os" in
1034 # Guess yes on glibc systems.
1035 *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1036 # Guess yes on FreeBSD >= 5.
1037 freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
1038 freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1039 # Guess yes on MacOS X >= 10.3.
1040 darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
1041 darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1042 # Guess yes on OpenBSD >= 3.9.
1043 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
1044 gl_cv_func_snprintf_retval_c99="guessing no";;
1045 openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1046 # Guess yes on Solaris >= 2.6.
1047 solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
1048 solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1049 # Guess yes on AIX >= 4.
1050 aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
1051 aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1052 # Guess yes on NetBSD >= 3.
1053 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1054 gl_cv_func_snprintf_retval_c99="guessing no";;
1055 netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1056 # Guess yes on BeOS.
1057 beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1058 # If we don't know, assume the worst.
1059 *) gl_cv_func_snprintf_retval_c99="guessing no";;
1060 esac
1061changequote([,])dnl
1062 ])
1063 ])
1064])
1065
1066dnl Test whether the snprintf function supports the %n format directive
1067dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
1068dnl Result is gl_cv_func_snprintf_directive_n.
1069
1070AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
1071[
1072 AC_REQUIRE([AC_PROG_CC])
1073 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1074 AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
1075 [gl_cv_func_snprintf_directive_n],
1076 [
1077 AC_TRY_RUN([
1078#include <stdio.h>
1079#include <string.h>
1080static char fmtstring[10];
1081static char buf[100];
1082int main ()
1083{
1084 int count = -1;
1085 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
1086 support %n in format strings in read-only memory but not in writable
1087 memory. */
1088 strcpy (fmtstring, "%d %n");
1089 snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
1090 if (count != 6)
1091 return 1;
1092 return 0;
1093}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
1094 [
1095changequote(,)dnl
1096 case "$host_os" in
1097 # Guess yes on glibc systems.
1098 *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
1099 # Guess yes on FreeBSD >= 5.
1100 freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
1101 freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
1102 # Guess yes on MacOS X >= 10.3.
1103 darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
1104 darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
1105 # Guess yes on Solaris >= 2.6.
1106 solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
1107 solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
1108 # Guess yes on AIX >= 4.
1109 aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
1110 aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
1111 # Guess yes on IRIX >= 6.5.
1112 irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
1113 # Guess yes on OSF/1 >= 5.
1114 osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
1115 osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
1116 # Guess yes on NetBSD >= 3.
1117 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1118 gl_cv_func_snprintf_directive_n="guessing no";;
1119 netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
1120 # Guess yes on BeOS.
1121 beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
1122 # If we don't know, assume the worst.
1123 *) gl_cv_func_snprintf_directive_n="guessing no";;
1124 esac
1125changequote([,])dnl
1126 ])
1127 ])
1128])
1129
1130dnl Test whether the snprintf function, when passed a size = 1, writes any
1131dnl output without bounds in this case, behaving like sprintf. This is the
1132dnl case on Linux libc5.
1133dnl Result is gl_cv_func_snprintf_size1.
1134
1135AC_DEFUN([gl_SNPRINTF_SIZE1],
1136[
1137 AC_REQUIRE([AC_PROG_CC])
1138 AC_CACHE_CHECK([whether snprintf respects a size of 1],
1139 [gl_cv_func_snprintf_size1],
1140 [
1141 AC_TRY_RUN([
1142#include <stdio.h>
1143int main()
1144{
1145 static char buf[8] = "DEADBEEF";
1146 snprintf (buf, 1, "%d", 12345);
1147 return buf[1] != 'E';
1148}],
1149 [gl_cv_func_snprintf_size1=yes],
1150 [gl_cv_func_snprintf_size1=no],
1151 [gl_cv_func_snprintf_size1="guessing yes"])
1152 ])
1153])
1154
1155dnl Test whether the vsnprintf function, when passed a zero size, produces no
1156dnl output. (ISO C99, POSIX:2001)
1157dnl For example, snprintf nevertheless writes a NUL byte in this case
1158dnl on OSF/1 5.1:
1159dnl ---------------------------------------------------------------------
1160dnl #include <stdio.h>
1161dnl int main()
1162dnl {
1163dnl static char buf[8] = "DEADBEEF";
1164dnl snprintf (buf, 0, "%d", 12345);
1165dnl return buf[0] != 'D';
1166dnl }
1167dnl ---------------------------------------------------------------------
1168dnl And vsnprintf writes any output without bounds in this case, behaving like
1169dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
1170dnl ---------------------------------------------------------------------
1171dnl #include <stdarg.h>
1172dnl #include <stdio.h>
1173dnl static int my_snprintf (char *buf, int size, const char *format, ...)
1174dnl {
1175dnl va_list args;
1176dnl int ret;
1177dnl va_start (args, format);
1178dnl ret = vsnprintf (buf, size, format, args);
1179dnl va_end (args);
1180dnl return ret;
1181dnl }
1182dnl int main()
1183dnl {
1184dnl static char buf[8] = "DEADBEEF";
1185dnl my_snprintf (buf, 0, "%d", 12345);
1186dnl return buf[0] != 'D';
1187dnl }
1188dnl ---------------------------------------------------------------------
1189dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
1190
1191AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
1192[
1193 AC_REQUIRE([AC_PROG_CC])
1194 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1195 AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
1196 [gl_cv_func_vsnprintf_zerosize_c99],
1197 [
1198 AC_TRY_RUN([
1199#include <stdarg.h>
1200#include <stdio.h>
1201static int my_snprintf (char *buf, int size, const char *format, ...)
1202{
1203 va_list args;
1204 int ret;
1205 va_start (args, format);
1206 ret = vsnprintf (buf, size, format, args);
1207 va_end (args);
1208 return ret;
1209}
1210int main()
1211{
1212 static char buf[8] = "DEADBEEF";
1213 my_snprintf (buf, 0, "%d", 12345);
1214 return buf[0] != 'D';
1215}],
1216 [gl_cv_func_vsnprintf_zerosize_c99=yes],
1217 [gl_cv_func_vsnprintf_zerosize_c99=no],
1218 [
1219changequote(,)dnl
1220 case "$host_os" in
1221 # Guess yes on glibc systems.
1222 *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1223 # Guess yes on FreeBSD >= 5.
1224 freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1225 freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1226 # Guess yes on MacOS X >= 10.3.
1227 darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1228 darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1229 # Guess yes on Cygwin.
1230 cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1231 # Guess yes on Solaris >= 2.6.
1232 solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1233 solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1234 # Guess yes on AIX >= 4.
1235 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1236 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1237 # Guess yes on IRIX >= 6.5.
1238 irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1239 # Guess yes on NetBSD >= 3.
1240 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1241 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1242 netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1243 # Guess yes on BeOS.
1244 beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1245 # Guess yes on mingw.
1246 mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1247 # If we don't know, assume the worst.
1248 *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1249 esac
1250changequote([,])dnl
1251 ])
1252 ])
1253])
1254
1255dnl The results of these tests on various platforms are:
1256dnl
1257dnl 1 = gl_PRINTF_SIZES_C99
1258dnl 2 = gl_PRINTF_LONG_DOUBLE
1259dnl 3 = gl_PRINTF_INFINITE
1260dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
1261dnl 5 = gl_PRINTF_DIRECTIVE_A
1262dnl 6 = gl_PRINTF_DIRECTIVE_F
1263dnl 7 = gl_PRINTF_DIRECTIVE_N
1264dnl 8 = gl_PRINTF_POSITIONS
1265dnl 9 = gl_PRINTF_FLAG_GROUPING
1266dnl 10 = gl_PRINTF_FLAG_LEFTADJUST
1267dnl 11 = gl_PRINTF_FLAG_ZERO
1268dnl 12 = gl_PRINTF_PRECISION
1269dnl 13 = gl_PRINTF_ENOMEM
1270dnl 14 = gl_SNPRINTF_PRESENCE
1271dnl 15 = gl_SNPRINTF_TRUNCATION_C99
1272dnl 16 = gl_SNPRINTF_RETVAL_C99
1273dnl 17 = gl_SNPRINTF_DIRECTIVE_N
1274dnl 18 = gl_SNPRINTF_SIZE1
1275dnl 19 = gl_VSNPRINTF_ZEROSIZE_C99
1276dnl
1277dnl 1 = checking whether printf supports size specifiers as in C99...
1278dnl 2 = checking whether printf supports 'long double' arguments...
1279dnl 3 = checking whether printf supports infinite 'double' arguments...
1280dnl 4 = checking whether printf supports infinite 'long double' arguments...
1281dnl 5 = checking whether printf supports the 'a' and 'A' directives...
1282dnl 6 = checking whether printf supports the 'F' directive...
1283dnl 7 = checking whether printf supports the 'n' directive...
1284dnl 8 = checking whether printf supports POSIX/XSI format strings with positions...
1285dnl 9 = checking whether printf supports the grouping flag...
1286dnl 10 = checking whether printf supports the left-adjust flag correctly...
1287dnl 11 = checking whether printf supports the zero flag correctly...
1288dnl 12 = checking whether printf supports large precisions...
1289dnl 13 = checking whether printf survives out-of-memory conditions...
1290dnl 14 = checking for snprintf...
1291dnl 15 = checking whether snprintf truncates the result as in C99...
1292dnl 16 = checking whether snprintf returns a byte count as in C99...
1293dnl 17 = checking whether snprintf fully supports the 'n' directive...
1294dnl 18 = checking whether snprintf respects a size of 1...
1295dnl 19 = checking whether vsnprintf respects a zero size as in C99...
1296dnl
1297dnl . = yes, # = no.
1298dnl
1299dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
1300dnl glibc 2.5 . . . . . . . . . . . . . . . . . . .
1301dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . .
1302dnl FreeBSD 5.4, 6.1 . . . . # . . . . . # . # . . . . . .
1303dnl MacOS X 10.3.9 . . . . # . . . . . # . # . . . . . .
1304dnl OpenBSD 3.9, 4.0 . . # # # # . . # . # . # . . . . . .
1305dnl Cygwin 2007 (= Cygwin 1.5.24) . . . . # # . . . ? # ? ? . . . . . .
1306dnl Cygwin 2006 (= Cygwin 1.5.19) # . . . # # . . # ? # ? ? . . . . . .
1307dnl Solaris 10 . . # # # . . . . . # . . . . . . . .
1308dnl Solaris 2.6 ... 9 # . # # # # . . . . # . . . . . . . .
1309dnl Solaris 2.5.1 # . # # # # . . . . # . . # # # # # #
1310dnl AIX 5.2 . . # # # . . . . . # . . . . . . . .
1311dnl AIX 4.3.2, 5.1 # . # # # # . . . . # . . . . . . . .
1312dnl HP-UX 11.31 . . . . # . . . . . # . . . . # # . .
1313dnl HP-UX 11.{00,11,23} # . . . # # . . . . # . . . . # # . #
1314dnl HP-UX 10.20 # . . . # # . . . # # . . . . # # ? #
1315dnl IRIX 6.5 # . # # # # . . . . # . . . . # . . .
1316dnl OSF/1 5.1 # . # # # # . . . . # . . . . # . . #
1317dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # #
1318dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ?
1319dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . .
1320dnl Haiku . . . # # # . . . . . . ? . . . . . .
1321dnl BeOS # # . # # # . # . ? . # ? . . . . . .
1322dnl mingw # # # # # # . # # . # # ? . # # # . .
diff --git a/gl/m4/progtest.m4 b/gl/m4/progtest.m4
index a56365c..e1d445d 100644
--- a/gl/m4/progtest.m4
+++ b/gl/m4/progtest.m4
@@ -1,5 +1,5 @@
1# progtest.m4 serial 4 (gettext-0.14.2) 1# progtest.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. 2dnl Copyright (C) 1996-2003, 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.
@@ -16,7 +16,7 @@ dnl They are *not* in the public domain.
16dnl Authors: 16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1996. 17dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
18 18
19AC_PREREQ(2.50) 19AC_PREREQ([2.50])
20 20
21# Search path for a program which passes the given test. 21# Search path for a program which passes the given test.
22 22
@@ -55,7 +55,7 @@ rm -f conf$$.file
55# Extract the first word of "$2", so it can be a program name with args. 55# Extract the first word of "$2", so it can be a program name with args.
56set dummy $2; ac_word=[$]2 56set dummy $2; ac_word=[$]2
57AC_MSG_CHECKING([for $ac_word]) 57AC_MSG_CHECKING([for $ac_word])
58AC_CACHE_VAL(ac_cv_path_$1, 58AC_CACHE_VAL([ac_cv_path_$1],
59[case "[$]$1" in 59[case "[$]$1" in
60 [[\\/]]* | ?:[[\\/]]*) 60 [[\\/]]* | ?:[[\\/]]*)
61 ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 61 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
@@ -84,9 +84,9 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
84esac])dnl 84esac])dnl
85$1="$ac_cv_path_$1" 85$1="$ac_cv_path_$1"
86if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 86if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
87 AC_MSG_RESULT([$]$1) 87 AC_MSG_RESULT([$][$1])
88else 88else
89 AC_MSG_RESULT(no) 89 AC_MSG_RESULT([no])
90fi 90fi
91AC_SUBST($1)dnl 91AC_SUBST([$1])dnl
92]) 92])
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index 7da6efe..43b0463 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,7 +1,7 @@
1#serial 48 1# serial 53
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 Free Software Foundation, Inc. 4# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5# 5#
6# This file is free software; the Free Software Foundation 6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_REGEX],
17 AC_CHECK_HEADERS_ONCE([locale.h]) 17 AC_CHECK_HEADERS_ONCE([locale.h])
18 18
19 AC_ARG_WITH([included-regex], 19 AC_ARG_WITH([included-regex],
20 [AC_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 32-bit
22 systems with recent-enough versions of the GNU C 22 systems with recent-enough versions of the GNU C
23 Library (use with caution on other systems). 23 Library (use with caution on other systems).
@@ -37,13 +37,13 @@ AC_DEFUN([gl_REGEX],
37 [gl_cv_func_re_compile_pattern_working], 37 [gl_cv_func_re_compile_pattern_working],
38 [AC_RUN_IFELSE( 38 [AC_RUN_IFELSE(
39 [AC_LANG_PROGRAM( 39 [AC_LANG_PROGRAM(
40 [AC_INCLUDES_DEFAULT 40 [AC_INCLUDES_DEFAULT[
41 #if HAVE_LOCALE_H 41 #if HAVE_LOCALE_H
42 #include <locale.h> 42 #include <locale.h>
43 #endif 43 #endif
44 #include <limits.h> 44 #include <limits.h>
45 #include <regex.h> 45 #include <regex.h>
46 ], 46 ]],
47 [[static struct re_pattern_buffer regex; 47 [[static struct re_pattern_buffer regex;
48 unsigned char folded_chars[UCHAR_MAX + 1]; 48 unsigned char folded_chars[UCHAR_MAX + 1];
49 int i; 49 int i;
@@ -175,7 +175,7 @@ AC_DEFUN([gl_REGEX],
175 esac 175 esac
176 176
177 if test $ac_use_included_regex = yes; then 177 if test $ac_use_included_regex = yes; then
178 AC_DEFINE([_REGEX_LARGE_OFFSETS], 1, 178 AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
179 [Define if you want regoff_t to be at least as wide POSIX requires.]) 179 [Define if you want regoff_t to be at least as wide POSIX requires.])
180 AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], 180 AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
181 [Define to rpl_re_syntax_options if the replacement should be used.]) 181 [Define to rpl_re_syntax_options if the replacement should be used.])
@@ -217,6 +217,8 @@ AC_DEFUN([gl_PREREQ_REGEX],
217[ 217[
218 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 218 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
219 AC_REQUIRE([AC_C_RESTRICT]) 219 AC_REQUIRE([AC_C_RESTRICT])
220 AC_CHECK_FUNCS_ONCE([isblank iswctype mbrtowc wcrtomb wcscoll]) 220 AC_REQUIRE([AC_TYPE_MBSTATE_T])
221 AC_CHECK_HEADERS([libintl.h])
222 AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll])
221 AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>]) 223 AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
222]) 224])
diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4
new file mode 100644
index 0000000..242f9e3
--- /dev/null
+++ b/gl/m4/servent.m4
@@ -0,0 +1,47 @@
1# servent.m4 serial 1
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_SERVENT],
8[
9 dnl Where are getservent(), setservent(), endservent(), getservbyname(),
10 dnl getservbyport() defined?
11 dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
12 dnl getprotobynumber() defined?
13 dnl - On Solaris, they are in libsocket. Ignore libxnet.
14 dnl - On Haiku, they are in libnetwork.
15 dnl - On BeOS, they are in libnet.
16 dnl - On native Windows, they are in ws2_32.dll.
17 dnl - Otherwise they are in libc.
18 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
19 SERVENT_LIB=
20 gl_saved_libs="$LIBS"
21 AC_SEARCH_LIBS([getservbyname], [socket network net],
22 [if test "$ac_cv_search_getservbyname" != "none required"; then
23 SERVENT_LIB="$ac_cv_search_getservbyname"
24 fi])
25 LIBS="$gl_saved_libs"
26 if test -z "$SERVENT_LIB"; then
27 AC_CHECK_FUNCS([getservbyname], , [
28 AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
29 [gl_cv_w32_getservbyname],
30 [gl_cv_w32_getservbyname=no
31 gl_save_LIBS="$LIBS"
32 LIBS="$LIBS -lws2_32"
33 AC_TRY_LINK([
34#ifdef HAVE_WINSOCK2_H
35#include <winsock2.h>
36#endif
37#include <stddef.h>
38], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
39 LIBS="$gl_save_LIBS"
40 ])
41 if test "$gl_cv_w32_getservbyname" = "yes"; then
42 SERVENT_LIB="-lws2_32"
43 fi
44 ])
45 fi
46 AC_SUBST([SERVENT_LIB])
47])
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 6cb4868..e0e7b3f 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
1# size_max.m4 serial 6 1# size_max.m4 serial 7
2dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2006, 2008 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,7 +8,7 @@ dnl From Bruno Haible.
8 8
9AC_DEFUN([gl_SIZE_MAX], 9AC_DEFUN([gl_SIZE_MAX],
10[ 10[
11 AC_CHECK_HEADERS(stdint.h) 11 AC_CHECK_HEADERS([stdint.h])
12 dnl First test whether the system already has SIZE_MAX. 12 dnl First test whether the system already has SIZE_MAX.
13 AC_MSG_CHECKING([for SIZE_MAX]) 13 AC_MSG_CHECKING([for SIZE_MAX])
14 AC_CACHE_VAL([gl_cv_size_max], [ 14 AC_CACHE_VAL([gl_cv_size_max], [
@@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX],
21#ifdef SIZE_MAX 21#ifdef SIZE_MAX
22Found it 22Found it
23#endif 23#endif
24], gl_cv_size_max=yes) 24], [gl_cv_size_max=yes])
25 if test -z "$gl_cv_size_max"; then 25 if test -z "$gl_cv_size_max"; then
26 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider 26 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
27 dnl than the type 'unsigned long'. Try hard to find a definition that can 27 dnl than the type 'unsigned long'. Try hard to find a definition that can
28 dnl be used in a preprocessor #if, i.e. doesn't contain a cast. 28 dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
29 AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], 29 AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
30 [#include <stddef.h> 30 [#include <stddef.h>
31#include <limits.h>], size_t_bits_minus_1=) 31#include <limits.h>], [size_t_bits_minus_1=])
32 AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], 32 AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
33 [#include <stddef.h>], fits_in_uint=) 33 [#include <stddef.h>], [fits_in_uint=])
34 if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then 34 if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
35 if test $fits_in_uint = 1; then 35 if test $fits_in_uint = 1; then
36 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type 36 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
@@ -38,7 +38,7 @@ Found it
38 AC_TRY_COMPILE([#include <stddef.h> 38 AC_TRY_COMPILE([#include <stddef.h>
39 extern size_t foo; 39 extern size_t foo;
40 extern unsigned long foo; 40 extern unsigned long foo;
41 ], [], fits_in_uint=0) 41 ], [], [fits_in_uint=0])
42 fi 42 fi
43 dnl We cannot use 'expr' to simplify this expression, because 'expr' 43 dnl We cannot use 'expr' to simplify this expression, because 'expr'
44 dnl works only with 'long' integers in the host environment, while we 44 dnl works only with 'long' integers in the host environment, while we
diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4
index f21200d..6021786 100644
--- a/gl/m4/snprintf.m4
+++ b/gl/m4/snprintf.m4
@@ -1,5 +1,5 @@
1# snprintf.m4 serial 4 1# snprintf.m4 serial 5
2dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2004, 2007-2008 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.
@@ -7,8 +7,17 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_FUNC_SNPRINTF], 7AC_DEFUN([gl_FUNC_SNPRINTF],
8[ 8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 gl_cv_func_snprintf_usable=no
10 AC_CHECK_FUNCS([snprintf]) 11 AC_CHECK_FUNCS([snprintf])
11 if test $ac_cv_func_snprintf = no; then 12 if test $ac_cv_func_snprintf = yes; then
13 gl_SNPRINTF_SIZE1
14 case "$gl_cv_func_snprintf_size1" in
15 *yes)
16 gl_cv_func_snprintf_usable=yes
17 ;;
18 esac
19 fi
20 if test $gl_cv_func_snprintf_usable = no; then
12 gl_REPLACE_SNPRINTF 21 gl_REPLACE_SNPRINTF
13 fi 22 fi
14 AC_CHECK_DECLS_ONCE([snprintf]) 23 AC_CHECK_DECLS_ONCE([snprintf])
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 25d9755..99ea06f 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
1# sockpfaf.m4 serial 5 1# sockpfaf.m4 serial 6
2dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
16 AC_REQUIRE([gl_HEADER_SYS_SOCKET]) 16 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
17 AC_CHECK_HEADERS_ONCE([netinet/in.h]) 17 AC_CHECK_HEADERS_ONCE([netinet/in.h])
18 18
19 AC_MSG_CHECKING(for IPv4 sockets) 19 AC_MSG_CHECKING([for IPv4 sockets])
20 AC_CACHE_VAL(gl_cv_socket_ipv4, 20 AC_CACHE_VAL([gl_cv_socket_ipv4],
21 [AC_TRY_COMPILE([#include <sys/types.h> 21 [AC_TRY_COMPILE([#include <sys/types.h>
22#ifdef HAVE_SYS_SOCKET_H 22#ifdef HAVE_SYS_SOCKET_H
23#include <sys/socket.h> 23#include <sys/socket.h>
@@ -31,13 +31,13 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
31[int x = AF_INET; struct in_addr y; struct sockaddr_in z; 31[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
32 if (&x && &y && &z) return 0;], 32 if (&x && &y && &z) return 0;],
33 gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) 33 gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
34 AC_MSG_RESULT($gl_cv_socket_ipv4) 34 AC_MSG_RESULT([$gl_cv_socket_ipv4])
35 if test $gl_cv_socket_ipv4 = yes; then 35 if test $gl_cv_socket_ipv4 = yes; then
36 AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.]) 36 AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
37 fi 37 fi
38 38
39 AC_MSG_CHECKING(for IPv6 sockets) 39 AC_MSG_CHECKING([for IPv6 sockets])
40 AC_CACHE_VAL(gl_cv_socket_ipv6, 40 AC_CACHE_VAL([gl_cv_socket_ipv6],
41 [AC_TRY_COMPILE([#include <sys/types.h> 41 [AC_TRY_COMPILE([#include <sys/types.h>
42#ifdef HAVE_SYS_SOCKET_H 42#ifdef HAVE_SYS_SOCKET_H
43#include <sys/socket.h> 43#include <sys/socket.h>
@@ -51,8 +51,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
51[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; 51[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
52 if (&x && &y && &z) return 0;], 52 if (&x && &y && &z) return 0;],
53 gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) 53 gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
54 AC_MSG_RESULT($gl_cv_socket_ipv6) 54 AC_MSG_RESULT([$gl_cv_socket_ipv6])
55 if test $gl_cv_socket_ipv6 = yes; then 55 if test $gl_cv_socket_ipv6 = yes; then
56 AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.]) 56 AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
57 fi 57 fi
58]) 58])
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
index 2204ecd..57c804a 100644
--- a/gl/m4/stdbool.m4
+++ b/gl/m4/stdbool.m4
@@ -1,6 +1,6 @@
1# Check for stdbool.h that conforms to C99. 1# Check for stdbool.h that conforms to C99.
2 2
3dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. 3dnl Copyright (C) 2002-2006, 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.
@@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL],
111 [ac_cv_header_stdbool_h=no])]) 111 [ac_cv_header_stdbool_h=no])])
112 AC_CHECK_TYPES([_Bool]) 112 AC_CHECK_TYPES([_Bool])
113 if test $ac_cv_header_stdbool_h = yes; then 113 if test $ac_cv_header_stdbool_h = yes; then
114 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) 114 AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
115 fi]) 115 fi])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index bb6c34f..b4194c8 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
1# stdint.m4 serial 29 1# stdint.m4 serial 33
2dnl Copyright (C) 2001-2007 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,
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,7 +9,7 @@ dnl Test whether <stdint.h> is supported or must be substituted.
9 9
10AC_DEFUN([gl_STDINT_H], 10AC_DEFUN([gl_STDINT_H],
11[ 11[
12 AC_PREREQ(2.59)dnl 12 AC_PREREQ([2.59])dnl
13 13
14 dnl Check for long long int and unsigned long long int. 14 dnl Check for long long int and unsigned long long int.
15 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 15 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
@@ -229,7 +229,7 @@ struct s {
229 gl_STDINT_TYPE_PROPERTIES 229 gl_STDINT_TYPE_PROPERTIES
230 STDINT_H=stdint.h 230 STDINT_H=stdint.h
231 fi 231 fi
232 AC_SUBST(STDINT_H) 232 AC_SUBST([STDINT_H])
233]) 233])
234 234
235dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) 235dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
@@ -240,7 +240,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
240 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 240 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
241 dnl config.h.in, 241 dnl config.h.in,
242 dnl - extra AC_SUBST calls, so that the right substitutions are made. 242 dnl - extra AC_SUBST calls, so that the right substitutions are made.
243 AC_FOREACH([gltype], [$1], 243 m4_foreach_w([gltype], [$1],
244 [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), 244 [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
245 [Define to the number of bits in type ']gltype['.])]) 245 [Define to the number of bits in type ']gltype['.])])
246 for gltype in $1 ; do 246 for gltype in $1 ; do
@@ -265,7 +265,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
265 AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) 265 AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
266 eval BITSIZEOF_${GLTYPE}=\$result 266 eval BITSIZEOF_${GLTYPE}=\$result
267 done 267 done
268 AC_FOREACH([gltype], [$1], 268 m4_foreach_w([gltype], [$1],
269 [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) 269 [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
270]) 270])
271 271
@@ -278,7 +278,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
278 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 278 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
279 dnl config.h.in, 279 dnl config.h.in,
280 dnl - extra AC_SUBST calls, so that the right substitutions are made. 280 dnl - extra AC_SUBST calls, so that the right substitutions are made.
281 AC_FOREACH([gltype], [$1], 281 m4_foreach_w([gltype], [$1],
282 [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), 282 [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
283 [Define to 1 if ']gltype[' is a signed integer type.])]) 283 [Define to 1 if ']gltype[' is a signed integer type.])])
284 for gltype in $1 ; do 284 for gltype in $1 ; do
@@ -292,13 +292,13 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
292 eval result=\$gl_cv_type_${gltype}_signed 292 eval result=\$gl_cv_type_${gltype}_signed
293 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` 293 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
294 if test "$result" = yes; then 294 if test "$result" = yes; then
295 AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) 295 AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
296 eval HAVE_SIGNED_${GLTYPE}=1 296 eval HAVE_SIGNED_${GLTYPE}=1
297 else 297 else
298 eval HAVE_SIGNED_${GLTYPE}=0 298 eval HAVE_SIGNED_${GLTYPE}=0
299 fi 299 fi
300 done 300 done
301 AC_FOREACH([gltype], [$1], 301 m4_foreach_w([gltype], [$1],
302 [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) 302 [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
303]) 303])
304 304
@@ -311,7 +311,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
311 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 311 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
312 dnl config.h.in, 312 dnl config.h.in,
313 dnl - extra AC_SUBST calls, so that the right substitutions are made. 313 dnl - extra AC_SUBST calls, so that the right substitutions are made.
314 AC_FOREACH([gltype], [$1], 314 m4_foreach_w([gltype], [$1],
315 [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], 315 [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
316 [Define to l, ll, u, ul, ull, etc., as suitable for 316 [Define to l, ll, u, ul, ull, etc., as suitable for
317 constants of type ']gltype['.])]) 317 constants of type ']gltype['.])])
@@ -337,9 +337,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
337 ui64)gltype1='unsigned __int64';; 337 ui64)gltype1='unsigned __int64';;
338 esac 338 esac
339 AC_COMPILE_IFELSE( 339 AC_COMPILE_IFELSE(
340 [AC_LANG_PROGRAM([$2 340 [AC_LANG_PROGRAM([$2[
341 extern $gltype foo; 341 extern $gltype foo;
342 extern $gltype1 foo;])], 342 extern $gltype1 foo;]])],
343 [eval gl_cv_type_${gltype}_suffix=\$glsuf]) 343 [eval gl_cv_type_${gltype}_suffix=\$glsuf])
344 eval result=\$gl_cv_type_${gltype}_suffix 344 eval result=\$gl_cv_type_${gltype}_suffix
345 test "$result" != no && break 345 test "$result" != no && break
@@ -348,9 +348,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
348 eval result=\$gl_cv_type_${gltype}_suffix 348 eval result=\$gl_cv_type_${gltype}_suffix
349 test "$result" = no && result= 349 test "$result" = no && result=
350 eval ${GLTYPE}_SUFFIX=\$result 350 eval ${GLTYPE}_SUFFIX=\$result
351 AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) 351 AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
352 done 352 done
353 AC_FOREACH([gltype], [$1], 353 m4_foreach_w([gltype], [$1],
354 [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) 354 [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
355]) 355])
356 356
@@ -373,13 +373,22 @@ dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
373dnl of interest to stdint.in.h. 373dnl of interest to stdint.in.h.
374AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], 374AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
375[ 375[
376 gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], 376 AC_REQUIRE([gl_MULTIARCH])
377 if test $APPLE_UNIVERSAL_BUILD = 0; then
378 gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
379 [gl_STDINT_INCLUDES])
380 fi
381 gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
377 [gl_STDINT_INCLUDES]) 382 [gl_STDINT_INCLUDES])
378 gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], 383 gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
379 [gl_STDINT_INCLUDES]) 384 [gl_STDINT_INCLUDES])
380 gl_cv_type_ptrdiff_t_signed=yes 385 gl_cv_type_ptrdiff_t_signed=yes
381 gl_cv_type_size_t_signed=no 386 gl_cv_type_size_t_signed=no
382 gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], 387 if test $APPLE_UNIVERSAL_BUILD = 0; then
388 gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
389 [gl_STDINT_INCLUDES])
390 fi
391 gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
383 [gl_STDINT_INCLUDES]) 392 [gl_STDINT_INCLUDES])
384]) 393])
385 394
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index db9a8ac..82f0c24 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
1# stdint_h.m4 serial 6 1# stdint_h.m4 serial 8
2dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 2dnl Copyright (C) 1997-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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
11 11
12AC_DEFUN([gl_AC_HEADER_STDINT_H], 12AC_DEFUN([gl_AC_HEADER_STDINT_H],
13[ 13[
14 AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, 14 AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
15 [AC_TRY_COMPILE( 15 [AC_TRY_COMPILE(
16 [#include <sys/types.h> 16 [#include <sys/types.h>
17#include <stdint.h>], 17#include <stdint.h>],
18 [uintmax_t i = (uintmax_t) -1; return !i;], 18 [uintmax_t i = (uintmax_t) -1; return !i;],
19 gl_cv_header_stdint_h=yes, 19 [gl_cv_header_stdint_h=yes],
20 gl_cv_header_stdint_h=no)]) 20 [gl_cv_header_stdint_h=no])])
21 if test $gl_cv_header_stdint_h = yes; then 21 if test $gl_cv_header_stdint_h = yes; then
22 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 22 AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
23 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, 23 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ]) 24 and declares uintmax_t. ])
25 fi 25 fi
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index a40d418..60b4bd7 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
1# stdio_h.m4 serial 9 1# stdio_h.m4 serial 14
2dnl Copyright (C) 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2008 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,6 +8,28 @@ AC_DEFUN([gl_STDIO_H],
8[ 8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 gl_CHECK_NEXT_HEADERS([stdio.h]) 10 gl_CHECK_NEXT_HEADERS([stdio.h])
11 dnl No need to create extra modules for these functions. Everyone who uses
12 dnl <stdio.h> likely needs them.
13 GNULIB_FPRINTF=1
14 GNULIB_PRINTF=1
15 GNULIB_VFPRINTF=1
16 GNULIB_VPRINTF=1
17 GNULIB_FPUTC=1
18 GNULIB_PUTC=1
19 GNULIB_PUTCHAR=1
20 GNULIB_FPUTS=1
21 GNULIB_PUTS=1
22 GNULIB_FWRITE=1
23 dnl This ifdef is just an optimization, to avoid performing a configure
24 dnl check whose result is not used. It does not make the test of
25 dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
26 m4_ifdef([gl_SIGNAL_SIGPIPE], [
27 gl_SIGNAL_SIGPIPE
28 if test $gl_cv_header_signal_h_SIGPIPE != yes; then
29 REPLACE_STDIO_WRITE_FUNCS=1
30 AC_LIBOBJ([stdio-write])
31 fi
32 ])
11]) 33])
12 34
13AC_DEFUN([gl_STDIO_MODULE_INDICATOR], 35AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -19,49 +41,69 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
19 41
20AC_DEFUN([gl_STDIO_H_DEFAULTS], 42AC_DEFUN([gl_STDIO_H_DEFAULTS],
21[ 43[
22 GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) 44 GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
23 GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) 45 GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
24 GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) 46 GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
25 GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) 47 GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
26 GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) 48 GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
27 GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) 49 GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
28 GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) 50 GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
29 GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) 51 GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
30 GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) 52 GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
31 GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) 53 GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
32 GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) 54 GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
33 GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) 55 GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
34 GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) 56 GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
35 GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) 57 GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
36 GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) 58 GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
37 GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) 59 GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
38 GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) 60 GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
39 GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) 61 GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
62 GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
63 GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
64 GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
65 GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
66 GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
67 GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
68 GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
69 GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
70 GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
71 GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
72 GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
73 GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
74 GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
75 GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
76 GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
40 dnl Assume proper GNU behavior unless another module says otherwise. 77 dnl Assume proper GNU behavior unless another module says otherwise.
41 REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) 78 REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
42 REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) 79 REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
43 REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) 80 REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
44 REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) 81 REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
45 REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) 82 REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
46 HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) 83 REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
47 REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) 84 HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
48 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) 85 REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
49 REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) 86 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
50 REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) 87 REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
51 HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) 88 REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
52 REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) 89 HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
53 REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) 90 REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
54 REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) 91 HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
55 HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) 92 REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
56 REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) 93 REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
57 REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) 94 REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
58 HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) 95 HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
59 REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) 96 REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
60 REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) 97 REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
61 REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) 98 HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
62 HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) 99 REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
63 HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) 100 REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
64 REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) 101 REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
102 REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
103 HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
104 HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
105 REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
106 REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
65]) 107])
66 108
67dnl Code shared by fseeko and ftello. Determine if large files are supported, 109dnl Code shared by fseeko and ftello. Determine if large files are supported,
@@ -70,8 +112,8 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
70 [ 112 [
71 AC_CACHE_CHECK([whether stdin defaults to large file offsets], 113 AC_CACHE_CHECK([whether stdin defaults to large file offsets],
72 [gl_cv_var_stdin_large_offset], 114 [gl_cv_var_stdin_large_offset],
73 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], 115 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
74[#if defined __SL64 && defined __SCLE /* cygwin */ 116[[#if defined __SL64 && defined __SCLE /* cygwin */
75 /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making 117 /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
76 fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and 118 fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
77 it is easier to do a version check than building a runtime test. */ 119 it is easier to do a version check than building a runtime test. */
@@ -79,7 +121,7 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
79# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) 121# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
80 choke me 122 choke me
81# endif 123# endif
82#endif])], 124#endif]])],
83 [gl_cv_var_stdin_large_offset=yes], 125 [gl_cv_var_stdin_large_offset=yes],
84 [gl_cv_var_stdin_large_offset=no])]) 126 [gl_cv_var_stdin_large_offset=no])])
85]) 127])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index fe4ce12..582db13 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
1# stdlib_h.m4 serial 5 1# stdlib_h.m4 serial 13
2dnl Copyright (C) 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2007, 2008 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,6 +8,9 @@ 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_TYPES([struct random_data],
12 [], [HAVE_STRUCT_RANDOM_DATA=0],
13 [[#include <stdlib.h>]])
11]) 14])
12 15
13AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], 16AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -22,21 +25,38 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
22 GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) 25 GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
23 GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) 26 GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
24 GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) 27 GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
28 GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
29 GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG])
25 GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) 30 GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
26 GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) 31 GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
27 GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) 32 GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
28 GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) 33 GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
34 GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
35 GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
29 GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) 36 GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
37 GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
38 GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
39 GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
30 GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) 40 GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
31 dnl Assume proper GNU behavior unless another module says otherwise. 41 dnl Assume proper GNU behavior unless another module says otherwise.
32 HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) 42 HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
33 HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) 43 HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
34 HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) 44 HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
35 HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) 45 HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
36 HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) 46 HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
37 HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) 47 HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
38 HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) 48 HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
39 REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) 49 HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
40 REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) 50 HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
41 VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) 51 HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
52 HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
53 HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
54 HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
55 HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
56 HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
57 HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
58 REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
59 REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
60 REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
61 VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
42]) 62])
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
deleted file mode 100644
index 8796e9e..0000000
--- a/gl/m4/strdup.m4
+++ /dev/null
@@ -1,22 +0,0 @@
1# strdup.m4 serial 9
2
3dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
4dnl Foundation, Inc.
5
6dnl This file is free software; the Free Software Foundation
7dnl gives unlimited permission to copy and/or distribute it,
8dnl with or without modifications, as long as this notice is preserved.
9
10AC_DEFUN([gl_FUNC_STRDUP],
11[
12 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
13 AC_REPLACE_FUNCS(strdup)
14 AC_CHECK_DECLS_ONCE(strdup)
15 if test $ac_cv_have_decl_strdup = no; then
16 HAVE_DECL_STRDUP=0
17 fi
18 gl_PREREQ_STRDUP
19])
20
21# Prerequisites of lib/strdup.c.
22AC_DEFUN([gl_PREREQ_STRDUP], [:])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index eb7d45a..8c16ca9 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
1# strerror.m4 serial 7 1# strerror.m4 serial 9
2dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 2007-2008 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.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_FUNC_STRERROR], 7AC_DEFUN([gl_FUNC_STRERROR],
8[ 8[
9 AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE]) 9 AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
10 if test $gl_cv_func_working_strerror = no; then 10 if test $REPLACE_STRERROR = 1; then
11 AC_LIBOBJ([strerror]) 11 AC_LIBOBJ([strerror])
12 AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR], 12 AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
13 [Define this to 1 if strerror is broken.]) 13 [Define this to 1 if strerror is broken.])
@@ -18,25 +18,38 @@ AC_DEFUN([gl_FUNC_STRERROR],
18AC_DEFUN([gl_FUNC_STRERROR_SEPARATE], 18AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
19[ 19[
20 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) 20 AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
21 AC_CACHE_CHECK([for working strerror function], 21 AC_REQUIRE([gl_HEADER_ERRNO_H])
22 [gl_cv_func_working_strerror], 22 if test -z "$ERRNO_H"; then
23 [AC_RUN_IFELSE( 23 AC_CACHE_CHECK([for working strerror function],
24 [AC_LANG_PROGRAM( 24 [gl_cv_func_working_strerror],
25 [#include <string.h> 25 [AC_RUN_IFELSE(
26 ], 26 [AC_LANG_PROGRAM(
27 [return !*strerror (-2);])], 27 [[#include <string.h>
28 [gl_cv_func_working_strerror=yes], 28 ]],
29 [gl_cv_func_working_strerror=no], 29 [[return !*strerror (-2);]])],
30 [dnl Assume crossbuild works if it compiles. 30 [gl_cv_func_working_strerror=yes],
31 AC_COMPILE_IFELSE( 31 [gl_cv_func_working_strerror=no],
32 [AC_LANG_PROGRAM( 32 [dnl Assume crossbuild works if it compiles.
33 [#include <string.h> 33 AC_COMPILE_IFELSE(
34 ], 34 [AC_LANG_PROGRAM(
35 [return !*strerror (-2);])], 35 [[#include <string.h>
36 [gl_cv_func_working_strerror=yes], 36 ]],
37 [gl_cv_func_working_strerror=no])])]) 37 [[return !*strerror (-2);]])],
38 if test $gl_cv_func_working_strerror = no ; then 38 [gl_cv_func_working_strerror=yes],
39 [gl_cv_func_working_strerror=no])
40 ])
41 ])
42 if test $gl_cv_func_working_strerror = no; then
43 dnl The system's strerror() fails to return a string for out-of-range
44 dnl integers. Replace it.
45 REPLACE_STRERROR=1
46 fi
47 else
48 dnl The system's strerror() cannot know about the new errno values we add
49 dnl to <errno.h>. Replace it.
39 REPLACE_STRERROR=1 50 REPLACE_STRERROR=1
51 fi
52 if test $REPLACE_STRERROR = 1; then
40 gl_PREREQ_STRERROR 53 gl_PREREQ_STRERROR
41 fi 54 fi
42]) 55])
@@ -44,4 +57,12 @@ AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
44# Prerequisites of lib/strerror.c. 57# Prerequisites of lib/strerror.c.
45AC_DEFUN([gl_PREREQ_STRERROR], [ 58AC_DEFUN([gl_PREREQ_STRERROR], [
46 AC_CHECK_DECLS([strerror]) 59 AC_CHECK_DECLS([strerror])
60 AC_CHECK_HEADERS_ONCE([sys/socket.h])
61 if test $ac_cv_header_sys_socket_h != yes; then
62 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
63 dnl the check for those headers unconditional; yet cygwin reports
64 dnl that the headers are present but cannot be compiled (since on
65 dnl cygwin, all socket information should come from sys/socket.h).
66 AC_CHECK_HEADERS([winsock2.h])
67 fi
47]) 68])
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 766d7e9..2d5553c 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -5,7 +5,7 @@
5# gives unlimited permission to copy and/or distribute it, 5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6# with or without modifications, as long as this notice is preserved.
7 7
8# serial 4 8# serial 6
9 9
10# Written by Paul Eggert. 10# Written by Paul Eggert.
11 11
@@ -35,6 +35,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
35 GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) 35 GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
36 GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) 36 GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
37 GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) 37 GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
38 GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR])
38 GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) 39 GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
39 GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) 40 GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
40 GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) 41 GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
@@ -62,10 +63,12 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
62 GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) 63 GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R])
63 GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) 64 GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
64 GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) 65 GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
66 GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
65 dnl Assume proper GNU behavior unless another module says otherwise. 67 dnl Assume proper GNU behavior unless another module says otherwise.
66 HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) 68 HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
67 HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) 69 HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
68 HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) 70 HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
71 HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
69 HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) 72 HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
70 HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) 73 HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
71 HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) 74 HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
@@ -79,9 +82,11 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
79 HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) 82 HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
80 HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) 83 HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR])
81 HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) 84 HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
82 REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) 85 HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
83 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
84 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) 86 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
85 REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) 87 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
86 REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) 88 REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
89 REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
90 REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
91 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
87]) 92])
diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4
index f7934ef..4fa7d5a 100644
--- a/gl/m4/strndup.m4
+++ b/gl/m4/strndup.m4
@@ -1,5 +1,5 @@
1# strndup.m4 serial 14 1# strndup.m4 serial 16
2dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -16,10 +16,10 @@ AC_DEFUN([gl_FUNC_STRNDUP],
16 fi 16 fi
17 17
18 # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. 18 # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
19 AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, 19 AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup],
20 [AC_RUN_IFELSE([ 20 [AC_RUN_IFELSE([
21 AC_LANG_PROGRAM([#include <string.h> 21 AC_LANG_PROGRAM([[#include <string.h>
22 #include <stdlib.h>], [[ 22 #include <stdlib.h>]], [[
23#ifndef HAVE_DECL_STRNDUP 23#ifndef HAVE_DECL_STRNDUP
24 extern char *strndup (const char *, size_t); 24 extern char *strndup (const char *, size_t);
25#endif 25#endif
@@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
40 [gl_cv_func_strndup=yes])], 40 [gl_cv_func_strndup=yes])],
41 [gl_cv_func_strndup=no])])]) 41 [gl_cv_func_strndup=no])])])
42 if test $gl_cv_func_strndup = yes; then 42 if test $gl_cv_func_strndup = yes; then
43 AC_DEFINE([HAVE_STRNDUP], 1, 43 AC_DEFINE([HAVE_STRNDUP], [1],
44 [Define if you have the strndup() function and it works.]) 44 [Define if you have the strndup() function and it works.])
45 else 45 else
46 HAVE_STRNDUP=0 46 HAVE_STRNDUP=0
diff --git a/gl/m4/strnlen.m4 b/gl/m4/strnlen.m4
index d8307ed..1c97859 100644
--- a/gl/m4/strnlen.m4
+++ b/gl/m4/strnlen.m4
@@ -1,5 +1,5 @@
1# strnlen.m4 serial 9 1# strnlen.m4 serial 10
2dnl Copyright (C) 2002-2003, 2005-2007 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -20,8 +20,8 @@ AC_DEFUN([gl_FUNC_STRNLEN],
20 # This is necessary because automake-1.6.1 doesn't understand 20 # This is necessary because automake-1.6.1 doesn't understand
21 # that the above use of AC_FUNC_STRNLEN means we may have to use 21 # that the above use of AC_FUNC_STRNLEN means we may have to use
22 # lib/strnlen.c. 22 # lib/strnlen.c.
23 #AC_LIBOBJ(strnlen) 23 #AC_LIBOBJ([strnlen])
24 AC_DEFINE(strnlen, rpl_strnlen, 24 AC_DEFINE([strnlen], [rpl_strnlen],
25 [Define to rpl_strnlen if the replacement function should be used.]) 25 [Define to rpl_strnlen if the replacement function should be used.])
26 gl_PREREQ_STRNLEN 26 gl_PREREQ_STRNLEN
27 fi 27 fi
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index d9659c2..85a0ace 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 4 1# sys_socket_h.m4 serial 12
2dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2005-2008 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,22 +8,43 @@ dnl From Simon Josefsson.
8 8
9AC_DEFUN([gl_HEADER_SYS_SOCKET], 9AC_DEFUN([gl_HEADER_SYS_SOCKET],
10[ 10[
11 AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
12 AC_REQUIRE([AC_C_INLINE])
13
11 AC_CACHE_CHECK([whether <sys/socket.h> is self-contained], 14 AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
12 [gl_cv_header_sys_socket_h_selfcontained], 15 [gl_cv_header_sys_socket_h_selfcontained],
13 [ 16 [
14 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])], 17 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
15 [gl_cv_header_sys_socket_h_selfcontained=yes], 18 [gl_cv_header_sys_socket_h_selfcontained=yes],
16 [gl_cv_header_sys_socket_h_selfcontained=no]) 19 [gl_cv_header_sys_socket_h_selfcontained=no])
17 ]) 20 ])
18 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then 21 if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
19 SYS_SOCKET_H='' 22 SYS_SOCKET_H=''
23 dnl If the shutdown function exists, <sys/socket.h> should define
24 dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
25 AC_CHECK_FUNCS([shutdown])
26 if test $ac_cv_func_shutdown = yes; then
27 AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
28 [gl_cv_header_sys_socket_h_shut],
29 [
30 AC_COMPILE_IFELSE(
31 [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
32 [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
33 [gl_cv_header_sys_socket_h_shut=yes],
34 [gl_cv_header_sys_socket_h_shut=no])
35 ])
36 if test $gl_cv_header_sys_socket_h_shut = no; then
37 SYS_SOCKET_H='sys/socket.h'
38 fi
39 fi
20 else 40 else
21 SYS_SOCKET_H='sys/socket.h' 41 SYS_SOCKET_H='sys/socket.h'
22 42 fi
43 if test -n "$SYS_SOCKET_H"; then
44 dnl Check prerequisites of the <sys/socket.h> replacement.
23 gl_CHECK_NEXT_HEADERS([sys/socket.h]) 45 gl_CHECK_NEXT_HEADERS([sys/socket.h])
24 if test $ac_cv_header_sys_socket_h = yes; then 46 if test $ac_cv_header_sys_socket_h = yes; then
25 HAVE_SYS_SOCKET_H=1 47 HAVE_SYS_SOCKET_H=1
26 HAVE_WINSOCK2_H=0
27 HAVE_WS2TCPIP_H=0 48 HAVE_WS2TCPIP_H=0
28 else 49 else
29 HAVE_SYS_SOCKET_H=0 50 HAVE_SYS_SOCKET_H=0
@@ -31,21 +52,66 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
31 dnl the check for those headers unconditional; yet cygwin reports 52 dnl the check for those headers unconditional; yet cygwin reports
32 dnl that the headers are present but cannot be compiled (since on 53 dnl that the headers are present but cannot be compiled (since on
33 dnl cygwin, all socket information should come from sys/socket.h). 54 dnl cygwin, all socket information should come from sys/socket.h).
34 AC_CHECK_HEADERS([winsock2.h ws2tcpip.h]) 55 AC_CHECK_HEADERS([ws2tcpip.h])
35 if test $ac_cv_header_winsock2_h = yes; then
36 HAVE_WINSOCK2_H=1
37 else
38 HAVE_WINSOCK2_H=0
39 fi
40 if test $ac_cv_header_ws2tcpip_h = yes; then 56 if test $ac_cv_header_ws2tcpip_h = yes; then
41 HAVE_WS2TCPIP_H=1 57 HAVE_WS2TCPIP_H=1
42 else 58 else
43 HAVE_WS2TCPIP_H=0 59 HAVE_WS2TCPIP_H=0
44 fi 60 fi
45 fi 61 fi
62 gl_PREREQ_SYS_H_WINSOCK2
46 AC_SUBST([HAVE_SYS_SOCKET_H]) 63 AC_SUBST([HAVE_SYS_SOCKET_H])
47 AC_SUBST([HAVE_WINSOCK2_H])
48 AC_SUBST([HAVE_WS2TCPIP_H]) 64 AC_SUBST([HAVE_WS2TCPIP_H])
49 fi 65 fi
50 AC_SUBST([SYS_SOCKET_H]) 66 AC_SUBST([SYS_SOCKET_H])
51]) 67])
68
69# Common prerequisites of of the <sys/socket.h> replacement and of the
70# <sys/select.h> replacement.
71# Sets and substitutes HAVE_WINSOCK2_H.
72AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
73[
74 m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
75 m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
76 AC_CHECK_HEADERS_ONCE([sys/socket.h])
77 if test $ac_cv_header_sys_socket_h != yes; then
78 dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
79 dnl the check for those headers unconditional; yet cygwin reports
80 dnl that the headers are present but cannot be compiled (since on
81 dnl cygwin, all socket information should come from sys/socket.h).
82 AC_CHECK_HEADERS([winsock2.h])
83 fi
84 if test "$ac_cv_header_winsock2_h" = yes; then
85 HAVE_WINSOCK2_H=1
86 UNISTD_H_HAVE_WINSOCK2_H=1
87 SYS_IOCTL_H_HAVE_WINSOCK2_H=1
88 else
89 HAVE_WINSOCK2_H=0
90 fi
91 AC_SUBST([HAVE_WINSOCK2_H])
92])
93
94AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
95[
96 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
97 AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
98 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
99])
100
101AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
102[
103 GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
104 GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
105 GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
106 GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
107 GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
108 GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
109 GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
110 GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
111 GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
112 GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
113 GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
114 GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
115 GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
116 GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])
117])
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
new file mode 100644
index 0000000..3dd38aa
--- /dev/null
+++ b/gl/m4/threadlib.m4
@@ -0,0 +1,313 @@
1# threadlib.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2005-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 From Bruno Haible.
8
9dnl gl_THREADLIB
10dnl ------------
11dnl Tests for a multithreading library to be used.
12dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
13dnl USE_PTH_THREADS, USE_WIN32_THREADS
14dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
15dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
16dnl libtool).
17dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
18dnl programs that really need multithread functionality. The difference
19dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
20dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
21dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
22dnl multithread-safe programs.
23
24AC_DEFUN([gl_THREADLIB_EARLY],
25[
26 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
27])
28
29dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
30
31AC_DEFUN([gl_THREADLIB_EARLY_BODY],
32[
33 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
34 dnl influences the result of the autoconf tests that test for *_unlocked
35 dnl declarations, on AIX 5 at least. Therefore it must come early.
36 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
37 AC_BEFORE([$0], [gl_ARGP])dnl
38
39 AC_REQUIRE([AC_CANONICAL_HOST])
40 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
41 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
42 dnl AC_GNU_SOURCE.
43 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
44 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
45 [AC_REQUIRE([AC_GNU_SOURCE])])
46 dnl Check for multithreading.
47 m4_divert_text([DEFAULTS], [gl_use_threads_default=])
48 AC_ARG_ENABLE([threads],
49AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
50AC_HELP_STRING([--disable-threads], [build without multithread safety]),
51 [gl_use_threads=$enableval],
52 [if test -n "$gl_use_threads_default"; then
53 gl_use_threads="$gl_use_threads_default"
54 else
55 case "$host_os" in
56 dnl Disable multithreading by default on OSF/1, because it interferes
57 dnl with fork()/exec(): When msgexec is linked with -lpthread, its
58 dnl child process gets an endless segmentation fault inside execvp().
59 osf*) gl_use_threads=no ;;
60 *) gl_use_threads=yes ;;
61 esac
62 fi
63 ])
64 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
65 # For using <pthread.h>:
66 case "$host_os" in
67 osf*)
68 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
69 # groks <pthread.h>. cc also understands the flag -pthread, but
70 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
71 # 2. putting a flag into CPPFLAGS that has an effect on the linker
72 # causes the AC_TRY_LINK test below to succeed unexpectedly,
73 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
74 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
75 ;;
76 esac
77 # Some systems optimize for single-threaded programs by default, and
78 # need special flags to disable these optimizations. For example, the
79 # definition of 'errno' in <errno.h>.
80 case "$host_os" in
81 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
82 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
83 esac
84 fi
85])
86
87dnl The guts of gl_THREADLIB. Needs to be expanded only once.
88
89AC_DEFUN([gl_THREADLIB_BODY],
90[
91 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
92 gl_threads_api=none
93 LIBTHREAD=
94 LTLIBTHREAD=
95 LIBMULTITHREAD=
96 LTLIBMULTITHREAD=
97 if test "$gl_use_threads" != no; then
98 dnl Check whether the compiler and linker support weak declarations.
99 AC_MSG_CHECKING([whether imported symbols can be declared weak])
100 gl_have_weak=no
101 AC_TRY_LINK([extern void xyzzy ();
102#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
103 AC_MSG_RESULT([$gl_have_weak])
104 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
105 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
106 # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
107 AC_CHECK_HEADER([pthread.h],
108 [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
109 if test "$gl_have_pthread_h" = yes; then
110 # Other possible tests:
111 # -lpthreads (FSU threads, PCthreads)
112 # -lgthreads
113 gl_have_pthread=
114 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
115 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
116 # the second one only in libpthread, and lock.c needs it.
117 AC_TRY_LINK([#include <pthread.h>],
118 [pthread_mutex_lock((pthread_mutex_t*)0);
119 pthread_mutexattr_init((pthread_mutexattr_t*)0);],
120 [gl_have_pthread=yes])
121 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
122 # since it is defined as a macro on OSF/1.)
123 if test -n "$gl_have_pthread"; then
124 # The program links fine without libpthread. But it may actually
125 # need to link with libpthread in order to create multiple threads.
126 AC_CHECK_LIB([pthread], [pthread_kill],
127 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
128 # On Solaris and HP-UX, most pthread functions exist also in libc.
129 # Therefore pthread_in_use() needs to actually try to create a
130 # thread: pthread_create from libc will fail, whereas
131 # pthread_create will actually create a thread.
132 case "$host_os" in
133 solaris* | hpux*)
134 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
135 [Define if the pthread_in_use() detection is hard.])
136 esac
137 ])
138 else
139 # Some library is needed. Try libpthread and libc_r.
140 AC_CHECK_LIB([pthread], [pthread_kill],
141 [gl_have_pthread=yes
142 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
143 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
144 if test -z "$gl_have_pthread"; then
145 # For FreeBSD 4.
146 AC_CHECK_LIB([c_r], [pthread_kill],
147 [gl_have_pthread=yes
148 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
149 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
150 fi
151 fi
152 if test -n "$gl_have_pthread"; then
153 gl_threads_api=posix
154 AC_DEFINE([USE_POSIX_THREADS], [1],
155 [Define if the POSIX multithreading library can be used.])
156 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
157 if test $gl_have_weak = yes; then
158 AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
159 [Define if references to the POSIX multithreading library should be made weak.])
160 LIBTHREAD=
161 LTLIBTHREAD=
162 fi
163 fi
164 fi
165 fi
166 fi
167 if test -z "$gl_have_pthread"; then
168 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
169 gl_have_solaristhread=
170 gl_save_LIBS="$LIBS"
171 LIBS="$LIBS -lthread"
172 AC_TRY_LINK([#include <thread.h>
173#include <synch.h>],
174 [thr_self();],
175 [gl_have_solaristhread=yes])
176 LIBS="$gl_save_LIBS"
177 if test -n "$gl_have_solaristhread"; then
178 gl_threads_api=solaris
179 LIBTHREAD=-lthread
180 LTLIBTHREAD=-lthread
181 LIBMULTITHREAD="$LIBTHREAD"
182 LTLIBMULTITHREAD="$LTLIBTHREAD"
183 AC_DEFINE([USE_SOLARIS_THREADS], [1],
184 [Define if the old Solaris multithreading library can be used.])
185 if test $gl_have_weak = yes; then
186 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
187 [Define if references to the old Solaris multithreading library should be made weak.])
188 LIBTHREAD=
189 LTLIBTHREAD=
190 fi
191 fi
192 fi
193 fi
194 if test "$gl_use_threads" = pth; then
195 gl_save_CPPFLAGS="$CPPFLAGS"
196 AC_LIB_LINKFLAGS([pth])
197 gl_have_pth=
198 gl_save_LIBS="$LIBS"
199 LIBS="$LIBS -lpth"
200 AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
201 LIBS="$gl_save_LIBS"
202 if test -n "$gl_have_pth"; then
203 gl_threads_api=pth
204 LIBTHREAD="$LIBPTH"
205 LTLIBTHREAD="$LTLIBPTH"
206 LIBMULTITHREAD="$LIBTHREAD"
207 LTLIBMULTITHREAD="$LTLIBTHREAD"
208 AC_DEFINE([USE_PTH_THREADS], [1],
209 [Define if the GNU Pth multithreading library can be used.])
210 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
211 if test $gl_have_weak = yes; then
212 AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
213 [Define if references to the GNU Pth multithreading library should be made weak.])
214 LIBTHREAD=
215 LTLIBTHREAD=
216 fi
217 fi
218 else
219 CPPFLAGS="$gl_save_CPPFLAGS"
220 fi
221 fi
222 if test -z "$gl_have_pthread"; then
223 if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
224 if { case "$host_os" in
225 mingw*) true;;
226 *) false;;
227 esac
228 }; then
229 gl_threads_api=win32
230 AC_DEFINE([USE_WIN32_THREADS], [1],
231 [Define if the Win32 multithreading API can be used.])
232 fi
233 fi
234 fi
235 fi
236 AC_MSG_CHECKING([for multithread API to use])
237 AC_MSG_RESULT([$gl_threads_api])
238 AC_SUBST([LIBTHREAD])
239 AC_SUBST([LTLIBTHREAD])
240 AC_SUBST([LIBMULTITHREAD])
241 AC_SUBST([LTLIBMULTITHREAD])
242])
243
244AC_DEFUN([gl_THREADLIB],
245[
246 AC_REQUIRE([gl_THREADLIB_EARLY])
247 AC_REQUIRE([gl_THREADLIB_BODY])
248])
249
250
251dnl gl_DISABLE_THREADS
252dnl ------------------
253dnl Sets the gl_THREADLIB default so that threads are not used by default.
254dnl The user can still override it at installation time, by using the
255dnl configure option '--enable-threads'.
256
257AC_DEFUN([gl_DISABLE_THREADS], [
258 m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
259])
260
261
262dnl Survey of platforms:
263dnl
264dnl Platform Available Compiler Supports test-lock
265dnl flavours option weak result
266dnl --------------- --------- --------- -------- ---------
267dnl Linux 2.4/glibc posix -lpthread Y OK
268dnl
269dnl GNU Hurd/glibc posix
270dnl
271dnl FreeBSD 5.3 posix -lc_r Y
272dnl posix -lkse ? Y
273dnl posix -lpthread ? Y
274dnl posix -lthr Y
275dnl
276dnl FreeBSD 5.2 posix -lc_r Y
277dnl posix -lkse Y
278dnl posix -lthr Y
279dnl
280dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
281dnl
282dnl NetBSD 1.6 --
283dnl
284dnl OpenBSD 3.4 posix -lpthread Y OK
285dnl
286dnl MacOS X 10.[123] posix -lpthread Y OK
287dnl
288dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
289dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
290dnl
291dnl HP-UX 11 posix -lpthread N (cc) OK
292dnl Y (gcc)
293dnl
294dnl IRIX 6.5 posix -lpthread Y 0.5
295dnl
296dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
297dnl
298dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
299dnl -lpthread (gcc) Y
300dnl
301dnl Cygwin posix -lpthread Y OK
302dnl
303dnl Any of the above pth -lpth 0.0
304dnl
305dnl Mingw win32 N OK
306dnl
307dnl BeOS 5 --
308dnl
309dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
310dnl turned off:
311dnl OK if all three tests terminate OK,
312dnl 0.5 if the first test terminates OK but the second one loops endlessly,
313dnl 0.0 if the first test already loops endlessly.
diff --git a/gl/m4/uintmax_t.m4 b/gl/m4/uintmax_t.m4
index 641c489..734b693 100644
--- a/gl/m4/uintmax_t.m4
+++ b/gl/m4/uintmax_t.m4
@@ -1,12 +1,12 @@
1# uintmax_t.m4 serial 10 1# uintmax_t.m4 serial 12
2dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 1997-2004, 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.
6 6
7dnl From Paul Eggert. 7dnl From Paul Eggert.
8 8
9AC_PREREQ(2.13) 9AC_PREREQ([2.13])
10 10
11# Define uintmax_t to 'unsigned long' or 'unsigned long long' 11# Define uintmax_t to 'unsigned long' or 'unsigned long long'
12# if it is not already defined in <stdint.h> or <inttypes.h>. 12# if it is not already defined in <stdint.h> or <inttypes.h>.
@@ -20,11 +20,11 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
20 test $ac_cv_type_unsigned_long_long_int = yes \ 20 test $ac_cv_type_unsigned_long_long_int = yes \
21 && ac_type='unsigned long long' \ 21 && ac_type='unsigned long long' \
22 || ac_type='unsigned long' 22 || ac_type='unsigned long'
23 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 23 AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
24 [Define to unsigned long or unsigned long long 24 [Define to unsigned long or unsigned long long
25 if <stdint.h> and <inttypes.h> don't define.]) 25 if <stdint.h> and <inttypes.h> don't define.])
26 else 26 else
27 AC_DEFINE(HAVE_UINTMAX_T, 1, 27 AC_DEFINE([HAVE_UINTMAX_T], [1],
28 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) 28 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
29 fi 29 fi
30]) 30])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 4b8857c..5685273 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
1# unistd_h.m4 serial 10 1# unistd_h.m4 serial 16
2dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2008 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,30 +32,50 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
32 32
33AC_DEFUN([gl_UNISTD_H_DEFAULTS], 33AC_DEFUN([gl_UNISTD_H_DEFAULTS],
34[ 34[
35 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) 35 GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
36 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) 36 GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
37 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) 37 GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
38 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) 38 GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
39 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) 39 GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
40 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) 40 GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
41 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) 41 GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
42 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) 42 GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
43 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) 43 GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
44 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) 44 GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
45 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) 45 GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
46 GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
47 GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
48 GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
49 GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
50 GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
51 GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
52 GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
53 GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
54 GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
55 GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
46 dnl Assume proper GNU behavior unless another module says otherwise. 56 dnl Assume proper GNU behavior unless another module says otherwise.
47 HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) 57 HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
58 HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
59 HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
48 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) 60 HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
61 HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME])
62 HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
63 HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
49 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) 64 HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
65 HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL])
50 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) 66 HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
51 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) 67 HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
68 HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
52 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) 69 HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
53 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) 70 HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
54 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) 71 HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
55 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) 72 REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
73 REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
56 REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) 74 REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
57 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) 75 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
58 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) 76 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
59 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) 77 REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
60 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) 78 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
79 REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
80 UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
61]) 81])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index c4d3f4f..9e839d2 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,12 +1,11 @@
1# vasnprintf.m4 serial 24 1# vasnprintf.m4 serial 26
2dnl Copyright (C) 2002-2004, 2006-2008 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,
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_FUNC_VASNPRINTF], 7AC_DEFUN([gl_FUNC_VASNPRINTF],
8[ 8[
9 AC_REQUIRE([gl_EOVERFLOW])
10 AC_CHECK_FUNCS_ONCE([vasnprintf]) 9 AC_CHECK_FUNCS_ONCE([vasnprintf])
11 if test $ac_cv_func_vasnprintf = no; then 10 if test $ac_cv_func_vasnprintf = no; then
12 gl_REPLACE_VASNPRINTF 11 gl_REPLACE_VASNPRINTF
@@ -21,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
21 AC_LIBOBJ([printf-parse]) 20 AC_LIBOBJ([printf-parse])
22 AC_LIBOBJ([asnprintf]) 21 AC_LIBOBJ([asnprintf])
23 if test $ac_cv_func_vasnprintf = yes; then 22 if test $ac_cv_func_vasnprintf = yes; then
24 AC_DEFINE([REPLACE_VASNPRINTF], 1, 23 AC_DEFINE([REPLACE_VASNPRINTF], [1],
25 [Define if vasnprintf exists but is overridden by gnulib.]) 24 [Define if vasnprintf exists but is overridden by gnulib.])
26 fi 25 fi
27 gl_PREREQ_PRINTF_ARGS 26 gl_PREREQ_PRINTF_ARGS
@@ -59,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
59 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 58 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
60 AC_REQUIRE([gt_TYPE_WCHAR_T]) 59 AC_REQUIRE([gt_TYPE_WCHAR_T])
61 AC_REQUIRE([gt_TYPE_WINT_T]) 60 AC_REQUIRE([gt_TYPE_WINT_T])
62 AC_CHECK_FUNCS(snprintf wcslen) 61 AC_CHECK_FUNCS([snprintf wcslen])
63 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
64 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).
65 AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) 64 AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
@@ -74,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
74 *yes) 73 *yes)
75 ;; 74 ;;
76 *) 75 *)
77 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, 76 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
78 [Define if the vasnprintf implementation needs special code for 77 [Define if the vasnprintf implementation needs special code for
79 'long double' arguments.]) 78 'long double' arguments.])
80 ;; 79 ;;
@@ -90,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
90 *yes) 89 *yes)
91 ;; 90 ;;
92 *) 91 *)
93 AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, 92 AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1],
94 [Define if the vasnprintf implementation needs special code for 93 [Define if the vasnprintf implementation needs special code for
95 infinite 'double' arguments.]) 94 infinite 'double' arguments.])
96 ;; 95 ;;
@@ -111,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
111 *yes) 110 *yes)
112 ;; 111 ;;
113 *) 112 *)
114 AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, 113 AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1],
115 [Define if the vasnprintf implementation needs special code for 114 [Define if the vasnprintf implementation needs special code for
116 infinite 'long double' arguments.]) 115 infinite 'long double' arguments.])
117 ;; 116 ;;
@@ -128,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
128 *yes) 127 *yes)
129 ;; 128 ;;
130 *) 129 *)
131 AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, 130 AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
132 [Define if the vasnprintf implementation needs special code for 131 [Define if the vasnprintf implementation needs special code for
133 the 'a' and 'A' directives.]) 132 the 'a' and 'A' directives.])
134 AC_CHECK_FUNCS([nl_langinfo]) 133 AC_CHECK_FUNCS([nl_langinfo])
@@ -144,7 +143,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
144 *yes) 143 *yes)
145 ;; 144 ;;
146 *) 145 *)
147 AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, 146 AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1],
148 [Define if the vasnprintf implementation needs special code for 147 [Define if the vasnprintf implementation needs special code for
149 the 'F' directive.]) 148 the 'F' directive.])
150 ;; 149 ;;
@@ -159,7 +158,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
159 *yes) 158 *yes)
160 ;; 159 ;;
161 *) 160 *)
162 AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, 161 AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1],
163 [Define if the vasnprintf implementation needs special code for the 162 [Define if the vasnprintf implementation needs special code for the
164 ' flag.]) 163 ' flag.])
165 ;; 164 ;;
@@ -174,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
174 *yes) 173 *yes)
175 ;; 174 ;;
176 *) 175 *)
177 AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, 176 AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1],
178 [Define if the vasnprintf implementation needs special code for the 177 [Define if the vasnprintf implementation needs special code for the
179 '-' flag.]) 178 '-' flag.])
180 ;; 179 ;;
@@ -189,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
189 *yes) 188 *yes)
190 ;; 189 ;;
191 *) 190 *)
192 AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, 191 AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1],
193 [Define if the vasnprintf implementation needs special code for the 192 [Define if the vasnprintf implementation needs special code for the
194 0 flag.]) 193 0 flag.])
195 ;; 194 ;;
@@ -204,13 +203,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
204 *yes) 203 *yes)
205 ;; 204 ;;
206 *) 205 *)
207 AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, 206 AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1],
208 [Define if the vasnprintf implementation needs special code for 207 [Define if the vasnprintf implementation needs special code for
209 supporting large precisions without arbitrary bounds.]) 208 supporting large precisions without arbitrary bounds.])
210 AC_DEFINE([NEED_PRINTF_DOUBLE], 1, 209 AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
211 [Define if the vasnprintf implementation needs special code for 210 [Define if the vasnprintf implementation needs special code for
212 'double' arguments.]) 211 'double' arguments.])
213 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, 212 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
214 [Define if the vasnprintf implementation needs special code for 213 [Define if the vasnprintf implementation needs special code for
215 'long double' arguments.]) 214 'long double' arguments.])
216 ;; 215 ;;
@@ -226,13 +225,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
226 *yes) 225 *yes)
227 ;; 226 ;;
228 *) 227 *)
229 AC_DEFINE([NEED_PRINTF_ENOMEM], 1, 228 AC_DEFINE([NEED_PRINTF_ENOMEM], [1],
230 [Define if the vasnprintf implementation needs special code for 229 [Define if the vasnprintf implementation needs special code for
231 surviving out-of-memory conditions.]) 230 surviving out-of-memory conditions.])
232 AC_DEFINE([NEED_PRINTF_DOUBLE], 1, 231 AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
233 [Define if the vasnprintf implementation needs special code for 232 [Define if the vasnprintf implementation needs special code for
234 'double' arguments.]) 233 'double' arguments.])
235 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, 234 AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
236 [Define if the vasnprintf implementation needs special code for 235 [Define if the vasnprintf implementation needs special code for
237 'long double' arguments.]) 236 'long double' arguments.])
238 ;; 237 ;;
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 2ff6330..70bca56 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
1# visibility.m4 serial 1 (gettext-0.15) 1# visibility.m4 serial 2 (gettext-0.18)
2dnl Copyright (C) 2005 Free Software Foundation, Inc. 2dnl Copyright (C) 2005, 2008 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.
@@ -27,7 +27,7 @@ AC_DEFUN([gl_VISIBILITY],
27 HAVE_VISIBILITY=0 27 HAVE_VISIBILITY=0
28 if test -n "$GCC"; then 28 if test -n "$GCC"; then
29 AC_MSG_CHECKING([for simple visibility declarations]) 29 AC_MSG_CHECKING([for simple visibility declarations])
30 AC_CACHE_VAL(gl_cv_cc_visibility, [ 30 AC_CACHE_VAL([gl_cv_cc_visibility], [
31 gl_save_CFLAGS="$CFLAGS" 31 gl_save_CFLAGS="$CFLAGS"
32 CFLAGS="$CFLAGS -fvisibility=hidden" 32 CFLAGS="$CFLAGS -fvisibility=hidden"
33 AC_TRY_COMPILE( 33 AC_TRY_COMPILE(
@@ -36,8 +36,8 @@ AC_DEFUN([gl_VISIBILITY],
36 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); 36 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
37 extern __attribute__((__visibility__("default"))) int exportedfunc (void);], 37 extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
38 [], 38 [],
39 gl_cv_cc_visibility=yes, 39 [gl_cv_cc_visibility=yes],
40 gl_cv_cc_visibility=no) 40 [gl_cv_cc_visibility=no])
41 CFLAGS="$gl_save_CFLAGS"]) 41 CFLAGS="$gl_save_CFLAGS"])
42 AC_MSG_RESULT([$gl_cv_cc_visibility]) 42 AC_MSG_RESULT([$gl_cv_cc_visibility])
43 if test $gl_cv_cc_visibility = yes; then 43 if test $gl_cv_cc_visibility = yes; then
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
index accc79f..3b37d46 100644
--- a/gl/m4/vsnprintf.m4
+++ b/gl/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
1# vsnprintf.m4 serial 4 1# vsnprintf.m4 serial 5
2dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2004, 2007-2008 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.
@@ -7,8 +7,17 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_FUNC_VSNPRINTF], 7AC_DEFUN([gl_FUNC_VSNPRINTF],
8[ 8[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 gl_cv_func_vsnprintf_usable=no
10 AC_CHECK_FUNCS([vsnprintf]) 11 AC_CHECK_FUNCS([vsnprintf])
11 if test $ac_cv_func_vsnprintf = no; then 12 if test $ac_cv_func_vsnprintf = yes; then
13 gl_SNPRINTF_SIZE1
14 case "$gl_cv_func_snprintf_size1" in
15 *yes)
16 gl_cv_func_vsnprintf_usable=yes
17 ;;
18 esac
19 fi
20 if test $gl_cv_func_vsnprintf_usable = no; then
12 gl_REPLACE_VSNPRINTF 21 gl_REPLACE_VSNPRINTF
13 fi 22 fi
14 AC_CHECK_DECLS_ONCE([vsnprintf]) 23 AC_CHECK_DECLS_ONCE([vsnprintf])
diff --git a/gl/m4/wchar.m4 b/gl/m4/wchar.m4
index 70b1248..ba8ee6a 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 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2008 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 4 10# wchar.m4 serial 22
11 11
12AC_DEFUN([gl_WCHAR_H], 12AC_DEFUN([gl_WCHAR_H],
13[ 13[
@@ -18,7 +18,16 @@ AC_DEFUN([gl_WCHAR_H],
18wchar_t w;]], 18wchar_t w;]],
19 [gl_cv_header_wchar_h_standalone=yes], 19 [gl_cv_header_wchar_h_standalone=yes],
20 [gl_cv_header_wchar_h_standalone=no])]) 20 [gl_cv_header_wchar_h_standalone=no])])
21 if test $gl_cv_header_wchar_h_standalone != yes; then 21
22 AC_REQUIRE([gt_TYPE_WINT_T])
23 if test $gt_cv_c_wint_t = yes; then
24 HAVE_WINT_T=1
25 else
26 HAVE_WINT_T=0
27 fi
28 AC_SUBST([HAVE_WINT_T])
29
30 if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
22 WCHAR_H=wchar.h 31 WCHAR_H=wchar.h
23 fi 32 fi
24 33
@@ -36,6 +45,13 @@ wchar_t w;]],
36 gl_CHECK_NEXT_HEADERS([wchar.h]) 45 gl_CHECK_NEXT_HEADERS([wchar.h])
37]) 46])
38 47
48dnl Unconditionally enables the replacement of <wchar.h>.
49AC_DEFUN([gl_REPLACE_WCHAR_H],
50[
51 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
52 WCHAR_H=wchar.h
53])
54
39AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], 55AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
40[ 56[
41 dnl Use AC_REQUIRE here, so that the default settings are expanded once only. 57 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -45,10 +61,39 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
45 61
46AC_DEFUN([gl_WCHAR_H_DEFAULTS], 62AC_DEFUN([gl_WCHAR_H_DEFAULTS],
47[ 63[
48 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) 64 GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
65 GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
66 GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
67 GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
68 GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
69 GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
70 GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
71 GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
72 GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
73 GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
74 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
49 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])
77 HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
78 HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
79 HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
80 HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
81 HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
82 HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
83 HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
84 HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
85 HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
50 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])
88 REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
89 REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
90 REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
91 REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
92 REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
93 REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
94 REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
95 REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
96 REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
51 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) 97 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
52 WCHAR_H= 98 WCHAR_H=''; AC_SUBST([WCHAR_H])
53 AC_SUBST([WCHAR_H])
54]) 99])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index cde2129..fb27a7f 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
1# wchar_t.m4 serial 1 (gettext-0.12) 1# wchar_t.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2003, 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.
@@ -10,11 +10,11 @@ dnl Prerequisite: AC_PROG_CC
10 10
11AC_DEFUN([gt_TYPE_WCHAR_T], 11AC_DEFUN([gt_TYPE_WCHAR_T],
12[ 12[
13 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, 13 AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
14 [AC_TRY_COMPILE([#include <stddef.h> 14 [AC_TRY_COMPILE([#include <stddef.h>
15 wchar_t foo = (wchar_t)'\0';], , 15 wchar_t foo = (wchar_t)'\0';], ,
16 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) 16 [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
17 if test $gt_cv_c_wchar_t = yes; then 17 if test $gt_cv_c_wchar_t = yes; then
18 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) 18 AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
19 fi 19 fi
20]) 20])
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
new file mode 100644
index 0000000..22d9433
--- /dev/null
+++ b/gl/m4/wcrtomb.m4
@@ -0,0 +1,88 @@
1# wcrtomb.m4 serial 2
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_FUNC_WCRTOMB],
8[
9 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10
11 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 AC_CHECK_FUNCS_ONCE([wcrtomb])
13 if test $ac_cv_func_wcrtomb = no; then
14 HAVE_WCRTOMB=0
15 else
16
17 dnl On OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
18 dnl returns 0 instead of 1.
19 AC_REQUIRE([AC_PROG_CC])
20 AC_REQUIRE([gt_LOCALE_FR])
21 AC_REQUIRE([gt_LOCALE_FR_UTF8])
22 AC_REQUIRE([gt_LOCALE_JA])
23 AC_REQUIRE([gt_LOCALE_ZH_CN])
24 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
25 AC_CACHE_CHECK([whether wcrtomb return value is correct],
26 [gl_cv_func_wcrtomb_retval],
27 [
28 dnl Initial guess, used when cross-compiling or when no suitable locale
29 dnl is present.
30changequote(,)dnl
31 case "$host_os" in
32 # Guess no on OSF/1 and Solaris.
33 osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
34 # Guess yes otherwise.
35 *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
36 esac
37changequote([,])dnl
38 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
39 AC_TRY_RUN([
40#include <locale.h>
41#include <stdio.h>
42#include <string.h>
43#include <wchar.h>
44int main ()
45{
46 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
47 {
48 if (wcrtomb (NULL, 0, NULL) != 1)
49 return 1;
50 }
51 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
52 {
53 if (wcrtomb (NULL, 0, NULL) != 1)
54 return 1;
55 }
56 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
57 {
58 if (wcrtomb (NULL, 0, NULL) != 1)
59 return 1;
60 }
61 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
62 {
63 if (wcrtomb (NULL, 0, NULL) != 1)
64 return 1;
65 }
66 return 0;
67}],
68 [gl_cv_func_wcrtomb_retval=yes],
69 [gl_cv_func_wcrtomb_retval=no],
70 [])
71 fi
72 ])
73 case "$gl_cv_func_wcrtomb_retval" in
74 *yes) ;;
75 *) REPLACE_WCRTOMB=1 ;;
76 esac
77 fi
78 if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
79 gl_REPLACE_WCHAR_H
80 AC_LIBOBJ([wcrtomb])
81 gl_PREREQ_WCRTOMB
82 fi
83])
84
85# Prerequisites of lib/wcrtomb.c.
86AC_DEFUN([gl_PREREQ_WCRTOMB], [
87 :
88])
diff --git a/gl/m4/wctype.m4 b/gl/m4/wctype.m4
index 7483c4f..6a1b6f0 100644
--- a/gl/m4/wctype.m4
+++ b/gl/m4/wctype.m4
@@ -1,6 +1,8 @@
1# wctype.m4 serial 2
2
1dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. 3dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
2 4
3dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. 5dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 6dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 7dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 8dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +11,7 @@ dnl Written by Paul Eggert.
9 11
10AC_DEFUN([gl_WCTYPE_H], 12AC_DEFUN([gl_WCTYPE_H],
11[ 13[
14 AC_REQUIRE([AC_PROG_CC])
12 AC_CHECK_FUNCS_ONCE([iswcntrl]) 15 AC_CHECK_FUNCS_ONCE([iswcntrl])
13 if test $ac_cv_func_iswcntrl = yes; then 16 if test $ac_cv_func_iswcntrl = yes; then
14 HAVE_ISWCNTRL=1 17 HAVE_ISWCNTRL=1
@@ -30,7 +33,27 @@ AC_DEFUN([gl_WCTYPE_H],
30 WCTYPE_H=wctype.h 33 WCTYPE_H=wctype.h
31 if test $ac_cv_header_wctype_h = yes; then 34 if test $ac_cv_header_wctype_h = yes; then
32 if test $ac_cv_func_iswcntrl = yes; then 35 if test $ac_cv_func_iswcntrl = yes; then
33 WCTYPE_H= 36 dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
37 dnl The other functions are likely broken in the same way.
38 AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
39 [
40 AC_TRY_RUN([#include <stddef.h>
41 #include <stdio.h>
42 #include <time.h>
43 #include <wchar.h>
44 #include <wctype.h>
45 int main () { return iswprint ('x') == 0; }],
46 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
47 [AC_TRY_COMPILE([#include <stdlib.h>
48 #if __GNU_LIBRARY__ == 1
49 Linux libc5 i18n is broken.
50 #endif], [],
51 [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
52 ])
53 ])
54 if test $gl_cv_func_iswcntrl_works = yes; then
55 WCTYPE_H=
56 fi
34 fi 57 fi
35 dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty, 58 dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
36 dnl for the benefit of builds from non-distclean directories. 59 dnl for the benefit of builds from non-distclean directories.
@@ -41,4 +64,11 @@ AC_DEFUN([gl_WCTYPE_H],
41 fi 64 fi
42 AC_SUBST([HAVE_WCTYPE_H]) 65 AC_SUBST([HAVE_WCTYPE_H])
43 AC_SUBST([WCTYPE_H]) 66 AC_SUBST([WCTYPE_H])
67
68 if test "$gl_cv_func_iswcntrl_works" = no; then
69 REPLACE_ISWCNTRL=1
70 else
71 REPLACE_ISWCNTRL=0
72 fi
73 AC_SUBST([REPLACE_ISWCNTRL])
44]) 74])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index af5ed93..47a4363 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
1# wint_t.m4 serial 2 (gettext-0.17) 1# wint_t.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 2003, 2007 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,7 @@ dnl Prerequisite: AC_PROG_CC
10 10
11AC_DEFUN([gt_TYPE_WINT_T], 11AC_DEFUN([gt_TYPE_WINT_T],
12[ 12[
13 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, 13 AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
14 [AC_TRY_COMPILE([ 14 [AC_TRY_COMPILE([
15/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before 15/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16 <wchar.h>. 16 <wchar.h>.
@@ -21,8 +21,8 @@ AC_DEFUN([gt_TYPE_WINT_T],
21#include <time.h> 21#include <time.h>
22#include <wchar.h> 22#include <wchar.h>
23 wint_t foo = (wchar_t)'\0';], , 23 wint_t foo = (wchar_t)'\0';], ,
24 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) 24 [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
25 if test $gt_cv_c_wint_t = yes; then 25 if test $gt_cv_c_wint_t = yes; then
26 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) 26 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
27 fi 27 fi
28]) 28])
diff --git a/gl/m4/write.m4 b/gl/m4/write.m4
new file mode 100644
index 0000000..812b19b
--- /dev/null
+++ b/gl/m4/write.m4
@@ -0,0 +1,20 @@
1# write.m4 serial 1
2dnl Copyright (C) 2008 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
7AC_DEFUN([gl_FUNC_WRITE],
8[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 dnl This ifdef is just an optimization, to avoid performing a configure
11 dnl check whose result is not used. It does not make the test of
12 dnl GNULIB_UNISTD_H_SIGPIPE or GNULIB_SIGPIPE redundant.
13 m4_ifdef([gl_SIGNAL_SIGPIPE], [
14 gl_SIGNAL_SIGPIPE
15 if test $gl_cv_header_signal_h_SIGPIPE != yes; then
16 REPLACE_WRITE=1
17 AC_LIBOBJ([write])
18 fi
19 ])
20])
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index 85bb721..631893c 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
1# xsize.m4 serial 3 1# xsize.m4 serial 4
2dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. 2dnl Copyright (C) 2003-2004, 2008 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,5 +9,5 @@ AC_DEFUN([gl_XSIZE],
9 dnl Prerequisites of lib/xsize.h. 9 dnl Prerequisites of lib/xsize.h.
10 AC_REQUIRE([gl_SIZE_MAX]) 10 AC_REQUIRE([gl_SIZE_MAX])
11 AC_REQUIRE([AC_C_INLINE]) 11 AC_REQUIRE([AC_C_INLINE])
12 AC_CHECK_HEADERS(stdint.h) 12 AC_CHECK_HEADERS([stdint.h])
13]) 13])