diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2009-09-14 12:34:37 +0200 |
---|---|---|
committer | Andreas Rottmann <a.rottmann@gmx.at> | 2009-09-14 12:34:37 +0200 |
commit | 3bebb94360f1c2333feb8d504a9fa4f96984d8b7 (patch) | |
tree | a8aaac2174791365ed3e9975ae81106a47902f2a /gnulib-m4 | |
parent | fa095a4504cbe668e4244547e2c141597bea4ecf (diff) |
Imported Upstream version 0.9.1.1upstream/0.9.1.1
Diffstat (limited to 'gnulib-m4')
-rw-r--r-- | gnulib-m4/dup2.m4 | 35 | ||||
-rw-r--r-- | gnulib-m4/fcntl_h.m4 | 96 | ||||
-rw-r--r-- | gnulib-m4/gnulib-comp.m4 | 24 | ||||
-rw-r--r-- | gnulib-m4/iconv.m4 | 6 | ||||
-rw-r--r-- | gnulib-m4/locale_h.m4 | 10 | ||||
-rw-r--r-- | gnulib-m4/mode_t.m4 | 26 | ||||
-rw-r--r-- | gnulib-m4/open.m4 | 65 | ||||
-rw-r--r-- | gnulib-m4/stddef_h.m4 | 45 | ||||
-rw-r--r-- | gnulib-m4/unistd_h.m4 | 6 | ||||
-rw-r--r-- | gnulib-m4/wchar.m4 | 7 | ||||
-rw-r--r-- | gnulib-m4/wcwidth.m4 | 15 |
11 files changed, 321 insertions, 14 deletions
diff --git a/gnulib-m4/dup2.m4 b/gnulib-m4/dup2.m4 new file mode 100644 index 0000000..2abc74c --- /dev/null +++ b/gnulib-m4/dup2.m4 @@ -0,0 +1,35 @@ +#serial 6 +dnl Copyright (C) 2002, 2005, 2007, 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_DUP2], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([dup2]) + if test $ac_cv_func_dup2 = no; then + HAVE_DUP2=0 + AC_LIBOBJ([dup2]) + else + AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include <unistd.h> +]], [return 1 - dup2 (1, 1);])], + [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works=no;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works=no;; + *) gl_cv_func_dup2_works=yes;; + esac])]) + if test "$gl_cv_func_dup2_works" = no; then + REPLACE_DUP2=1 + AC_LIBOBJ([dup2]) + fi + fi + AC_DEFINE_UNQUOTED([REPLACE_DUP2], [$REPLACE_DUP2], + [Define to 1 if dup2 returns 0 instead of the target fd.]) +]) diff --git a/gnulib-m4/fcntl_h.m4 b/gnulib-m4/fcntl_h.m4 new file mode 100644 index 0000000..1ae0b15 --- /dev/null +++ b/gnulib-m4/fcntl_h.m4 @@ -0,0 +1,96 @@ +# Configure fcntl.h. +dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Written by Paul Eggert. + +AC_DEFUN([gl_FCNTL_H], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> + #include <fcntl.h> + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + ]], + [[ + int status = !constants; + { + static char const sym[] = "conftest.sym"; + if (symlink (".", sym) != 0 + || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) + status |= 32; + } + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + char c; + struct stat st0, st1; + if (fd < 0 + || fstat (fd, &st0) != 0 + || sleep (1) != 0 + || read (fd, &c, 1) != 1 + || close (fd) != 0 + || stat (file, &st1) != 0 + || st0.st_atime != st1.st_atime) + status |= 64; + } + return status;]])], + [gl_cv_header_working_fcntl_h=yes], + [case $? in #( + 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac], + [gl_cv_header_working_fcntl_h=cross-compiling])]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) + + gl_CHECK_NEXT_HEADERS([fcntl.h]) + FCNTL_H='fcntl.h' + AC_SUBST([FCNTL_H]) +]) + +AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_FCNTL_H_DEFAULTS], +[ + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) +]) diff --git a/gnulib-m4/gnulib-comp.m4 b/gnulib-m4/gnulib-comp.m4 index efa88e9..39e7d19 100644 --- a/gnulib-m4/gnulib-comp.m4 +++ b/gnulib-m4/gnulib-comp.m4 @@ -44,6 +44,8 @@ AC_DEFUN([gl_INIT], gl_COMMON gl_source_base='lib' gl_FUNC_ALLOCA + gl_FUNC_DUP2 + gl_UNISTD_MODULE_INDICATOR([dup2]) gl_HEADER_ERRNO_H gl_FLOAT_H gl_FUNC_FREXPL_NO_LIBM @@ -84,6 +86,7 @@ AC_DEFUN([gl_INIT], gl_MATH_MODULE_INDICATOR([signbit]) gl_SIZE_MAX AM_STDBOOL_H + gl_STDDEF_H gl_STDINT_H gl_STDLIB_H if test $gl_cond_libtool = false; then @@ -176,9 +179,10 @@ AC_DEFUN([gl_INIT], gl_UNISTD_MODULE_INDICATOR([environ]) gl_ERROR m4_ifdef([AM_XGETTEXT_OPTION], - [AM_XGETTEXT_OPTION([--flag=error:3:c-format]) - AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) + AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) gl_EXITFAIL + gl_FCNTL_H AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_DOUBLE_EXPONENT_LOCATION @@ -190,6 +194,9 @@ AC_DEFUN([gl_INIT], gt_LOCALE_JA gt_LOCALE_ZH_CN gt_LOCALE_FR_UTF8 + gl_FUNC_OPEN + gl_MODULE_INDICATOR([open]) + gl_FCNTL_MODULE_INDICATOR([open]) gl_FUNC_SETENV gl_STDLIB_MODULE_INDICATOR([setenv]) AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) @@ -329,6 +336,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/c-strcaseeq.h lib/c-strncasecmp.c lib/config.charset + lib/dup2.c lib/errno.in.h lib/float+.h lib/float.in.h @@ -391,6 +399,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/signbitl.c lib/size_max.h lib/stdbool.in.h + lib/stddef.in.h lib/stdint.in.h lib/stdio-impl.h lib/stdlib.in.h @@ -1123,6 +1132,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/00gnulib.m4 m4/alloca.m4 m4/codeset.m4 + m4/dup2.m4 m4/eealloc.m4 m4/environ.m4 m4/errno_h.m4 @@ -1132,6 +1142,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/exponentf.m4 m4/exponentl.m4 m4/extensions.m4 + m4/fcntl_h.m4 m4/float_h.m4 m4/fpieee.m4 m4/frexp.m4 @@ -1174,8 +1185,10 @@ AC_DEFUN([gl_FILE_LIST], [ m4/memchr.m4 m4/minmax.m4 m4/mmap-anon.m4 + m4/mode_t.m4 m4/multiarch.m4 m4/nocrash.m4 + m4/open.m4 m4/printf-frexp.m4 m4/printf-frexpl.m4 m4/printf.m4 @@ -1184,6 +1197,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/signbit.m4 m4/size_max.m4 m4/stdbool.m4 + m4/stddef_h.m4 m4/stdint.m4 m4/stdint_h.m4 m4/stdlib_h.m4 @@ -1206,8 +1220,10 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-c-strcase.sh tests/test-c-strcasecmp.c tests/test-c-strncasecmp.c + tests/test-dup2.c tests/test-environ.c tests/test-errno.c + tests/test-fcntl.c tests/test-frexpl.c tests/test-fseterr.c tests/test-iconv.c @@ -1229,10 +1245,12 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-mbsinit.c tests/test-mbsinit.sh tests/test-memchr.c + tests/test-open.c tests/test-printf-frexp.c tests/test-printf-frexpl.c tests/test-signbit.c tests/test-stdbool.c + tests/test-stddef.c tests/test-stdint.c tests/test-stdlib.c tests/test-strerror.c @@ -1587,9 +1605,11 @@ AC_DEFUN([gl_FILE_LIST], [ tests=lib/error.h tests=lib/exitfail.c tests=lib/exitfail.h + tests=lib/fcntl.in.h tests=lib/gettext.h tests=lib/intprops.h tests=lib/locale.in.h + tests=lib/open.c tests=lib/progname.c tests=lib/progname.h tests=lib/setenv.c diff --git a/gnulib-m4/iconv.m4 b/gnulib-m4/iconv.m4 index 3cc6268..ce21b0b 100644 --- a/gnulib-m4/iconv.m4 +++ b/gnulib-m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial AM7 (gettext-0.18) +# iconv.m4 serial AM8 (gettext-0.18) dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -172,8 +172,8 @@ size_t iconv(); ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) 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);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([${ac_t:- - }$am_cv_proto_iconv]) + AC_MSG_RESULT([ + $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi diff --git a/gnulib-m4/locale_h.m4 b/gnulib-m4/locale_h.m4 index 2bf5abc..8612367 100644 --- a/gnulib-m4/locale_h.m4 +++ b/gnulib-m4/locale_h.m4 @@ -1,5 +1,5 @@ -# locale_h.m4 serial 2 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# locale_h.m4 serial 3 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,7 +12,11 @@ AC_DEFUN([gl_LOCALE_H], int x = LC_MESSAGES;], [], [gl_cv_header_working_locale_h=yes], [gl_cv_header_working_locale_h=no])]) - if test $gl_cv_header_working_locale_h = yes; then + + dnl If <stddef.h> is replaced, then <locale.h> must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + if test $gl_cv_header_working_locale_h = yes && test -z "$STDDEF_H"; then LOCALE_H= else gl_CHECK_NEXT_HEADERS([locale.h]) diff --git a/gnulib-m4/mode_t.m4 b/gnulib-m4/mode_t.m4 new file mode 100644 index 0000000..a4dd694 --- /dev/null +++ b/gnulib-m4/mode_t.m4 @@ -0,0 +1,26 @@ +# mode_t.m4 serial 1 +dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and +# include <sys/types.h>. + +# Define PROMOTED_MODE_T to the type that is the result of "default argument +# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t. +AC_DEFUN([gl_PROMOTED_TYPE_MODE_T], +[ + AC_REQUIRE([AC_TYPE_MODE_T]) + AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [ + dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int', + dnl and to itself otherwise. This assumption is not guaranteed by the ISO C + dnl standard, but we don't know of any real-world counterexamples. + AC_TRY_COMPILE([#include <sys/types.h>], + [typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];], + [gl_cv_promoted_mode_t='int'], + [gl_cv_promoted_mode_t='mode_t']) + ]) + AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t], + [Define to the type that is the result of default argument promotions of type mode_t.]) +]) diff --git a/gnulib-m4/open.m4 b/gnulib-m4/open.m4 new file mode 100644 index 0000000..c0eb8e8 --- /dev/null +++ b/gnulib-m4/open.m4 @@ -0,0 +1,65 @@ +# open.m4 serial 7 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_OPEN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw*) + gl_REPLACE_OPEN + ;; + *) + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. + AC_CACHE_CHECK([whether open recognizes a trailing slash], + [gl_cv_func_open_slash], + [ + AC_TRY_RUN([ +#include <fcntl.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +int main () +{ + return open ("conftest.sl/", O_CREAT, 0600) >= 0; +}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no], + [ +changequote(,)dnl + case "$host_os" in + solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;; + hpux*) gl_cv_func_open_slash="guessing no" ;; + *) gl_cv_func_open_slash="guessing yes" ;; + esac +changequote([,])dnl + ]) + rm -f conftest.sl + ]) + case "$gl_cv_func_open_slash" in + *no) + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if open() fails to recognize a trailing slash.]) + gl_REPLACE_OPEN + ;; + esac + ;; + esac +]) + +AC_DEFUN([gl_REPLACE_OPEN], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + REPLACE_OPEN=1 + AC_LIBOBJ([open]) + gl_PREREQ_OPEN +]) + +# Prerequisites of lib/open.c. +AC_DEFUN([gl_PREREQ_OPEN], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) + : +]) diff --git a/gnulib-m4/stddef_h.m4 b/gnulib-m4/stddef_h.m4 new file mode 100644 index 0000000..682e9c6 --- /dev/null +++ b/gnulib-m4/stddef_h.m4 @@ -0,0 +1,45 @@ +dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues. +# stddef_h.m4 serial 1 +dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_STDDEF_H], +[ + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], + [gl_cv_decl_null_works], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h> + int test[2 * (sizeof NULL == sizeof (void *)) -1]; +]])], + [gl_cv_decl_null_works=yes], + [gl_cv_decl_null_works=no])]) + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi + if test -n "$STDDEF_H"; then + gl_CHECK_NEXT_HEADERS([stddef.h]) + fi +]) + +AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDDEF_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) + HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) + STDDEF_H=''; AC_SUBST([STDDEF_H]) +]) diff --git a/gnulib-m4/unistd_h.m4 b/gnulib-m4/unistd_h.m4 index ff9a4ea..d7a89e1 100644 --- a/gnulib-m4/unistd_h.m4 +++ b/gnulib-m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 17 +# unistd_h.m4 serial 19 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,6 +52,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. @@ -73,6 +74,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) @@ -80,4 +82,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; + AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) ]) diff --git a/gnulib-m4/wchar.m4 b/gnulib-m4/wchar.m4 index 2e52a82..ce53a45 100644 --- a/gnulib-m4/wchar.m4 +++ b/gnulib-m4/wchar.m4 @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar.m4 serial 23 +# wchar.m4 serial 25 AC_DEFUN([gl_WCHAR_H], [ @@ -27,7 +27,10 @@ wchar_t w;]], fi AC_SUBST([HAVE_WINT_T]) - if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then + dnl If <stddef.h> is replaced, then <wchar.h> must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes || test -n "$STDDEF_H"; then WCHAR_H=wchar.h fi diff --git a/gnulib-m4/wcwidth.m4 b/gnulib-m4/wcwidth.m4 index 4bedefa..9cacb56 100644 --- a/gnulib-m4/wcwidth.m4 +++ b/gnulib-m4/wcwidth.m4 @@ -1,5 +1,5 @@ -# wcwidth.m4 serial 14 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# wcwidth.m4 serial 15 +dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WCWIDTH], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc <wchar.h> to declare wcwidth(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) @@ -68,7 +69,15 @@ int main () return 1; return 0; }], [gl_cv_func_wcwidth_works=yes], [gl_cv_func_wcwidth_works=no], - [gl_cv_func_wcwidth_works="guessing no"]) + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; + esac +changequote([,])dnl + ]) ]) case "$gl_cv_func_wcwidth_works" in *yes) ;; |