diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-03 18:13:11 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-03 18:13:11 +0200 |
commit | c75a4dfa301eb5aafe519a92e48598d1e94470b0 (patch) | |
tree | 93de9eb424fe0722975450c22e046970871b3633 /gl/m4 | |
parent | 1f86b82c7a33d37f85ba3bb372bd45d249bed2a3 (diff) | |
download | gnutls-c75a4dfa301eb5aafe519a92e48598d1e94470b0.tar.gz |
Added new gnulib.
Diffstat (limited to 'gl/m4')
-rw-r--r-- | gl/m4/close.m4 | 33 | ||||
-rw-r--r-- | gl/m4/dup2.m4 | 5 | ||||
-rw-r--r-- | gl/m4/fdopen.m4 | 49 | ||||
-rw-r--r-- | gl/m4/float_h.m4 | 53 | ||||
-rw-r--r-- | gl/m4/fstat.m4 | 28 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 20 | ||||
-rw-r--r-- | gl/m4/gnulib-common.m4 | 25 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 83 | ||||
-rw-r--r-- | gl/m4/msvc-nothrow.m4 | 10 | ||||
-rw-r--r-- | gl/m4/pathmax.m4 | 32 | ||||
-rw-r--r-- | gl/m4/stdio_h.m4 | 4 | ||||
-rw-r--r-- | gl/m4/sys_stat_h.m4 | 5 | ||||
-rw-r--r-- | gl/m4/unistd_h.m4 | 6 |
13 files changed, 327 insertions, 26 deletions
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4 new file mode 100644 index 0000000000..f860a320c1 --- /dev/null +++ b/gl/m4/close.m4 @@ -0,0 +1,33 @@ +# close.m4 serial 8 +dnl Copyright (C) 2008-2011 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_CLOSE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ + gl_PREREQ_SYS_H_WINSOCK2 + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the close() function. So enable the support for sockets. + REPLACE_CLOSE=1 + fi + ]) + dnl Replace close() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_CLOSE = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi + fi + ]) +]) diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4 index 5c2cc9674c..cd9d254b44 100644 --- a/gl/m4/dup2.m4 +++ b/gl/m4/dup2.m4 @@ -1,4 +1,4 @@ -#serial 14 +#serial 16 dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -71,3 +71,6 @@ AC_DEFUN([gl_FUNC_DUP2], fi ]) ]) + +# Prerequisites of lib/dup2.c. +AC_DEFUN([gl_PREREQ_DUP2], []) diff --git a/gl/m4/fdopen.m4 b/gl/m4/fdopen.m4 new file mode 100644 index 0000000000..8cae2fc273 --- /dev/null +++ b/gl/m4/fdopen.m4 @@ -0,0 +1,49 @@ +# fdopen.m4 serial 2 +dnl Copyright (C) 2011 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_FDOPEN], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FDOPEN=1 + else + dnl Test whether fdopen() sets errno when it fails due to a bad fd argument. + AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <errno.h> +int +main (void) +{ + FILE *fp; + errno = 0; + fp = fdopen (-1, "r"); + if (fp != NULL) + return 1; + if (errno == 0) + return 2; + return 0; +}]])], + [gl_cv_func_fdopen_works=yes], + [gl_cv_func_fdopen_works=no], + [case "$host_os" in + mingw*) gl_cv_func_fdopen_works="guessing no" ;; + *) gl_cv_func_fdopen_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_fdopen_works" in + *no) REPLACE_FDOPEN=1 ;; + esac + fi +]) + +dnl Prerequisites of lib/fdopen.c. +AC_DEFUN([gl_PREREQ_FDOPEN], []) diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4 index 261f1ac3af..0420e06921 100644 --- a/gl/m4/float_h.m4 +++ b/gl/m4/float_h.m4 @@ -1,4 +1,4 @@ -# float_h.m4 serial 7 +# float_h.m4 serial 9 dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,17 +33,66 @@ changequote([,])dnl ;; esac ;; + linux*) + case "$host_cpu" in + powerpc*) + FLOAT_H=float.h + ;; + esac + ;; esac case "$host_os" in - aix* | freebsd*) + aix* | freebsd* | linux*) if test -n "$FLOAT_H"; then REPLACE_FLOAT_LDBL=1 fi ;; esac + + dnl Test against glibc-2.7 Linux/SPARC64 bug. + REPLACE_ITOLD=0 + AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], + [gl_cv_func_itold_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +int i = -1; +volatile long double ld; +int main () +{ + ld += i * 1.0L; + if (ld > 0) + return 1; + return 0; +}]])], + [gl_cv_func_itold_works=yes], + [gl_cv_func_itold_works=no], + [case "$host" in + sparc*-*-linux*) + AC_EGREP_CPP([yes], + [#if defined __LP64__ || defined __arch64__ + yes + #endif], + [gl_cv_func_itold_works="guessing no"], + [gl_cv_func_itold_works="guessing yes"]) + ;; + *) gl_cv_func_itold_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_itold_works" in + *no) + REPLACE_ITOLD=1 + dnl We add the workaround to <float.h> but also to <math.h>, + dnl to increase the chances that the fix function gets pulled in. + FLOAT_H=float.h + ;; + esac + if test -n "$FLOAT_H"; then gl_NEXT_HEADERS([float.h]) fi AC_SUBST([FLOAT_H]) AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) + AC_SUBST([REPLACE_ITOLD]) ]) diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4 new file mode 100644 index 0000000000..0daea88b86 --- /dev/null +++ b/gl/m4/fstat.m4 @@ -0,0 +1,28 @@ +# fstat.m4 serial 1 +dnl Copyright (C) 2011 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_FSTAT], +[ + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_FSTAT=1 + fi + dnl Replace fstat() for supporting the gnulib-defined open() on directories. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0 \ + && test "$gl_cv_func_open_directory_works" != yes; then + REPLACE_FSTAT=1 + fi + ]) +]) + +# Prerequisites of lib/fstat.c. +AC_DEFUN([gl_PREREQ_FSTAT], +[ + AC_REQUIRE([AC_C_INLINE]) +]) diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 950e51b37b..6e88fda5dd 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -1,9 +1,21 @@ # Copyright (C) 2002-2011 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4 index 8fc448fdc8..7d83299959 100644 --- a/gl/m4/gnulib-common.m4 +++ b/gl/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 30 +# gnulib-common.m4 serial 31 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -211,6 +211,29 @@ m4_ifndef([AS_VAR_IF], [m4_define([AS_VAR_IF], [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) +# gl_PROG_CC_C99 +# Modifies the value of the shell variable CC in an attempt to make $CC +# understand ISO C99 source code. +# This is like AC_PROG_CC_C99, except that +# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, +# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>, +# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>. +# Remaining problems: +# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options +# to CC twice +# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>. +# - AC_PROG_CC_STDC is likely to change when C1X is an ISO standard. +AC_DEFUN([gl_PROG_CC_C99], +[ + dnl Change that version number to the minimum Autoconf version that supports + dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. + m4_version_prereq([9.0], + [AC_REQUIRE([AC_PROG_CC_C99])], + [AC_REQUIRE([AC_PROG_CC_STDC])]) +]) + # gl_PROG_AR_RANLIB # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 0660eb76b4..91cb09d97d 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -1,10 +1,22 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! # Copyright (C) 2002-2011 Free Software Foundation, Inc. # -# This file is free software, distributed under the terms of the GNU -# General Public License. As a special exception to the GNU General -# Public License, this file may be distributed as part of a program -# that contains a configuration script generated by Autoconf, under +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. @@ -40,6 +52,8 @@ AC_DEFUN([gl_EARLY], # Code from module c-ctype: # Code from module c-ctype-tests: # Code from module clock-time: + # Code from module close: + # Code from module close-tests: # Code from module closedir: # Code from module crypto/hmac-md5: # Code from module crypto/hmac-md5-tests: @@ -62,6 +76,7 @@ AC_DEFUN([gl_EARLY], # Code from module fcntl-h: # Code from module fcntl-h-tests: # Code from module fd-hook: + # Code from module fdopen: # Code from module fdopen-tests: # Code from module fgetc-tests: # Code from module filename: @@ -70,6 +85,8 @@ AC_DEFUN([gl_EARLY], # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) # Code from module fpucw: + # Code from module fputc-tests: + # Code from module fread-tests: # Code from module frexp-nolibm: # Code from module frexp-nolibm-tests: # Code from module frexpl-nolibm: @@ -81,6 +98,7 @@ AC_DEFUN([gl_EARLY], # Code from module fseeko-tests: # Code from module fseterr: # Code from module fseterr-tests: + # Code from module fstat: # Code from module fstat-tests: # Code from module ftell: # Code from module ftell-tests: @@ -89,6 +107,7 @@ AC_DEFUN([gl_EARLY], # Code from module ftello-tests: # Code from module func: # Code from module func-tests: + # Code from module fwrite-tests: # Code from module getcwd-lgpl: # Code from module getcwd-lgpl-tests: # Code from module getdelim: @@ -145,6 +164,7 @@ AC_DEFUN([gl_EARLY], # Code from module memxor: # Code from module minmax: # Code from module msvc-inval: + # Code from module msvc-nothrow: # Code from module multiarch: # Code from module netdb: # Code from module netdb-tests: @@ -194,9 +214,9 @@ AC_DEFUN([gl_EARLY], # Code from module stdarg: dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode dnl for the builtin va_copy to work. With Autoconf 2.60 or later, - dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC + dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99 dnl shouldn't hurt, though installers are on their own to set c99 mode. - AC_REQUIRE([AC_PROG_CC_STDC]) + gl_PROG_CC_C99 # Code from module stdbool: # Code from module stdbool-tests: # Code from module stddef: @@ -325,6 +345,9 @@ gl_FLOAT_H if test $REPLACE_FLOAT_LDBL = 1; then AC_LIBOBJ([float]) fi +if test $REPLACE_ITOLD = 1; then + AC_LIBOBJ([itold]) +fi gl_FUNC_FREXP_NO_LIBM if test $gl_func_frexp_no_libm != yes; then AC_LIBOBJ([frexp]) @@ -345,6 +368,12 @@ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then AC_LIBOBJ([fseeko]) fi gl_STDIO_MODULE_INDICATOR([fseeko]) +gl_FUNC_FSTAT +if test $REPLACE_FSTAT = 1; then + AC_LIBOBJ([fstat]) + gl_PREREQ_FSTAT +fi +gl_SYS_STAT_MODULE_INDICATOR([fstat]) gl_FUNC_FTELL if test $REPLACE_FTELL = 1; then AC_LIBOBJ([ftell]) @@ -467,6 +496,14 @@ fi gl_STRING_MODULE_INDICATOR([mempcpy]) gl_MEMXOR gl_MINMAX +gl_MSVC_INVAL +if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) +fi +gl_MSVC_NOTHROW +if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) +fi gl_MULTIARCH gl_HEADER_NETDB gl_HEADER_NETINET_IN @@ -666,14 +703,26 @@ changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) +gl_FUNC_CLOSE +if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) +fi +gl_UNISTD_MODULE_INDICATOR([close]) gl_FUNC_DUP2 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 fi gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) gl_FCNTL_H +gl_FUNC_FDOPEN +if test $REPLACE_FDOPEN = 1; then + AC_LIBOBJ([fdopen]) + gl_PREREQ_FDOPEN +fi +gl_STDIO_MODULE_INDICATOR([fdopen]) gl_FUNC_UNGETC_WORKS gl_FUNC_UNGETC_WORKS gl_FUNC_UNGETC_WORKS @@ -705,10 +754,6 @@ dnl Check for prerequisites for memory fence checks. gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) -gl_MSVC_INVAL -if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-inval]) -fi gl_FUNC_OPEN if test $REPLACE_OPEN = 1; then AC_LIBOBJ([open]) @@ -905,6 +950,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/fseeko.c lib/fseterr.c lib/fseterr.h + lib/fstat.c lib/ftell.c lib/ftello.c lib/getdelim.c @@ -929,6 +975,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/isnanf.c lib/isnanl-nolibm.h lib/isnanl.c + lib/itold.c lib/lseek.c lib/malloc.c lib/math.in.h @@ -941,6 +988,10 @@ AC_DEFUN([gl_FILE_LIST], [ lib/memxor.c lib/memxor.h lib/minmax.h + lib/msvc-inval.c + lib/msvc-inval.h + lib/msvc-nothrow.c + lib/msvc-nothrow.h lib/netdb.in.h lib/netinet_in.in.h lib/opendir.c @@ -1021,6 +1072,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/argp.m4 m4/byteswap.m4 m4/clock_time.m4 + m4/close.m4 m4/closedir.m4 m4/codeset.m4 m4/dirent_h.m4 @@ -1037,12 +1089,14 @@ AC_DEFUN([gl_FILE_LIST], [ m4/extensions.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 + m4/fdopen.m4 m4/float_h.m4 m4/fpieee.m4 m4/frexp.m4 m4/frexpl.m4 m4/fseek.m4 m4/fseeko.m4 + m4/fstat.m4 m4/ftell.m4 m4/ftello.m4 m4/func.m4 @@ -1098,6 +1152,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/mmap-anon.m4 m4/mode_t.m4 m4/msvc-inval.m4 + m4/msvc-nothrow.m4 m4/multiarch.m4 m4/netdb_h.m4 m4/netinet_in_h.m4 @@ -1186,6 +1241,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-binary-io.sh tests/test-byteswap.c tests/test-c-ctype.c + tests/test-close.c tests/test-dirent.c tests/test-dup2.c tests/test-environ.c @@ -1195,6 +1251,8 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-fgetc.c tests/test-float.c tests/test-fprintf-posix.h + tests/test-fputc.c + tests/test-fread.c tests/test-frexp.c tests/test-frexpl.c tests/test-fseek.c @@ -1220,6 +1278,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-ftello4.c tests/test-ftello4.sh tests/test-func.c + tests/test-fwrite.c tests/test-getcwd-lgpl.c tests/test-getdelim.c tests/test-getline.c @@ -1302,8 +1361,10 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-wchar.c tests/zerosize-ptr.h tests=lib/binary-io.h + tests=lib/close.c tests=lib/dup2.c tests=lib/fcntl.in.h + tests=lib/fdopen.c tests=lib/getcwd-lgpl.c tests=lib/getpagesize.c tests=lib/ignore-value.h @@ -1312,8 +1373,6 @@ AC_DEFUN([gl_FILE_LIST], [ tests=lib/malloca.c tests=lib/malloca.h tests=lib/malloca.valgrind - tests=lib/msvc-inval.c - tests=lib/msvc-inval.h tests=lib/open.c tests=lib/pathmax.h tests=lib/putenv.c diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4 new file mode 100644 index 0000000000..b2f6bb49ab --- /dev/null +++ b/gl/m4/msvc-nothrow.m4 @@ -0,0 +1,10 @@ +# msvc-nothrow.m4 serial 1 +dnl Copyright (C) 2011 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_MSVC_NOTHROW], +[ + AC_REQUIRE([gl_MSVC_INVAL]) +]) diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4 index 0856722c39..4913fa06cb 100644 --- a/gl/m4/pathmax.m4 +++ b/gl/m4/pathmax.m4 @@ -1,4 +1,4 @@ -# pathmax.m4 serial 9 +# pathmax.m4 serial 10 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -10,3 +10,33 @@ AC_DEFUN([gl_PATHMAX], dnl Prerequisites of lib/pathmax.h. AC_CHECK_HEADERS_ONCE([sys/param.h]) ]) + +# Expands to a piece of C program that defines PATH_MAX in the same way as +# "pathmax.h" will do. +AC_DEFUN([gl_PATHMAX_SNIPPET], [[ +/* Arrange to define PATH_MAX, like "pathmax.h" does. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <limits.h> +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include <sys/param.h> +#endif +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif +#ifdef __hpux +# undef PATH_MAX +# define PATH_MAX 1024 +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# undef PATH_MAX +# define PATH_MAX 260 +#endif +]]) + +# Prerequisites of gl_PATHMAX_SNIPPET. +AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], +[ + AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) +]) diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4 index 988e0255d8..39bf80e2ac 100644 --- a/gl/m4/stdio_h.m4 +++ b/gl/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 39 +# stdio_h.m4 serial 40 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -91,6 +91,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], [ GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) + GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) @@ -161,6 +162,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) + REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4 index a3e46ca965..83ebac613b 100644 --- a/gl/m4/sys_stat_h.m4 +++ b/gl/m4/sys_stat_h.m4 @@ -1,4 +1,4 @@ -# sys_stat_h.m4 serial 25 -*- Autoconf -*- +# sys_stat_h.m4 serial 26 -*- Autoconf -*- dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,7 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h> - ]], [fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat + ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat]) ]) # gl_HEADER_SYS_STAT_H @@ -50,6 +50,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) + GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index 720e0fd03b..57c8094e42 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 59 +# unistd_h.m4 serial 61 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -39,7 +39,7 @@ AC_DEFUN([gl_UNISTD_H], # include <io.h> # endif #endif - ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat + ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite @@ -58,8 +58,10 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ + GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) |