diff options
Diffstat (limited to 'm4')
99 files changed, 770 insertions, 199 deletions
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index d4d04d153..301469b31 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 2 -dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2010 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. diff --git a/m4/alloca.m4 b/m4/alloca.m4 index 4b978e137..f3ee34380 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,5 +1,6 @@ # alloca.m4 serial 9 -dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation, +dnl 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. diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4 index a6e63df01..4360dd810 100644 --- a/m4/arpa_inet_h.m4 +++ b/m4/arpa_inet_h.m4 @@ -1,5 +1,5 @@ -# arpa_inet_h.m4 serial 5 -dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# arpa_inet_h.m4 serial 7 +dnl Copyright (C) 2006, 2008, 2009, 2010 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. @@ -16,20 +16,28 @@ AC_DEFUN([gl_HEADER_ARPA_INET], if test $ac_cv_header_arpa_inet_h = yes; then HAVE_ARPA_INET_H=1 else - ARPA_INET_H='arpa/inet.h' HAVE_ARPA_INET_H=0 fi AC_SUBST([HAVE_ARPA_INET_H]) - dnl Execute this unconditionally, because ARPA_INET_H may be set by other - dnl modules, after this code is executed. + dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([arpa/inet.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([[ +/* On some systems, this header is not self-consistent. */ +#ifndef __GLIBC__ +# include <sys/socket.h> +#endif +#include <arpa/inet.h> + ]], [inet_ntop inet_pton]) ]) dnl Unconditionally enables the replacement of <arpa/inet.h>. AC_DEFUN([gl_REPLACE_ARPA_INET_H], [ - AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) - ARPA_INET_H='arpa/inet.h' + dnl This is a no-op, because <arpa/inet.h> is always overridden. + : ]) AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], @@ -46,5 +54,4 @@ AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) - ARPA_INET_H=''; AC_SUBST([ARPA_INET_H]) ]) diff --git a/m4/autobuild.m4 b/m4/autobuild.m4 index a025e7379..93ccb5468 100644 --- a/m4/autobuild.m4 +++ b/m4/autobuild.m4 @@ -1,5 +1,6 @@ # autobuild.m4 serial 7 -dnl Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +dnl 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. diff --git a/m4/byteswap.m4 b/m4/byteswap.m4 index ad13f2286..2afd6a2a4 100644 --- a/m4/byteswap.m4 +++ b/m4/byteswap.m4 @@ -1,5 +1,5 @@ # byteswap.m4 serial 3 -dnl Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009, 2010 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. diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4 index 119ebb75b..d418de8fb 100644 --- a/m4/canonicalize.m4 +++ b/m4/canonicalize.m4 @@ -1,6 +1,6 @@ # canonicalize.m4 serial 16 -dnl Copyright (C) 2003-2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/codeset.m4 b/m4/codeset.m4 index 413217bd4..a53c04260 100644 --- a/m4/codeset.m4 +++ b/m4/codeset.m4 @@ -1,5 +1,5 @@ # codeset.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2006, 2008-2010 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. @@ -3,7 +3,7 @@ # Define some macros required for proper operation of code in lib/*.c # on MSDOS/Windows systems. -# Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4 index b98259415..66a79c0f2 100644 --- a/m4/double-slash-root.m4 +++ b/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2010 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. diff --git a/m4/duplocale.m4 b/m4/duplocale.m4 index 7e0a0714c..91a8ffd90 100644 --- a/m4/duplocale.m4 +++ b/m4/duplocale.m4 @@ -1,5 +1,5 @@ # duplocale.m4 serial 1 -dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2009, 2010 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. diff --git a/m4/eealloc.m4 b/m4/eealloc.m4 index 3c9c0b52a..63dd92022 100644 --- a/m4/eealloc.m4 +++ b/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 2 -dnl Copyright (C) 2003, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009, 2010 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. diff --git a/m4/environ.m4 b/m4/environ.m4 index 180382020..5f50d6e3b 100644 --- a/m4/environ.m4 +++ b/m4/environ.m4 @@ -1,5 +1,5 @@ # environ.m4 serial 3 -dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2010 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. diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index 4ce1ccbd9..d02a03936 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 6 -dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 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. diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 99fba9f63..7d9458a8d 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 8 -*- Autoconf -*- +# serial 9 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,6 +12,20 @@ # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. +# If autoconf reports a warning +# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS +# the fix is +# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked +# but always AC_REQUIREd, +# 2) to ensure that for each occurrence of +# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +# or +# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) +# the corresponding gnulib module description has 'extensions' among +# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS +# invocation occurs in gl_EARLY, not in gl_INIT. + # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, diff --git a/m4/fcntl_h.m4 b/m4/fcntl-o.m4 index 40a18034d..67167cbda 100644 --- a/m4/fcntl_h.m4 +++ b/m4/fcntl-o.m4 @@ -1,21 +1,11 @@ -# serial 6 -# Configure fcntl.h. -dnl Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. +# fcntl-o.m4 serial 1 +dnl Copyright (C) 2006, 2009, 2010 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]) - AC_REQUIRE([gl_FCNTL_O_FLAGS]) - gl_CHECK_NEXT_HEADERS([fcntl.h]) - FCNTL_H='fcntl.h' - AC_SUBST([FCNTL_H]) -]) - # Test whether the flags O_NOATIME and O_NOFOLLOW actually work. # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. @@ -89,20 +79,3 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], [Define to 1 if O_NOFOLLOW works.]) ]) - -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]) - GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) - dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) - REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) - REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) -]) diff --git a/m4/float_h.m4 b/m4/float_h.m4 index d36e3a46c..a74a0d957 100644 --- a/m4/float_h.m4 +++ b/m4/float_h.m4 @@ -1,5 +1,5 @@ # float_h.m4 serial 3 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009, 2010 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. diff --git a/m4/flock.m4 b/m4/flock.m4 index 96475fc57..ca6e24f8c 100644 --- a/m4/flock.m4 +++ b/m4/flock.m4 @@ -1,5 +1,5 @@ # flock.m4 serial 1 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2010 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. diff --git a/m4/fpieee.m4 b/m4/fpieee.m4 index 9f4a92cb3..532802d7f 100644 --- a/m4/fpieee.m4 +++ b/m4/fpieee.m4 @@ -1,5 +1,5 @@ # fpieee.m4 serial 1 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009, 2010 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. diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4 new file mode 100644 index 000000000..05fd2b6c4 --- /dev/null +++ b/m4/getaddrinfo.m4 @@ -0,0 +1,173 @@ +# getaddrinfo.m4 serial 22 +dnl Copyright (C) 2004-2010 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_GETADDRINFO], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H + AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H + AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) + GETADDRINFO_LIB= + gai_saved_LIBS="$LIBS" + + dnl Where is getaddrinfo()? + dnl - On Solaris, it is in libsocket. + dnl - On Haiku, it is in libnetwork. + dnl - On BeOS, it is in libnet. + dnl - On native Windows, it is in ws2_32.dll. + dnl - Otherwise it is in libc. + AC_SEARCH_LIBS([getaddrinfo], [socket network net], + [if test "$ac_cv_search_getaddrinfo" != "none required"; then + GETADDRINFO_LIB="$ac_cv_search_getaddrinfo" + fi]) + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" + + AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#include <stddef.h> +]], [[getaddrinfo("", "", NULL, NULL);]])], + [gl_cv_func_getaddrinfo=yes], + [gl_cv_func_getaddrinfo=no])]) + if test $gl_cv_func_getaddrinfo = no; then + AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], + gl_cv_w32_getaddrinfo, [ + gl_cv_w32_getaddrinfo=no + am_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +#include <stddef.h> +]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes]) + LIBS="$am_save_LIBS" + ]) + if test "$gl_cv_w32_getaddrinfo" = "yes"; then + GETADDRINFO_LIB="-lws2_32" + LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" + else + AC_LIBOBJ([getaddrinfo]) + fi + fi + + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an + # inline function declared in ws2tcpip.h, so we need to get that + # header included somehow. + AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)], + gl_cv_func_gai_strerror, [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +#include <stddef.h> +]], [[gai_strerror (NULL);]])], + [gl_cv_func_gai_strerror=yes], + [gl_cv_func_gai_strerror=no])]) + if test $gl_cv_func_gai_strerror = no; then + AC_LIBOBJ([gai_strerror]) + fi + + LIBS="$gai_saved_LIBS" + + gl_PREREQ_GETADDRINFO + + AC_SUBST([GETADDRINFO_LIB]) +]) + +# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c. +AC_DEFUN([gl_PREREQ_GETADDRINFO], [ + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H + AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB + AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB + AC_REQUIRE([gl_INET_NTOP]) dnl for INET_NTOP_LIB + AC_REQUIRE([AC_C_RESTRICT]) + AC_REQUIRE([gl_SOCKET_FAMILIES]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl Including sys/socket.h is wrong for Windows, but Windows does not + dnl have sa_len so the result is correct anyway. + AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) + + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ + /* sys/types.h is not needed according to POSIX, but the + sys/socket.h in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +]) + if test $ac_cv_have_decl_getaddrinfo = no; then + HAVE_DECL_GETADDRINFO=0 + fi + if test $ac_cv_have_decl_freeaddrinfo = no; then + HAVE_DECL_FREEADDRINFO=0 + fi + if test $ac_cv_have_decl_gai_strerror = no; then + HAVE_DECL_GAI_STRERROR=0 + fi + if test $ac_cv_have_decl_getnameinfo = no; then + HAVE_DECL_GETNAMEINFO=0 + fi + + AC_CHECK_TYPES([struct addrinfo],,,[ +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif +]) + if test $ac_cv_type_struct_addrinfo = no; then + HAVE_STRUCT_ADDRINFO=0 + fi + + dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. + case " $GETADDRINFO_LIB " in + *" $HOSTENT_LIB "*) ;; + *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;; + esac + + dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. + case " $GETADDRINFO_LIB " in + *" $SERVENT_LIB "*) ;; + *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;; + esac + + dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates. + case " $GETADDRINFO_LIB " in + *" $INET_NTOP_LIB "*) ;; + *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;; + esac +]) diff --git a/m4/glibc21.m4 b/m4/glibc21.m4 index 12cddfe8b..68ada9d4d 100644 --- a/m4/glibc21.m4 +++ b/m4/glibc21.m4 @@ -1,5 +1,5 @@ # glibc21.m4 serial 4 -dnl Copyright (C) 2000-2002, 2004, 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2004, 2008-2010 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. diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 31b8f31e5..3326fb975 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2009 Free Software Foundation, Inc. +# Copyright (C) 2002-2010 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 @@ -15,7 +15,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings +# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -34,6 +34,7 @@ gl_MODULES([ full-read full-write gendocs + getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 75da53db0..b7812a896 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 11 -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +# gnulib-common.m4 serial 12 +dnl Copyright (C) 2007-2010 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. @@ -23,14 +23,17 @@ AC_DEFUN([gl_COMMON_BODY], [ # define __GNUC_STDC_INLINE__ 1 #endif]) AH_VERBATIM([unused_parameter], -[/* Define as a marker that can be attached to function parameter declarations - for parameters that are not used. This helps to reduce warnings, such as - from GCC -Wunused-parameter. */ +[/* Define as a marker that can be attached to declarations that might not + be used. This helps to reduce warnings, such as from + GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +# define _GL_UNUSED __attribute__ ((__unused__)) #else -# define _UNUSED_PARAMETER_ +# define _GL_UNUSED #endif +/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name + is a misnomer outside of parameter lists. */ +#define _UNUSED_PARAMETER_ _GL_UNUSED ]) ]) @@ -49,6 +52,14 @@ m4_ifndef([m4_foreach_w], [m4_define([m4_foreach_w], [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) +# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) +# ---------------------------------------------------- +# Backport of autoconf-2.63b's macro. +# Remove this macro when we can assume autoconf >= 2.64. +m4_ifndef([AS_VAR_IF], +[m4_define([AS_VAR_IF], +[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) + # AC_PROG_MKDIR_P # is a backport of autoconf-2.60's AC_PROG_MKDIR_P. # Remove this macro when we can assume autoconf >= 2.60. diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index de12109dc..fc989b27e 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2009 Free Software Foundation, Inc. +# Copyright (C) 2002-2010 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 @@ -65,6 +65,8 @@ AC_DEFUN([gl_INIT], gl_FLOAT_H gl_FUNC_FLOCK gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock]) + gl_GETADDRINFO + gl_NETDB_MODULE_INDICATOR([getaddrinfo]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) # Autoconf 2.61a.99 and earlier don't support linking a file only @@ -77,6 +79,7 @@ AC_DEFUN([gl_INIT], m4_defn([m4_PACKAGE_VERSION])), [1], [], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile])]) + gl_HOSTENT AM_ICONV gl_ICONV_H gl_FUNC_ICONV_OPEN @@ -95,6 +98,8 @@ AC_DEFUN([gl_INIT], gl_LOCALE_H gl_FUNC_LSTAT gl_SYS_STAT_MODULE_INDICATOR([lstat]) + AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], + [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) gl_FUNC_MALLOC_POSIX gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_MALLOCA @@ -107,6 +112,7 @@ AC_DEFUN([gl_INIT], gl_FUNC_MEMCHR gl_STRING_MODULE_INDICATOR([memchr]) gl_MULTIARCH + gl_HEADER_NETDB gl_HEADER_NETINET_IN AC_PROG_MKDIR_P gl_PATHMAX @@ -116,7 +122,10 @@ AC_DEFUN([gl_INIT], gl_UNISTD_MODULE_INDICATOR([readlink]) gl_SAFE_READ gl_SAFE_WRITE + gl_SERVENT gl_SIZE_MAX + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) gl_TYPE_SOCKLEN_T gt_TYPE_SSIZE_T gl_FUNC_STAT @@ -292,9 +301,10 @@ AC_DEFUN([gl_FILE_LIST], [ build-aux/gitlog-to-changelog build-aux/gnu-web-doc-update build-aux/gnupload - build-aux/link-warning.h + build-aux/unused-parameter.h build-aux/useless-if-before-free build-aux/vc-list-files + build-aux/warn-on-use.h doc/gendocs_template lib/alignof.h lib/alloca.in.h @@ -318,6 +328,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/full-read.h lib/full-write.c lib/full-write.h + lib/gai_strerror.c + lib/getaddrinfo.c lib/gettext.h lib/iconv.c lib/iconv.in.h @@ -344,6 +356,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/mbsinit.c lib/memchr.c lib/memchr.valgrind + lib/netdb.in.h lib/netinet_in.in.h lib/pathmax.h lib/printf-args.c @@ -359,6 +372,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/safe-write.c lib/safe-write.h lib/size_max.h + lib/snprintf.c lib/stat.c lib/stdarg.in.h lib/stdbool.in.h @@ -416,12 +430,14 @@ AC_DEFUN([gl_FILE_LIST], [ m4/environ.m4 m4/errno_h.m4 m4/extensions.m4 - m4/fcntl_h.m4 + m4/fcntl-o.m4 m4/float_h.m4 m4/flock.m4 m4/fpieee.m4 + m4/getaddrinfo.m4 m4/glibc21.m4 m4/gnulib-common.m4 + m4/hostent.m4 m4/iconv.m4 m4/iconv_h.m4 m4/iconv_open.m4 @@ -452,6 +468,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/memchr.m4 m4/mmap-anon.m4 m4/multiarch.m4 + m4/netdb_h.m4 m4/netinet_in_h.m4 m4/pathmax.m4 m4/printf.m4 @@ -459,7 +476,9 @@ AC_DEFUN([gl_FILE_LIST], [ m4/readlink.m4 m4/safe-read.m4 m4/safe-write.m4 + m4/servent.m4 m4/size_max.m4 + m4/snprintf.m4 m4/socklen.m4 m4/sockpfaf.m4 m4/ssize_t.m4 @@ -486,6 +505,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/version-etc.m4 m4/visibility.m4 m4/vsnprintf.m4 + m4/warn-on-use.m4 m4/warnings.m4 m4/wchar.m4 m4/wchar_t.m4 diff --git a/m4/gnulib-tool.m4 b/m4/gnulib-tool.m4 index 4438d4886..69e7733b9 100644 --- a/m4/gnulib-tool.m4 +++ b/m4/gnulib-tool.m4 @@ -1,5 +1,5 @@ # gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2005, 2009-2010 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. diff --git a/m4/hostent.m4 b/m4/hostent.m4 new file mode 100644 index 000000000..111104112 --- /dev/null +++ b/m4/hostent.m4 @@ -0,0 +1,45 @@ +# hostent.m4 serial 1 +dnl Copyright (C) 2008, 2009, 2010 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_HOSTENT], +[ + dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(), + dnl gethostbyaddr() defined? + dnl - On Solaris, they are in libnsl. Ignore libxnet. + dnl - On Haiku, they are in libnetwork. + dnl - On BeOS, they are in libnet. + dnl - On native Windows, they are in ws2_32.dll. + dnl - Otherwise they are in libc. + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H + HOSTENT_LIB= + gl_saved_libs="$LIBS" + AC_SEARCH_LIBS([gethostbyname], [nsl network net], + [if test "$ac_cv_search_gethostbyname" != "none required"; then + HOSTENT_LIB="$ac_cv_search_gethostbyname" + fi]) + LIBS="$gl_saved_libs" + if test -z "$HOSTENT_LIB"; then + AC_CHECK_FUNCS([gethostbyname], , [ + AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32], + [gl_cv_w32_gethostbyname], + [gl_cv_w32_gethostbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + AC_TRY_LINK([ +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#include <stddef.h> +], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes]) + LIBS="$gl_save_LIBS" + ]) + if test "$gl_cv_w32_gethostbyname" = "yes"; then + HOSTENT_LIB="-lws2_32" + fi + ]) + fi + AC_SUBST([HOSTENT_LIB]) +]) diff --git a/m4/iconv.m4 b/m4/iconv.m4 index ce21b0b87..f46ff1421 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM8 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc. +# iconv.m4 serial 9 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2007-2010 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. @@ -58,7 +58,7 @@ AC_DEFUN([AM_ICONV_LINK], ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ - dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. + dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" @@ -87,6 +87,25 @@ int main () return 1; } } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4 index c56a48914..8881473ac 100644 --- a/m4/iconv_h.m4 +++ b/m4/iconv_h.m4 @@ -1,5 +1,5 @@ # iconv_h.m4 serial 5 -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2010 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. diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4 index 6bf78bc5e..d6f44fb37 100644 --- a/m4/iconv_open.m4 +++ b/m4/iconv_open.m4 @@ -1,5 +1,5 @@ # iconv_open.m4 serial 6 -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2010 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. diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 2e6273f83..c7e0672f6 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,5 +1,5 @@ # include_next.m4 serial 14 -dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2010 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. diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4 index 2a8ff2051..20e8d7c52 100644 --- a/m4/inet_ntop.m4 +++ b/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ # inet_ntop.m4 serial 11 -dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 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. diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4 index e890b9b7a..e0b794242 100644 --- a/m4/inet_pton.m4 +++ b/m4/inet_pton.m4 @@ -1,5 +1,5 @@ # inet_pton.m4 serial 9 -dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008, 2009, 2010 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. diff --git a/m4/inline.m4 b/m4/inline.m4 index cee51099f..4ef768de7 100644 --- a/m4/inline.m4 +++ b/m4/inline.m4 @@ -1,5 +1,5 @@ # inline.m4 serial 4 -dnl Copyright (C) 2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009, 2010 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. diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 index 264cb5718..975caac50 100644 --- a/m4/intmax_t.m4 +++ b/m4/intmax_t.m4 @@ -1,5 +1,6 @@ # intmax_t.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006-2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation, +dnl 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. diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index f4ca16021..782d77ed8 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ # inttypes_h.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2010 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. diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4 index 43b725b4a..43c1ef12f 100644 --- a/m4/ld-version-script.m4 +++ b/m4/ld-version-script.m4 @@ -1,5 +1,5 @@ # ld-version-script.m4 serial 1 -dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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. diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index 4b4db0798..ebb30528b 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,5 +1,5 @@ # lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2009-2010 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. diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index 2f8b7ff38..90e1ac917 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,5 +1,5 @@ # lib-link.m4 serial 20 (gettext-0.18) -dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2010 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. diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index 4b7ee3358..1601ceaef 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2010 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. diff --git a/m4/libunistring.m4 b/m4/libunistring.m4 index 52ff06b61..8f9f07b0e 100644 --- a/m4/libunistring.m4 +++ b/m4/libunistring.m4 @@ -1,5 +1,5 @@ # libunistring.m4 serial 1 -dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2009, 2010 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. diff --git a/m4/localcharset.m4 b/m4/localcharset.m4 index 90b9403d5..ee2e801bd 100644 --- a/m4/localcharset.m4 +++ b/m4/localcharset.m4 @@ -1,5 +1,5 @@ # localcharset.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 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. diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4 index 653a5bc2b..001f53906 100644 --- a/m4/locale-fr.m4 +++ b/m4/locale-fr.m4 @@ -1,5 +1,5 @@ # locale-fr.m4 serial 11 -dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2010 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. diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4 index 936057647..0eedaf149 100644 --- a/m4/locale-ja.m4 +++ b/m4/locale-ja.m4 @@ -1,5 +1,5 @@ # locale-ja.m4 serial 7 -dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2010 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. diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4 index 36a5f1dfb..777fd1418 100644 --- a/m4/locale-zh.m4 +++ b/m4/locale-zh.m4 @@ -1,5 +1,5 @@ # locale-zh.m4 serial 6 -dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2010 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. diff --git a/m4/locale_h.m4 b/m4/locale_h.m4 index 35b8b322f..0b7f4935b 100644 --- a/m4/locale_h.m4 +++ b/m4/locale_h.m4 @@ -1,5 +1,5 @@ -# locale_h.m4 serial 5 -dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. +# locale_h.m4 serial 7 +dnl Copyright (C) 2007, 2009, 2010 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. @@ -48,8 +48,7 @@ locale_t x;], [], fi AC_SUBST([HAVE_XLOCALE_H]) - dnl Execute this unconditionally, because LOCALE_H may be set by other - dnl modules, after this code is executed. + dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([locale.h]) if test -n "$STDDEF_H" \ @@ -57,13 +56,22 @@ locale_t x;], [], || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then gl_REPLACE_LOCALE_H fi + + 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 <locale.h> +/* Some systems provide declarations in a non-standard header. */ +#if HAVE_XLOCALE_H +# include <xlocale.h> +#endif + ]], [duplocale]) ]) dnl Unconditionally enables the replacement of <locale.h>. AC_DEFUN([gl_REPLACE_LOCALE_H], [ - AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) - LOCALE_H=locale.h + dnl This is a no-op, because <locale.h> is always overridden. + : ]) AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], @@ -78,5 +86,4 @@ AC_DEFUN([gl_LOCALE_H_DEFAULTS], GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) dnl Assume proper GNU behavior unless another module says otherwise. REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) - LOCALE_H=''; AC_SUBST([LOCALE_H]) ]) diff --git a/m4/longlong.m4 b/m4/longlong.m4 index 6d17ea373..cca3c1a90 100644 --- a/m4/longlong.m4 +++ b/m4/longlong.m4 @@ -1,5 +1,5 @@ # longlong.m4 serial 14 -dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 1999-2007, 2009-2010 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. diff --git a/m4/lstat.m4 b/m4/lstat.m4 index 089d0ff59..5dbd16e28 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,6 +1,6 @@ # serial 20 -# Copyright (C) 1997-2001, 2003-2009 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 807017166..910ac9229 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,5 +1,5 @@ # malloc.m4 serial 9 -dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009, 2010 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. diff --git a/m4/malloca.m4 b/m4/malloca.m4 index 2841ae83a..e07c6d933 100644 --- a/m4/malloca.m4 +++ b/m4/malloca.m4 @@ -1,5 +1,6 @@ # malloca.m4 serial 1 -dnl Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation, +dnl 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. diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4 index 5623ed5b9..6049d1a19 100644 --- a/m4/mbrlen.m4 +++ b/m4/mbrlen.m4 @@ -1,5 +1,5 @@ # mbrlen.m4 serial 2 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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. diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 2fddcc8a1..9ec93f561 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,5 +1,6 @@ # mbrtowc.m4 serial 16 -dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation, +dnl 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. diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4 index 03b055cd8..13907a516 100644 --- a/m4/mbsinit.m4 +++ b/m4/mbsinit.m4 @@ -1,5 +1,5 @@ # mbsinit.m4 serial 3 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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. diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 index 08f85d6a5..3e2df29f8 100644 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 12 -dnl Copyright (C) 2000-2002, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2010 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. diff --git a/m4/memchr.m4 b/m4/memchr.m4 index 81531ca41..94596ef95 100644 --- a/m4/memchr.m4 +++ b/m4/memchr.m4 @@ -1,5 +1,5 @@ # memchr.m4 serial 7 -dnl Copyright (C) 2002, 2003, 2004, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2009-2010 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. diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4 index 14b6270d2..a6b7b9ac3 100644 --- a/m4/mmap-anon.m4 +++ b/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ # mmap-anon.m4 serial 8 -dnl Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2010 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. diff --git a/m4/multiarch.m4 b/m4/multiarch.m4 index ec377bac8..389bd2bba 100644 --- a/m4/multiarch.m4 +++ b/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 5 -dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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. diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4 new file mode 100644 index 000000000..84afce6e5 --- /dev/null +++ b/m4/netdb_h.m4 @@ -0,0 +1,46 @@ +# netdb_h.m4 serial 6 +dnl Copyright (C) 2008, 2009, 2010 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_HEADER_NETDB], +[ + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + AC_CHECK_HEADERS_ONCE([netdb.h]) + gl_CHECK_NEXT_HEADERS([netdb.h]) + if test $ac_cv_header_netdb_h = yes; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include <netdb.h> + struct addrinfo a; + int b = EAI_OVERFLOW; + int c = AI_NUMERICSERV; + ]])], + [NETDB_H=''], [NETDB_H='netdb.h']) + HAVE_NETDB_H=1 + else + NETDB_H='netdb.h' + HAVE_NETDB_H=0 + fi + AC_SUBST([HAVE_NETDB_H]) + AC_SUBST([NETDB_H]) +]) + +AC_DEFUN([gl_NETDB_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_NETDB_H_DEFAULTS], +[ + GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO]) + HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO]) + HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR]) + HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO]) + HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO]) +]) diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4 index 47fd9cc31..cc7a44cc2 100644 --- a/m4/netinet_in_h.m4 +++ b/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ # netinet_in_h.m4 serial 4 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2010 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. diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 index 465180161..6a3f857e3 100644 --- a/m4/pathmax.m4 +++ b/m4/pathmax.m4 @@ -1,5 +1,6 @@ # pathmax.m4 serial 8 -dnl Copyright (C) 2002, 2003, 2005, 2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation, +dnl 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. diff --git a/m4/printf.m4 b/m4/printf.m4 index 87aa45c5e..ebca5364c 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,5 +1,5 @@ # printf.m4 serial 33 -dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2010 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. diff --git a/m4/putenv.m4 b/m4/putenv.m4 index e04f86490..dd9140c0a 100644 --- a/m4/putenv.m4 +++ b/m4/putenv.m4 @@ -1,5 +1,5 @@ # putenv.m4 serial 16 -dnl Copyright (C) 2002-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2010 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. diff --git a/m4/readlink.m4 b/m4/readlink.m4 index e61c1a1cf..36cd41f9b 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,5 +1,5 @@ -# readlink.m4 serial 8 -dnl Copyright (C) 2003, 2007, 2009 Free Software Foundation, Inc. +# readlink.m4 serial 9 +dnl Copyright (C) 2003, 2007, 2009, 2010 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. @@ -35,7 +35,7 @@ AC_DEFUN([gl_FUNC_READLINK], return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], [gl_cv_func_readlink_works="guessing no"]) - rm -f conftest.link]) + rm -f conftest.link conftest.lnk2]) if test "$gl_cv_func_readlink_works" != yes; then AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink fails to recognize a trailing slash.]) diff --git a/m4/safe-read.m4 b/m4/safe-read.m4 index 7a89d0a6c..d087bd30f 100644 --- a/m4/safe-read.m4 +++ b/m4/safe-read.m4 @@ -1,5 +1,6 @@ # safe-read.m4 serial 5 -dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation, +dnl 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. diff --git a/m4/safe-write.m4 b/m4/safe-write.m4 index db119ffa5..2ff11d27a 100644 --- a/m4/safe-write.m4 +++ b/m4/safe-write.m4 @@ -1,5 +1,5 @@ # safe-write.m4 serial 3 -dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2010 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. diff --git a/m4/servent.m4 b/m4/servent.m4 new file mode 100644 index 000000000..2ed961a43 --- /dev/null +++ b/m4/servent.m4 @@ -0,0 +1,47 @@ +# servent.m4 serial 1 +dnl Copyright (C) 2008, 2009, 2010 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_SERVENT], +[ + dnl Where are getservent(), setservent(), endservent(), getservbyname(), + dnl getservbyport() defined? + dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(), + dnl getprotobynumber() defined? + dnl - On Solaris, they are in libsocket. Ignore libxnet. + dnl - On Haiku, they are in libnetwork. + dnl - On BeOS, they are in libnet. + dnl - On native Windows, they are in ws2_32.dll. + dnl - Otherwise they are in libc. + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H + SERVENT_LIB= + gl_saved_libs="$LIBS" + AC_SEARCH_LIBS([getservbyname], [socket network net], + [if test "$ac_cv_search_getservbyname" != "none required"; then + SERVENT_LIB="$ac_cv_search_getservbyname" + fi]) + LIBS="$gl_saved_libs" + if test -z "$SERVENT_LIB"; then + AC_CHECK_FUNCS([getservbyname], , [ + AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32], + [gl_cv_w32_getservbyname], + [gl_cv_w32_getservbyname=no + gl_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + AC_TRY_LINK([ +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#include <stddef.h> +], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes]) + LIBS="$gl_save_LIBS" + ]) + if test "$gl_cv_w32_getservbyname" = "yes"; then + SERVENT_LIB="-lws2_32" + fi + ]) + fi + AC_SUBST([SERVENT_LIB]) +]) diff --git a/m4/size_max.m4 b/m4/size_max.m4 index 35bd3d6ae..ce992db1f 100644 --- a/m4/size_max.m4 +++ b/m4/size_max.m4 @@ -1,5 +1,5 @@ # size_max.m4 serial 9 -dnl Copyright (C) 2003, 2005-2006, 2008-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2006, 2008-2010 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. diff --git a/m4/snprintf.m4 b/m4/snprintf.m4 new file mode 100644 index 000000000..522b107b1 --- /dev/null +++ b/m4/snprintf.m4 @@ -0,0 +1,40 @@ +# snprintf.m4 serial 5 +dnl Copyright (C) 2002-2004, 2007-2010 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_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_cv_func_snprintf_usable=no + AC_CHECK_FUNCS([snprintf]) + if test $ac_cv_func_snprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + gl_REPLACE_SNPRINTF + fi + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi +]) + +AC_DEFUN([gl_REPLACE_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_LIBOBJ([snprintf]) + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + gl_PREREQ_SNPRINTF +]) + +# Prerequisites of lib/snprintf.c. +AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) diff --git a/m4/socklen.m4 b/m4/socklen.m4 index 36436ed80..2933d4b89 100644 --- a/m4/socklen.m4 +++ b/m4/socklen.m4 @@ -1,5 +1,5 @@ # socklen.m4 serial 7 -dnl Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 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. diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4 index bbdfabc91..8a0c23603 100644 --- a/m4/sockpfaf.m4 +++ b/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ # sockpfaf.m4 serial 7 -dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009, 2010 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. diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index 4eaef93ce..e0ccee3a5 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 4 (gettext-0.15) -dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2009-2010 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. diff --git a/m4/stat.m4 b/m4/stat.m4 index ce6933b3c..acd32d86a 100644 --- a/m4/stat.m4 +++ b/m4/stat.m4 @@ -1,6 +1,6 @@ -# serial 3 +# serial 4 -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -57,5 +57,7 @@ AC_DEFUN([gl_FUNC_STAT], esac if test $REPLACE_STAT = 1; then AC_LIBOBJ([stat]) + dnl Prerequisites of lib/stat.c. + AC_REQUIRE([AC_C_INLINE]) fi ]) diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 index a9ada4f4e..5c87bd8b5 100644 --- a/m4/stdarg.m4 +++ b/m4/stdarg.m4 @@ -1,5 +1,5 @@ # stdarg.m4 serial 3 -dnl Copyright (C) 2006, 2008-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2010 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. diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index 5e22d7a4b..3d672d747 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2010 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. diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4 index 682e9c626..c8572de94 100644 --- a/m4/stddef_h.m4 +++ b/m4/stddef_h.m4 @@ -1,6 +1,6 @@ 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 Copyright (C) 2009, 2010 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. diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 819d629e9..1cc57e6e9 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,5 +1,5 @@ # stdint.m4 serial 34 -dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2010 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. diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index 82f0c244c..b8e3c6cc7 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 @@ -1,5 +1,5 @@ # stdint_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2010 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. diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 256efe1cb..781fa8d38 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 21 -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +# stdio_h.m4 serial 25 +dnl Copyright (C) 2007-2010 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_STDIO_H], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_C_INLINE]) gl_CHECK_NEXT_HEADERS([stdio.h]) dnl No need to create extra modules for these functions. Everyone who uses dnl <stdio.h> likely needs them. @@ -30,6 +31,13 @@ AC_DEFUN([gl_STDIO_H], AC_LIBOBJ([stdio-write]) fi ]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include <stdio.h> + ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat + snprintf vdprintf vsnprintf]) ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], @@ -89,8 +97,6 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) - HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) - HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) @@ -105,6 +111,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 10e010e42..0693d1a5e 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 21 -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +# stdlib_h.m4 serial 22 +dnl Copyright (C) 2007-2010 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. @@ -22,6 +22,20 @@ AC_DEFUN([gl_STDLIB_H], # include <random.h> #endif ]]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include <stdlib.h> +#if HAVE_SYS_LOADAVG_H +# include <sys/loadavg.h> +#endif +#if HAVE_RANDOM_H +# include <random.h> +#endif + ]], [atoll canonicalize_file_name getloadavg getsubopt mkdtemp + mkostemp mkostemps mkstemp mkstemps random_r initstat_r srandom_r + setstate_r realpath rpmatch setenv strtod strtoll strtoull unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], diff --git a/m4/strcase.m4 b/m4/strcase.m4 index 0dfdb1a18..33de423a0 100644 --- a/m4/strcase.m4 +++ b/m4/strcase.m4 @@ -1,5 +1,5 @@ # strcase.m4 serial 10 -dnl Copyright (C) 2002, 2005-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2010 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. diff --git a/m4/strftime.m4 b/m4/strftime.m4 index 15a87708e..356224009 100644 --- a/m4/strftime.m4 +++ b/m4/strftime.m4 @@ -1,7 +1,6 @@ # serial 32 -# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2007, 2009-2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/string_h.m4 b/m4/string_h.m4 index e8705342b..73c6d8337 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for <string.h>. -# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2007-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 +# serial 11 # Written by Paul Eggert. @@ -21,6 +21,13 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([string.h]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C89. + gl_WARN_ON_USE_PREPARE([[#include <string.h> + ]], [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup + strndup strnlen strpbrk strsep strcasestr strtok_r strsignal strverscmp]) ]) AC_DEFUN([gl_STRING_MODULE_INDICATOR], @@ -64,7 +71,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) - GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) diff --git a/m4/strings_h.m4 b/m4/strings_h.m4 index 03ac182f3..26aa1f782 100644 --- a/m4/strings_h.m4 +++ b/m4/strings_h.m4 @@ -1,6 +1,7 @@ # Configure a replacement for <string.h>. +# serial 2 -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +17,11 @@ AC_DEFUN([gl_HEADER_STRINGS_H_BODY], [ AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([strings.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 <strings.h> + ]], [strcasecmp strncasecmp]) ]) AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4 index 436c6fec1..d864dad3e 100644 --- a/m4/sys_file_h.m4 +++ b/m4/sys_file_h.m4 @@ -1,6 +1,7 @@ # Configure a replacement for <sys/file.h>. +# serial 3 -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,6 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H], AC_CHECK_FUNCS_ONCE([flock]) gl_CHECK_NEXT_HEADERS([sys/file.h]) - SYS_FILE_H='sys/file.h' - AC_SUBST([SYS_FILE_H]) AC_CHECK_HEADERS_ONCE([sys/file.h]) if test $ac_cv_header_sys_file_h = yes; then @@ -26,6 +25,11 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H], HAVE_SYS_FILE_H=0 fi AC_SUBST([HAVE_SYS_FILE_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/file.h> + ]], [flock]) ]) AC_DEFUN([gl_HEADER_SYS_FILE_MODULE_INDICATOR], diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 index e864b2c7e..1d4765602 100644 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ -# sys_socket_h.m4 serial 13 -dnl Copyright (C) 2005-2009 Free Software Foundation, Inc. +# sys_socket_h.m4 serial 14 +dnl Copyright (C) 2005-2010 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. @@ -66,6 +66,18 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], gl_PREREQ_SYS_H_WINSOCK2 fi AC_SUBST([SYS_SOCKET_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([[ +/* Some systems require prerequisite headers. */ +#include <sys/types.h> +#if !defined __GLIBC__ && HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#include <sys/select.h> + ]], [socket connect accept bind getpeername getsockname getsockopt + listen recv send recvfrom sendto setsockopt shutdown accept4]) ]) AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 index 838cf484e..5a113d02e 100644 --- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 21 -*- Autoconf -*- -dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 22 -*- Autoconf -*- +dnl Copyright (C) 2006-2010 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. @@ -27,6 +27,11 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], [#include <sys/types.h> #include <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 + mknod mknodat stat utimensat]) ]) # gl_HEADER_SYS_STAT_H AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], diff --git a/m4/time_h.m4 b/m4/time_h.m4 index c038b1761..c00bfae92 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -1,6 +1,6 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/time_r.m4 b/m4/time_r.m4 index de22db906..b5938e796 100644 --- a/m4/time_r.m4 +++ b/m4/time_r.m4 @@ -1,6 +1,7 @@ dnl Reentrant time functions like localtime_r. -dnl Copyright (C) 2003, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +dnl 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. diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4 index 911af0a40..43bda96f9 100644 --- a/m4/tm_gmtoff.m4 +++ b/m4/tm_gmtoff.m4 @@ -1,5 +1,5 @@ # tm_gmtoff.m4 serial 3 -dnl Copyright (C) 2002, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2009-2010 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. diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index cb50d50e0..31d31c1e9 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 36 -dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. +# unistd_h.m4 serial 39 +dnl Copyright (C) 2006-2010 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. @@ -11,6 +11,7 @@ AC_DEFUN([gl_UNISTD_H], dnl Use AC_REQUIRE here, so that the default behavior below is expanded dnl once only, before all statements that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_C_INLINE]) gl_CHECK_NEXT_HEADERS([unistd.h]) @@ -21,6 +22,24 @@ AC_DEFUN([gl_UNISTD_H], HAVE_UNISTD_H=0 fi AC_SUBST([HAVE_UNISTD_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 <unistd.h> +/* Some systems declare various items in the wrong headers. */ +#ifndef __GLIBC__ +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include <io.h> +# endif +#endif + ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat + fsync ftruncate getcwd getdomainname getdtablesize getgroups + gethostname getlogin getlogin_r getpagesize getusershell setusershell + endusershell lchown link linkat lseek pipe2 pread readlink readlinkat + rmdir sleep symlink symlinkat unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -48,6 +67,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) + GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) @@ -82,6 +102,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) + HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index 3a1d1e010..50a20cca2 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ # vasnprintf.m4 serial 29 -dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2010 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. diff --git a/m4/version-etc.m4 b/m4/version-etc.m4 index 87389de5f..2c572b4bc 100644 --- a/m4/version-etc.m4 +++ b/m4/version-etc.m4 @@ -1,5 +1,5 @@ # version-etc.m4 serial 1 -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/visibility.m4 b/m4/visibility.m4 index 70bca5643..35a6dc0e7 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 @@ -1,5 +1,5 @@ # visibility.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2009, 2010 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. diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 index 3b37d460b..ed189c238 100644 --- a/m4/vsnprintf.m4 +++ b/m4/vsnprintf.m4 @@ -1,5 +1,5 @@ # vsnprintf.m4 serial 5 -dnl Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2010 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. diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4 new file mode 100644 index 000000000..ab46422ba --- /dev/null +++ b/m4/warn-on-use.m4 @@ -0,0 +1,45 @@ +# warn-on-use.m4 serial 1 +dnl Copyright (C) 2010 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. + +# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES) +# --------------------------------------- +# For each whitespace-separated element in the list of NAMES, define +# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES +# even after being undefined as a macro. +# +# See warn-on-use.h for some hints on how to poison function names, as +# well as ideas on poisoning global variables and macros. NAMES may +# include global variables, but remember that only functions work with +# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single +# header, but if the replacement header pulls in other headers because +# some systems declare functions in the wrong header, then INCLUDES +# should do likewise. +# +# If you assume C89, then it is generally safe to assume declarations +# for functions declared in that standard (such as gets) without +# needing gl_WARN_ON_USE_PREPARE. +AC_DEFUN([gl_WARN_ON_USE_PREPARE], +[ + m4_foreach_w([gl_decl], [$2], + [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), + [Define to 1 if ]m4_defn([gl_decl])[ is declared even after + undefining macros.])])dnl + for gl_func in m4_flatten([$2]); do + AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl + AC_CACHE_CHECK([whether $gl_func is declared without a macro], + [gl_Symbol], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], +[@%:@undef $gl_func + (void) $gl_func;])], + [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) + AS_VAR_IF([gl_Symbol], [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + dnl shortcut - if the raw declaration exists, then set a cache + dnl variable to allow skipping any later AC_CHECK_DECL efforts + eval ac_cv_have_decl_$gl_func=yes]) + AS_VAR_POPDEF([gl_Symbol])dnl + done +]) diff --git a/m4/warnings.m4 b/m4/warnings.m4 index 1639c0360..dad5c1f29 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,19 +1,11 @@ # warnings.m4 serial 2 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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 From Simon Josefsson -# gl_AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) -# ---------------------------------------------------- -# Provide the functionality of AS_VAR_IF if Autoconf does not have it. -m4_ifdef([AS_VAR_IF], -[m4_copy([AS_VAR_IF], [gl_AS_VAR_IF])], -[m4_define([gl_AS_VAR_IF], -[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) - # gl_AS_VAR_APPEND(VAR, VALUE) # ---------------------------- # Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. @@ -37,7 +29,7 @@ AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [ CPPFLAGS="$save_CPPFLAGS" ]) AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl -gl_AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])]) +AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])]) AS_VAR_POPDEF([gl_Flags])dnl AS_VAR_POPDEF([gl_Warn])dnl m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl diff --git a/m4/wchar.m4 b/m4/wchar.m4 index 9f22e33ea..e81485d01 100644 --- a/m4/wchar.m4 +++ b/m4/wchar.m4 @@ -1,23 +1,30 @@ dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. -dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2010 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 Eric Blake. -# wchar.m4 serial 26 +# wchar.m4 serial 31 AC_DEFUN([gl_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - AC_CACHE_CHECK([whether <wchar.h> is standalone], - [gl_cv_header_wchar_h_standalone], - [AC_COMPILE_IFELSE([[#include <wchar.h> -wchar_t w;]], - [gl_cv_header_wchar_h_standalone=yes], - [gl_cv_header_wchar_h_standalone=no])]) + AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) + dnl Prepare for creating substitute <wchar.h>. + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide + dnl character support). + dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK. + AC_CHECK_HEADERS_ONCE([wchar.h]) + gl_CHECK_NEXT_HEADERS([wchar.h]) + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + AC_SUBST([HAVE_WCHAR_H]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then @@ -27,34 +34,73 @@ wchar_t w;]], fi AC_SUBST([HAVE_WINT_T]) - 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 + 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([[ +/* Some systems require additional headers. */ +#ifndef __GLIBC__ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth]) +]) - dnl Prepare for creating substitute <wchar.h>. - dnl Do it always: WCHAR_H may be empty here but can be set later. - dnl Check for <wchar.h> (missing in Linux uClibc when built without wide - dnl character support). - AC_CHECK_HEADERS_ONCE([wchar.h]) - if test $ac_cv_header_wchar_h = yes; then - HAVE_WCHAR_H=1 - else - HAVE_WCHAR_H=0 +dnl Check whether <wchar.h> is usable at all. +AC_DEFUN([gl_WCHAR_H_INLINE_OK], +[ + dnl Test whether <wchar.h> suffers due to the transition from '__inline' to + dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022> + dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, + dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and + dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>. + AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly], + [gl_cv_header_wchar_h_correct_inline], + [gl_cv_header_wchar_h_correct_inline=yes + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +#include <wchar.h> +extern int zero (void); +int main () { return zero(); } +]])]) + if AC_TRY_EVAL([ac_compile]); then + mv conftest.$ac_objext conftest1.$ac_objext + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[#define wcstod renamed_wcstod +#include <wchar.h> +int zero (void) { return 0; } +]])]) + if AC_TRY_EVAL([ac_compile]); then + mv conftest.$ac_objext conftest2.$ac_objext + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + ]) + if test $gl_cv_header_wchar_h_correct_inline = no; then + AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted.]) fi - AC_SUBST([HAVE_WCHAR_H]) - dnl Execute this unconditionally, because WCHAR_H may be set by other - dnl modules, after this code is executed. - gl_CHECK_NEXT_HEADERS([wchar.h]) ]) dnl Unconditionally enables the replacement of <wchar.h>. AC_DEFUN([gl_REPLACE_WCHAR_H], [ - AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - WCHAR_H=wchar.h + dnl This is a no-op, because <wchar.h> is always overridden. + : ]) AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], @@ -101,5 +147,4 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) - WCHAR_H=''; AC_SUBST([WCHAR_H]) ]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index fb27a7f65..ed804e664 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2002-2003, 2008, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2010 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. diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 index 47a4363d7..a6c7d15cb 100644 --- a/m4/wint_t.m4 +++ b/m4/wint_t.m4 @@ -1,5 +1,5 @@ # wint_t.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2010 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. diff --git a/m4/write.m4 b/m4/write.m4 index 812b19b3b..56325aba9 100644 --- a/m4/write.m4 +++ b/m4/write.m4 @@ -1,5 +1,5 @@ # write.m4 serial 1 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009, 2010 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. diff --git a/m4/xsize.m4 b/m4/xsize.m4 index 631893cf5..b653693a3 100644 --- a/m4/xsize.m4 +++ b/m4/xsize.m4 @@ -1,5 +1,5 @@ # xsize.m4 serial 4 -dnl Copyright (C) 2003-2004, 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2008-2010 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. |