diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-02 20:02:44 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-02 20:02:44 +0200 |
commit | 064f9fe191932be96ecfc79fa5accf1eb25142ef (patch) | |
tree | 6e8c824b0dbbde4160dd3e6213127bafe6c738dd | |
parent | 9cd70cbfc4cfc015c10d38b2e356d286b40be416 (diff) | |
download | gnutls-064f9fe191932be96ecfc79fa5accf1eb25142ef.tar.gz |
Updated gnulib and added hash-pjw-bare
-rwxr-xr-x | build-aux/config.rpath | 106 | ||||
-rwxr-xr-x | build-aux/gendocs.sh | 35 | ||||
-rw-r--r-- | gl/Makefile.am | 14 | ||||
-rw-r--r-- | gl/base64.h | 8 | ||||
-rw-r--r-- | gl/getpass.h | 2 | ||||
-rw-r--r-- | gl/hash-pjw-bare.c | 42 | ||||
-rw-r--r-- | gl/hash-pjw-bare.h | 24 | ||||
-rw-r--r-- | gl/m4/eealloc.m4 | 3 | ||||
-rw-r--r-- | gl/m4/extern-inline.m4 | 57 | ||||
-rw-r--r-- | gl/m4/fcntl-o.m4 | 13 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 5 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 1221 | ||||
-rw-r--r-- | gl/m4/lib-ld.m4 | 58 | ||||
-rw-r--r-- | gl/m4/manywarnings.m4 | 185 | ||||
-rw-r--r-- | gl/m4/timer_time.m4 | 4 | ||||
-rw-r--r-- | gl/m4/timespec.m4 | 8 | ||||
-rw-r--r-- | gl/m4/xsize.m4 | 3 | ||||
-rw-r--r-- | gl/stdbool.in.h | 51 | ||||
-rw-r--r-- | gl/sys_select.in.h | 2 | ||||
-rw-r--r-- | gl/tests/Makefile.am | 2 | ||||
-rw-r--r-- | gl/tests/binary-io.c | 3 | ||||
-rw-r--r-- | gl/tests/binary-io.h | 11 | ||||
-rw-r--r-- | gl/tests/ioctl.c | 2 | ||||
-rw-r--r-- | gl/tests/malloca.h | 2 | ||||
-rw-r--r-- | gl/tests/test-select.h | 6 | ||||
-rw-r--r-- | gl/timespec.c | 3 | ||||
-rw-r--r-- | gl/timespec.h | 13 | ||||
-rw-r--r-- | gl/u64.c | 3 | ||||
-rw-r--r-- | gl/u64.h | 27 | ||||
-rw-r--r-- | gl/verify.h | 6 | ||||
-rw-r--r-- | gl/xsize.c | 3 | ||||
-rw-r--r-- | gl/xsize.h | 17 | ||||
-rw-r--r-- | maint.mk | 243 |
33 files changed, 1274 insertions, 908 deletions
diff --git a/build-aux/config.rpath b/build-aux/config.rpath index 17298f2348..1a07018281 100755 --- a/build-aux/config.rpath +++ b/build-aux/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2010 Free Software Foundation, Inc. +# Copyright 1996-2012 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # @@ -25,7 +25,7 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so @@ -57,13 +57,6 @@ else aix*) wl='-Wl,' ;; - darwin*) - case $cc_basename in - xlc*) - wl='-Wl,' - ;; - esac - ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) @@ -72,9 +65,7 @@ else irix5* | irix6* | nonstopux*) wl='-Wl,' ;; - newsos6) - ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' @@ -85,17 +76,26 @@ else lf95*) wl='-Wl,' ;; - pgcc | pgf77 | pgf90) + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; *Sun\ C*) wl='-Wl,' ;; @@ -103,13 +103,24 @@ else ;; esac ;; + newsos6) + ;; + *nto* | *qnx*) + ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) - wl='-Wl,' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac ;; sunos4*) wl='-Qoption ld ' @@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we cannot use - # them. - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then @@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; + haiku*) + ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; - gnu* | linux* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else @@ -325,10 +337,14 @@ else fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; bsdi[45]*) ;; @@ -342,24 +358,15 @@ else ;; darwin* | rhapsody*) hardcode_direct=no - if test "$GCC" = yes ; then + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else - case $cc_basename in - xlc*) - ;; - *) - ld_shlibs=no - ;; - esac + ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; - freebsd1*) - ld_shlibs=no - ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -420,6 +427,8 @@ else hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; + *nto* | *qnx*) + ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes @@ -515,7 +524,12 @@ case "$host_os" in library_names_spec='$libname$shrext' ;; amigaos*) - library_names_spec='$libname.a' + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac ;; beos*) library_names_spec='$libname$shrext' @@ -534,8 +548,6 @@ case "$host_os" in dgux*) library_names_spec='$libname$shrext' ;; - freebsd1*) - ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) @@ -547,6 +559,9 @@ case "$host_os" in gnu*) library_names_spec='$libname$shrext' ;; + haiku*) + library_names_spec='$libname$shrext' + ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) @@ -582,7 +597,7 @@ case "$host_os" in ;; linux*oldld* | linux*aout* | linux*coff*) ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) @@ -594,7 +609,7 @@ case "$host_os" in newsos6) library_names_spec='$libname$shrext' ;; - nto-qnx*) + *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) @@ -625,6 +640,9 @@ case "$host_os" in sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; + tpf*) + library_names_spec='$libname$shrext' + ;; uts4*) library_names_spec='$libname$shrext' ;; diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh index c8abd55fb3..c293f96f50 100755 --- a/build-aux/gendocs.sh +++ b/build-aux/gendocs.sh @@ -2,10 +2,10 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2011-04-08.14 +scriptversion=2012-09-02.17 -# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +# Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,15 +51,16 @@ unset use_texi2html version="gendocs.sh $scriptversion -Copyright 2010 Free Software Foundation, Inc. +Copyright 2012 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE -Generate various output formats from PACKAGE.texinfo (or .texi or .txi) source. -See the GNU Maintainers document for a more extensive discussion: +Generate output in various formats from PACKAGE.texinfo (or .texi or +.txi) source. See the GNU Maintainers document for a more extensive +discussion: http://www.gnu.org/prep/maintain_toc.html Options: @@ -68,6 +69,7 @@ Options: --email ADR use ADR as contact in generated web pages. --docbook convert to DocBook too (xml, txt, html, pdf and ps). --html ARG pass indicated ARG to makeinfo or texi2html for HTML targets. + --info ARG pass indicated ARG to makeinfo for Info, instead of --no-split. --texi2html use texi2html to generate HTML targets. --help display this help and exit successfully. --version display version information and exit successfully. @@ -80,11 +82,11 @@ Typical sequence: wget \"$templateurl\" $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\" -Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR -to override). Move all the new files into your web CVS tree, as -explained in the Web Pages node of maintain.texi. +Output will be in a new subdirectory \"manual\" (by default; +use -o OUTDIR to override). Move all the new files into your web CVS +tree, as explained in the Web Pages node of maintain.texi. -Please use the --email ADDRESS option to specify your bug-reporting +Please do use the --email ADDRESS option to specify your bug-reporting address in the generated HTML pages. MANUAL-TITLE is included as part of the HTML <title> of the overall @@ -102,6 +104,9 @@ If a manual's Texinfo sources are spread across several directories, first copy or symlink all Texinfo sources into a single directory. (Part of the script's work is to make a tar.gz of the sources.) +As implied above, by default monolithic Info files are generated. +If you want split Info, or other Info options, use --info to override. + You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, and DVIPS to control the programs that get executed, and GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is @@ -126,6 +131,7 @@ MANUAL_TITLE= PACKAGE= EMAIL=webmasters@gnu.org # please override with --email htmlarg= +infoarg=--no-split outdir=manual srcfile= @@ -138,6 +144,7 @@ while test $# -gt 0; do -o) shift; outdir=$1;; --docbook) docbook=yes;; --html) shift; htmlarg=$1;; + --info) shift; infoarg=$1;; --texi2html) use_texi2html=1;; -*) echo "$0: Unknown option \`$1'." >&2 @@ -188,10 +195,10 @@ case $outdir in *) abs_outdir=$srcdir/$outdir;; esac -echo Generating output formats for $srcfile +echo "Generating output formats for $srcfile" -cmd="$SETLANG $MAKEINFO -o $PACKAGE.info \"$srcfile\"" -echo "Generating info files... ($cmd)" +cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $infoarg \"$srcfile\"" +echo "Generating info file(s)... ($cmd)" eval "$cmd" mkdir -p "$outdir/" tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* @@ -204,7 +211,7 @@ echo "Generating dvi ... ($cmd)" eval "$cmd" # now, before we compress dvi: -echo Generating postscript... +echo "Generating postscript..." ${DVIPS} $PACKAGE -o gzip -f -9 $PACKAGE.ps ps_gz_size=`calcsize $PACKAGE.ps.gz` diff --git a/gl/Makefile.am b/gl/Makefile.am index eb6b6bd8c5..a277b6f692 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime hash-pjw-bare havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -591,12 +591,18 @@ EXTRA_libgnu_la_SOURCES += gettimeofday.c distclean-local: clean-GNUmakefile clean-GNUmakefile: - test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || : + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile EXTRA_DIST += $(top_srcdir)/GNUmakefile ## end gnulib module gnumakefile +## begin gnulib module hash-pjw-bare + +libgnu_la_SOURCES += hash-pjw-bare.h hash-pjw-bare.c + +## end gnulib module hash-pjw-bare + ## begin gnulib module havelib @@ -2333,6 +2339,7 @@ EXTRA_libgnu_la_SOURCES += time_r.c ## begin gnulib module timespec +libgnu_la_SOURCES += timespec.c EXTRA_DIST += timespec.h @@ -2340,6 +2347,7 @@ EXTRA_DIST += timespec.h ## begin gnulib module u64 +libgnu_la_SOURCES += u64.c EXTRA_DIST += u64.h @@ -2696,7 +2704,7 @@ EXTRA_DIST += wchar.in.h ## begin gnulib module xsize -libgnu_la_SOURCES += xsize.h +libgnu_la_SOURCES += xsize.h xsize.c ## end gnulib module xsize diff --git a/gl/base64.h b/gl/base64.h index dc6f2a4f12..b7e155cf91 100644 --- a/gl/base64.h +++ b/gl/base64.h @@ -24,6 +24,10 @@ /* Get bool. */ # include <stdbool.h> +# ifdef __cplusplus +extern "C" { +# endif + /* This uses that the expression (n+(k-1))/k means the smallest integer >= n/k, i.e., the ceiling of n/k. */ # define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4) @@ -57,4 +61,8 @@ extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx, #define base64_decode_alloc(in, inlen, out, outlen) \ base64_decode_alloc_ctx (NULL, in, inlen, out, outlen) +# ifdef __cplusplus +} +# endif + #endif /* BASE64_H */ diff --git a/gl/getpass.h b/gl/getpass.h index 4eabf9dcc6..afe6d2d492 100644 --- a/gl/getpass.h +++ b/gl/getpass.h @@ -21,7 +21,7 @@ /* Get getpass declaration, if available. */ # include <unistd.h> -# if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS +# if !HAVE_DECL_GETPASS /* Read a password of arbitrary length from /dev/tty or stdin. */ char *getpass (const char *prompt); diff --git a/gl/hash-pjw-bare.c b/gl/hash-pjw-bare.c new file mode 100644 index 0000000000..a83cfacbca --- /dev/null +++ b/gl/hash-pjw-bare.c @@ -0,0 +1,42 @@ +/* hash-pjw-bare.c -- compute a hash value from a provided buffer. + + Copyright (C) 2012 Free Software Foundation, Inc. + + This program 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 program 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 program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "hash-pjw-bare.h" + +#include <limits.h> + +#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + +/* Return a hash of the N bytes of X using the method described by + Bruno Haible in http://www.haible.de/bruno/hashfunc.html. + Note that while many hash functions reduce their result via modulo + to a 0..table_size-1 range, this function does not do that. */ + +size_t +hash_pjw_bare (const void *x, size_t n) +{ + const unsigned char *s = x; + size_t h = 0; + unsigned i; + + for (i = 0; i < n; i++) + h = s[i] + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h; +} diff --git a/gl/hash-pjw-bare.h b/gl/hash-pjw-bare.h new file mode 100644 index 0000000000..5adbc64319 --- /dev/null +++ b/gl/hash-pjw-bare.h @@ -0,0 +1,24 @@ +/* hash-pjw-bare.h -- declaration for a simple hash function + Copyright (C) 2012 Free Software Foundation, Inc. + + This program 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 program 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 program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> + +/* Compute a hash code for a buffer starting at X and of size N, + and return the hash code. Note that unlike hash_pjw(), it does not + return it modulo a table size. + The result is platform dependent: it depends on the size of the 'size_t' + type and on the signedness of the 'char' type. */ +extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4 index 75f17e2f10..9e5df45d31 100644 --- a/gl/m4/eealloc.m4 +++ b/gl/m4/eealloc.m4 @@ -1,4 +1,4 @@ -# eealloc.m4 serial 2 +# eealloc.m4 serial 3 dnl Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,7 +8,6 @@ AC_DEFUN([gl_EEALLOC], [ AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_EEREALLOC]) - AC_REQUIRE([AC_C_INLINE]) ]) AC_DEFUN([gl_EEMALLOC], diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4 new file mode 100644 index 0000000000..600c8d3fa1 --- /dev/null +++ b/gl/m4/extern-inline.m4 @@ -0,0 +1,57 @@ +dnl 'extern inline' a la ISO C99. + +dnl Copyright 2012 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_EXTERN_INLINE], +[ + AC_REQUIRE([AC_C_INLINE]) + AH_VERBATIM([extern_inline], +[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. + _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. + _GL_INLINE_HEADER_BEGIN contains useful stuff to put + in an include file, before uses of _GL_INLINE. + It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, + when FOO is an inline function in the header; see + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. + _GL_INLINE_HEADER_END contains useful stuff to put + in the same include file, after uses of _GL_INLINE. */ +#if (__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : 199901L <= __STDC_VERSION__) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +#else +# define _GL_INLINE static inline +# define _GL_EXTERN_INLINE static inline +#endif + +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4 index 9862741f39..740e78b681 100644 --- a/gl/m4/fcntl-o.m4 +++ b/gl/m4/fcntl-o.m4 @@ -50,7 +50,18 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; - if (symlink (".", sym) != 0) + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else { diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index ee3d1b6261..04f3d46735 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime hash-pjw-bare havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) @@ -51,6 +51,7 @@ gl_MODULES([ getsubopt gettext gettime + hash-pjw-bare havelib inet_ntop inet_pton @@ -112,5 +113,5 @@ gl_MAKEFILE_NAME([]) gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) -gl_WITNESS_C_DOMAIN([]) +gl_WITNESS_C_MACRO([]) gl_VC_FILES([false]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index aad1024c14..9b6156211b 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -79,6 +79,7 @@ AC_DEFUN([gl_EARLY], # Code from module error: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # Code from module extern-inline: # Code from module fcntl-h: # Code from module fcntl-h-tests: # Code from module fd-hook: @@ -139,6 +140,7 @@ AC_DEFUN([gl_EARLY], # Code from module gettimeofday: # Code from module gettimeofday-tests: # Code from module gnumakefile: + # Code from module hash-pjw-bare: # Code from module havelib: # Code from module hostent: # Code from module ignore-value: @@ -365,484 +367,484 @@ AC_DEFUN([gl_INIT], m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gl' -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([accept]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([accept]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([accept]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([accept]) changequote(,)dnl LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` changequote([, ])dnl AC_SUBST([LTALLOCA]) -gl_FUNC_ALLOCA -gl_FUNC_ALPHASORT -if test $HAVE_ALPHASORT = 0; then - AC_LIBOBJ([alphasort]) - gl_PREREQ_ALPHASORT -fi -gl_DIRENT_MODULE_INDICATOR([alphasort]) -gl_ARGP -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format]) - AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])]) -gl_HEADER_ARPA_INET -AC_PROG_MKDIR_P -gl_FUNC_BASE64 -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([bind]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([bind]) -gl_BYTESWAP -gl_CLOCK_TIME -gl_FUNC_CLOSE -if test $REPLACE_CLOSE = 1; then - AC_LIBOBJ([close]) -fi -gl_UNISTD_MODULE_INDICATOR([close]) -gl_FUNC_CLOSEDIR -if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then - AC_LIBOBJ([closedir]) -fi -gl_DIRENT_MODULE_INDICATOR([closedir]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([connect]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([connect]) -gl_DIRENT_H -gl_DIRNAME_LGPL -gl_DOUBLE_SLASH_ROOT -gl_HEADER_ERRNO_H -gl_ERROR -if test $ac_cv_lib_error_at_line = no; then - AC_LIBOBJ([error]) - gl_PREREQ_ERROR -fi -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) - AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) -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]) -fi -gl_MATH_MODULE_INDICATOR([frexp]) -gl_FUNC_FREXPL_NO_LIBM -if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then - AC_LIBOBJ([frexpl]) -fi -gl_MATH_MODULE_INDICATOR([frexpl]) -gl_FUNC_FSEEK -if test $REPLACE_FSEEK = 1; then - AC_LIBOBJ([fseek]) -fi -gl_STDIO_MODULE_INDICATOR([fseek]) -gl_FUNC_FSEEKO -if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then - AC_LIBOBJ([fseeko]) - gl_PREREQ_FSEEKO -fi -gl_STDIO_MODULE_INDICATOR([fseeko]) -gl_FUNC_FSETERR -if test $ac_cv_func___fseterr = no; then - AC_LIBOBJ([fseterr]) -fi -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]) -fi -gl_STDIO_MODULE_INDICATOR([ftell]) -gl_FUNC_FTELLO -if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then - AC_LIBOBJ([ftello]) - gl_PREREQ_FTELLO -fi -gl_STDIO_MODULE_INDICATOR([ftello]) -gl_FUNC -gl_GETADDRINFO -if test $HAVE_GETADDRINFO = 0; then - AC_LIBOBJ([getaddrinfo]) -fi -if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then - AC_LIBOBJ([gai_strerror]) -fi -gl_NETDB_MODULE_INDICATOR([getaddrinfo]) -gl_FUNC_GETDELIM -if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then - AC_LIBOBJ([getdelim]) - gl_PREREQ_GETDELIM -fi -gl_STDIO_MODULE_INDICATOR([getdelim]) -gl_FUNC_GETLINE -if test $REPLACE_GETLINE = 1; then - AC_LIBOBJ([getline]) - gl_PREREQ_GETLINE -fi -gl_STDIO_MODULE_INDICATOR([getline]) -gl_FUNC_GETOPT_GNU -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) -gl_FUNC_GETOPT_POSIX -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_FUNC_GETPASS -if test $HAVE_GETPASS = 0; then - AC_LIBOBJ([getpass]) - gl_PREREQ_GETPASS -fi -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([getpeername]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([getpeername]) -gl_FUNC_GETSUBOPT -if test $HAVE_GETSUBOPT = 0; then - AC_LIBOBJ([getsubopt]) - gl_PREREQ_GETSUBOPT -fi -gl_STDLIB_MODULE_INDICATOR([getsubopt]) -dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. -AM_GNU_GETTEXT_VERSION([0.18.1]) -AC_SUBST([LIBINTL]) -AC_SUBST([LTLIBINTL]) -gl_GETTIME -gl_FUNC_GETTIMEOFDAY -if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then - AC_LIBOBJ([gettimeofday]) - gl_PREREQ_GETTIMEOFDAY -fi -gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) -# Autoconf 2.61a.99 and earlier don't support linking a file only -# in VPATH builds. But since GNUmakefile is for maintainer use -# only, it does not matter if we skip the link with older autoconf. -# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH -# builds, so use a shell variable to bypass this. -GNUmakefile=GNUmakefile -m4_if(m4_version_compare([2.61a.100], - m4_defn([m4_PACKAGE_VERSION])), [1], [], - [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], - [GNUmakefile=$GNUmakefile])]) -gl_HOSTENT -gl_FUNC_INET_NTOP -if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then - AC_LIBOBJ([inet_ntop]) - gl_PREREQ_INET_NTOP -fi -gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) -gl_FUNC_INET_PTON -if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then - AC_LIBOBJ([inet_pton]) - gl_PREREQ_INET_PTON -fi -gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) -gl_FUNC_ISNAND_NO_LIBM -if test $gl_func_isnand_no_libm != yes; then - AC_LIBOBJ([isnand]) - gl_PREREQ_ISNAND -fi -gl_FUNC_ISNANF_NO_LIBM -if test $gl_func_isnanf_no_libm != yes; then - AC_LIBOBJ([isnanf]) - gl_PREREQ_ISNANF -fi -gl_FUNC_ISNANL_NO_LIBM -if test $gl_func_isnanl_no_libm != yes; then - AC_LIBOBJ([isnanl]) - gl_PREREQ_ISNANL -fi -AC_REQUIRE([gl_LARGEFILE]) -gl_LD_OUTPUT_DEF -gl_LD_VERSION_SCRIPT -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([listen]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([listen]) -gl_FUNC_LSEEK -if test $REPLACE_LSEEK = 1; then - AC_LIBOBJ([lseek]) -fi -gl_UNISTD_MODULE_INDICATOR([lseek]) -AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], - [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) -gl_FUNC_MALLOC_GNU -if test $REPLACE_MALLOC = 1; then - AC_LIBOBJ([malloc]) -fi -gl_MODULE_INDICATOR([malloc-gnu]) -gl_FUNC_MALLOC_POSIX -if test $REPLACE_MALLOC = 1; then - AC_LIBOBJ([malloc]) -fi -gl_STDLIB_MODULE_INDICATOR([malloc-posix]) -gl_MATH_H -gl_FUNC_MEMCHR -if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then - AC_LIBOBJ([memchr]) - gl_PREREQ_MEMCHR -fi -gl_STRING_MODULE_INDICATOR([memchr]) -gl_FUNC_MEMMEM_SIMPLE -if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then - AC_LIBOBJ([memmem]) -fi -gl_STRING_MODULE_INDICATOR([memmem]) -gl_FUNC_MEMPCPY -if test $HAVE_MEMPCPY = 0; then - AC_LIBOBJ([mempcpy]) - gl_PREREQ_MEMPCPY -fi -gl_STRING_MODULE_INDICATOR([mempcpy]) -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 -AC_PROG_MKDIR_P -gl_FUNC_OPENDIR -if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then - AC_LIBOBJ([opendir]) -fi -gl_DIRENT_MODULE_INDICATOR([opendir]) -AC_PATH_PROG([PMCCABE], [pmccabe], [false]) -gl_FUNC_PRINTF_FREXP -gl_FUNC_PRINTF_FREXPL -m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) -AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) -AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) -gl_FUNC_RAWMEMCHR -if test $HAVE_RAWMEMCHR = 0; then - AC_LIBOBJ([rawmemchr]) - gl_PREREQ_RAWMEMCHR -fi -gl_STRING_MODULE_INDICATOR([rawmemchr]) -gl_PREREQ_READ_FILE -gl_FUNC_READDIR -if test $HAVE_READDIR = 0; then - AC_LIBOBJ([readdir]) -fi -gl_DIRENT_MODULE_INDICATOR([readdir]) -gl_FUNC_REALLOC_POSIX -if test $REPLACE_REALLOC = 1; then - AC_LIBOBJ([realloc]) -fi -gl_STDLIB_MODULE_INDICATOR([realloc-posix]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([recv]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([recv]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([recvfrom]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom]) -gl_FUNC_SCANDIR -if test $HAVE_SCANDIR = 0; then - AC_LIBOBJ([scandir]) - gl_PREREQ_SCANDIR -fi -gl_DIRENT_MODULE_INDICATOR([scandir]) -gl_FUNC_SELECT -if test $REPLACE_SELECT = 1; then - AC_LIBOBJ([select]) -fi -gl_SYS_SELECT_MODULE_INDICATOR([select]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([send]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([send]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([sendto]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([sendto]) -gl_SERVENT -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([setsockopt]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([shutdown]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([shutdown]) -gl_SIGNAL_H -gl_SIGNBIT -if test $REPLACE_SIGNBIT = 1; then - AC_LIBOBJ([signbitf]) - AC_LIBOBJ([signbitd]) - AC_LIBOBJ([signbitl]) -fi -gl_MATH_MODULE_INDICATOR([signbit]) -gl_SIZE_MAX -gl_FUNC_SLEEP -if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then - AC_LIBOBJ([sleep]) -fi -gl_UNISTD_MODULE_INDICATOR([sleep]) -gl_FUNC_SNPRINTF -gl_STDIO_MODULE_INDICATOR([snprintf]) -gl_MODULE_INDICATOR([snprintf]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([socket]) -fi -# When this module is used, sockets may actually occur as file descriptors, -# hence it is worth warning if the modules 'close' and 'ioctl' are not used. -m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) -m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) -AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) -if test "$ac_cv_header_winsock2_h" = yes; then - UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 - SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 -fi -gl_SYS_SOCKET_MODULE_INDICATOR([socket]) -gl_SOCKETLIB -gl_SOCKETS -gl_TYPE_SOCKLEN_T -gt_TYPE_SSIZE_T -gl_STDALIGN_H -gl_STDARG_H -AM_STDBOOL_H -gl_STDDEF_H -gl_STDINT_H -gl_STDIO_H -gl_STDLIB_H -gl_STRCASE -if test $HAVE_STRCASECMP = 0; then - AC_LIBOBJ([strcasecmp]) - gl_PREREQ_STRCASECMP -fi -if test $HAVE_STRNCASECMP = 0; then - AC_LIBOBJ([strncasecmp]) - gl_PREREQ_STRNCASECMP -fi -gl_FUNC_STRCHRNUL -if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then - AC_LIBOBJ([strchrnul]) - gl_PREREQ_STRCHRNUL -fi -gl_STRING_MODULE_INDICATOR([strchrnul]) -gl_FUNC_STRDUP_POSIX -if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then - AC_LIBOBJ([strdup]) - gl_PREREQ_STRDUP -fi -gl_STRING_MODULE_INDICATOR([strdup]) -gl_FUNC_STRERROR -if test $REPLACE_STRERROR = 1; then - AC_LIBOBJ([strerror]) -fi -gl_MODULE_INDICATOR([strerror]) -gl_STRING_MODULE_INDICATOR([strerror]) -AC_REQUIRE([gl_HEADER_ERRNO_H]) -AC_REQUIRE([gl_FUNC_STRERROR_0]) -if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then - AC_LIBOBJ([strerror-override]) - gl_PREREQ_SYS_H_WINSOCK2 -fi -gl_HEADER_STRING_H -gl_HEADER_STRINGS_H -gl_FUNC_STRNDUP -if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then - AC_LIBOBJ([strndup]) -fi -gl_STRING_MODULE_INDICATOR([strndup]) -gl_FUNC_STRNLEN -if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then - AC_LIBOBJ([strnlen]) - gl_PREREQ_STRNLEN -fi -gl_STRING_MODULE_INDICATOR([strnlen]) -gl_FUNC_STRTOK_R -if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then - AC_LIBOBJ([strtok_r]) - gl_PREREQ_STRTOK_R -fi -gl_STRING_MODULE_INDICATOR([strtok_r]) -gl_FUNC_STRVERSCMP -if test $HAVE_STRVERSCMP = 0; then - AC_LIBOBJ([strverscmp]) - gl_PREREQ_STRVERSCMP -fi -gl_STRING_MODULE_INDICATOR([strverscmp]) -gl_HEADER_SYS_SELECT -AC_PROG_MKDIR_P -gl_HEADER_SYS_SOCKET -AC_PROG_MKDIR_P -gl_HEADER_SYS_STAT_H -AC_PROG_MKDIR_P -gl_HEADER_SYS_TIME_H -AC_PROG_MKDIR_P -gl_SYS_TYPES_H -AC_PROG_MKDIR_P -gl_HEADER_SYS_UIO -AC_PROG_MKDIR_P -gl_SYSEXITS -gl_THREADLIB -gl_HEADER_TIME_H -gl_TIME_R -if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then - AC_LIBOBJ([time_r]) - gl_PREREQ_TIME_R -fi -gl_TIME_MODULE_INDICATOR([time_r]) -gl_TIMER_TIME -gl_TIMESPEC -AC_REQUIRE([AC_C_INLINE]) -gl_UNISTD_H -gl_VALGRIND_TESTS -gl_FUNC_VASNPRINTF -gl_FUNC_VASPRINTF -gl_STDIO_MODULE_INDICATOR([vasprintf]) -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) - AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) -gl_VERSION_ETC -gl_FUNC_VFPRINTF_POSIX -gl_STDIO_MODULE_INDICATOR([vfprintf-posix]) -gl_FUNC_VPRINTF_POSIX -gl_STDIO_MODULE_INDICATOR([vprintf-posix]) -gl_FUNC_VSNPRINTF -gl_STDIO_MODULE_INDICATOR([vsnprintf]) -gl_WCHAR_H -gl_XSIZE + gl_FUNC_ALLOCA + gl_FUNC_ALPHASORT + if test $HAVE_ALPHASORT = 0; then + AC_LIBOBJ([alphasort]) + gl_PREREQ_ALPHASORT + fi + gl_DIRENT_MODULE_INDICATOR([alphasort]) + gl_ARGP + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])]) + gl_HEADER_ARPA_INET + AC_PROG_MKDIR_P + gl_FUNC_BASE64 + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([bind]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([bind]) + gl_BYTESWAP + gl_CLOCK_TIME + gl_FUNC_CLOSE + if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) + fi + gl_UNISTD_MODULE_INDICATOR([close]) + gl_FUNC_CLOSEDIR + if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then + AC_LIBOBJ([closedir]) + fi + gl_DIRENT_MODULE_INDICATOR([closedir]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([connect]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([connect]) + gl_DIRENT_H + gl_DIRNAME_LGPL + gl_DOUBLE_SLASH_ROOT + gl_HEADER_ERRNO_H + gl_ERROR + if test $ac_cv_lib_error_at_line = no; then + AC_LIBOBJ([error]) + gl_PREREQ_ERROR + fi + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) + AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + AC_REQUIRE([gl_EXTERN_INLINE]) + 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]) + fi + gl_MATH_MODULE_INDICATOR([frexp]) + gl_FUNC_FREXPL_NO_LIBM + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then + AC_LIBOBJ([frexpl]) + fi + gl_MATH_MODULE_INDICATOR([frexpl]) + gl_FUNC_FSEEK + if test $REPLACE_FSEEK = 1; then + AC_LIBOBJ([fseek]) + fi + gl_STDIO_MODULE_INDICATOR([fseek]) + gl_FUNC_FSEEKO + if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then + AC_LIBOBJ([fseeko]) + gl_PREREQ_FSEEKO + fi + gl_STDIO_MODULE_INDICATOR([fseeko]) + gl_FUNC_FSETERR + if test $ac_cv_func___fseterr = no; then + AC_LIBOBJ([fseterr]) + fi + 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]) + fi + gl_STDIO_MODULE_INDICATOR([ftell]) + gl_FUNC_FTELLO + if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then + AC_LIBOBJ([ftello]) + gl_PREREQ_FTELLO + fi + gl_STDIO_MODULE_INDICATOR([ftello]) + gl_FUNC + gl_GETADDRINFO + if test $HAVE_GETADDRINFO = 0; then + AC_LIBOBJ([getaddrinfo]) + fi + if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then + AC_LIBOBJ([gai_strerror]) + fi + gl_NETDB_MODULE_INDICATOR([getaddrinfo]) + gl_FUNC_GETDELIM + if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then + AC_LIBOBJ([getdelim]) + gl_PREREQ_GETDELIM + fi + gl_STDIO_MODULE_INDICATOR([getdelim]) + gl_FUNC_GETLINE + if test $REPLACE_GETLINE = 1; then + AC_LIBOBJ([getline]) + gl_PREREQ_GETLINE + fi + gl_STDIO_MODULE_INDICATOR([getline]) + gl_FUNC_GETOPT_GNU + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_FUNC_GETPASS + if test $HAVE_GETPASS = 0; then + AC_LIBOBJ([getpass]) + gl_PREREQ_GETPASS + fi + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([getpeername]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([getpeername]) + gl_FUNC_GETSUBOPT + if test $HAVE_GETSUBOPT = 0; then + AC_LIBOBJ([getsubopt]) + gl_PREREQ_GETSUBOPT + fi + gl_STDLIB_MODULE_INDICATOR([getsubopt]) + dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. + AM_GNU_GETTEXT_VERSION([0.18.1]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + gl_HOSTENT + gl_FUNC_INET_NTOP + if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_ntop]) + gl_PREREQ_INET_NTOP + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) + gl_FUNC_INET_PTON + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_pton]) + gl_PREREQ_INET_PTON + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) + gl_FUNC_ISNAND_NO_LIBM + if test $gl_func_isnand_no_libm != yes; then + AC_LIBOBJ([isnand]) + gl_PREREQ_ISNAND + fi + gl_FUNC_ISNANF_NO_LIBM + if test $gl_func_isnanf_no_libm != yes; then + AC_LIBOBJ([isnanf]) + gl_PREREQ_ISNANF + fi + gl_FUNC_ISNANL_NO_LIBM + if test $gl_func_isnanl_no_libm != yes; then + AC_LIBOBJ([isnanl]) + gl_PREREQ_ISNANL + fi + AC_REQUIRE([gl_LARGEFILE]) + gl_LD_OUTPUT_DEF + gl_LD_VERSION_SCRIPT + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([listen]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([listen]) + gl_FUNC_LSEEK + if test $REPLACE_LSEEK = 1; then + AC_LIBOBJ([lseek]) + fi + gl_UNISTD_MODULE_INDICATOR([lseek]) + AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], + [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) + gl_FUNC_MALLOC_GNU + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_MODULE_INDICATOR([malloc-gnu]) + gl_FUNC_MALLOC_POSIX + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gl_MATH_H + gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi + gl_STRING_MODULE_INDICATOR([memchr]) + gl_FUNC_MEMMEM_SIMPLE + if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then + AC_LIBOBJ([memmem]) + fi + gl_STRING_MODULE_INDICATOR([memmem]) + gl_FUNC_MEMPCPY + if test $HAVE_MEMPCPY = 0; then + AC_LIBOBJ([mempcpy]) + gl_PREREQ_MEMPCPY + fi + gl_STRING_MODULE_INDICATOR([mempcpy]) + 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 + AC_PROG_MKDIR_P + gl_FUNC_OPENDIR + if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then + AC_LIBOBJ([opendir]) + fi + gl_DIRENT_MODULE_INDICATOR([opendir]) + AC_PATH_PROG([PMCCABE], [pmccabe], [false]) + gl_FUNC_PRINTF_FREXP + gl_FUNC_PRINTF_FREXPL + m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) + AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) + AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) + gl_FUNC_RAWMEMCHR + if test $HAVE_RAWMEMCHR = 0; then + AC_LIBOBJ([rawmemchr]) + gl_PREREQ_RAWMEMCHR + fi + gl_STRING_MODULE_INDICATOR([rawmemchr]) + gl_PREREQ_READ_FILE + gl_FUNC_READDIR + if test $HAVE_READDIR = 0; then + AC_LIBOBJ([readdir]) + fi + gl_DIRENT_MODULE_INDICATOR([readdir]) + gl_FUNC_REALLOC_POSIX + if test $REPLACE_REALLOC = 1; then + AC_LIBOBJ([realloc]) + fi + gl_STDLIB_MODULE_INDICATOR([realloc-posix]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([recv]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([recv]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([recvfrom]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom]) + gl_FUNC_SCANDIR + if test $HAVE_SCANDIR = 0; then + AC_LIBOBJ([scandir]) + gl_PREREQ_SCANDIR + fi + gl_DIRENT_MODULE_INDICATOR([scandir]) + gl_FUNC_SELECT + if test $REPLACE_SELECT = 1; then + AC_LIBOBJ([select]) + fi + gl_SYS_SELECT_MODULE_INDICATOR([select]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([send]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([send]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([sendto]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([sendto]) + gl_SERVENT + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([setsockopt]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([shutdown]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([shutdown]) + gl_SIGNAL_H + gl_SIGNBIT + if test $REPLACE_SIGNBIT = 1; then + AC_LIBOBJ([signbitf]) + AC_LIBOBJ([signbitd]) + AC_LIBOBJ([signbitl]) + fi + gl_MATH_MODULE_INDICATOR([signbit]) + gl_SIZE_MAX + gl_FUNC_SLEEP + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + AC_LIBOBJ([sleep]) + fi + gl_UNISTD_MODULE_INDICATOR([sleep]) + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_MODULE_INDICATOR([snprintf]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([socket]) + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + gl_SYS_SOCKET_MODULE_INDICATOR([socket]) + gl_SOCKETLIB + gl_SOCKETS + gl_TYPE_SOCKLEN_T + gt_TYPE_SSIZE_T + gl_STDALIGN_H + gl_STDARG_H + AM_STDBOOL_H + gl_STDDEF_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_STRCASE + if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP + fi + if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP + fi + gl_FUNC_STRCHRNUL + if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then + AC_LIBOBJ([strchrnul]) + gl_PREREQ_STRCHRNUL + fi + gl_STRING_MODULE_INDICATOR([strchrnul]) + gl_FUNC_STRDUP_POSIX + if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then + AC_LIBOBJ([strdup]) + gl_PREREQ_STRDUP + fi + gl_STRING_MODULE_INDICATOR([strdup]) + gl_FUNC_STRERROR + if test $REPLACE_STRERROR = 1; then + AC_LIBOBJ([strerror]) + fi + gl_MODULE_INDICATOR([strerror]) + gl_STRING_MODULE_INDICATOR([strerror]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_HEADER_STRING_H + gl_HEADER_STRINGS_H + gl_FUNC_STRNDUP + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + AC_LIBOBJ([strndup]) + fi + gl_STRING_MODULE_INDICATOR([strndup]) + gl_FUNC_STRNLEN + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + AC_LIBOBJ([strnlen]) + gl_PREREQ_STRNLEN + fi + gl_STRING_MODULE_INDICATOR([strnlen]) + gl_FUNC_STRTOK_R + if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then + AC_LIBOBJ([strtok_r]) + gl_PREREQ_STRTOK_R + fi + gl_STRING_MODULE_INDICATOR([strtok_r]) + gl_FUNC_STRVERSCMP + if test $HAVE_STRVERSCMP = 0; then + AC_LIBOBJ([strverscmp]) + gl_PREREQ_STRVERSCMP + fi + gl_STRING_MODULE_INDICATOR([strverscmp]) + gl_HEADER_SYS_SELECT + AC_PROG_MKDIR_P + gl_HEADER_SYS_SOCKET + AC_PROG_MKDIR_P + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_UIO + AC_PROG_MKDIR_P + gl_SYSEXITS + gl_THREADLIB + gl_HEADER_TIME_H + gl_TIME_R + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi + gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIMER_TIME + gl_TIMESPEC + gl_UNISTD_H + gl_VALGRIND_TESTS + gl_FUNC_VASNPRINTF + gl_FUNC_VASPRINTF + gl_STDIO_MODULE_INDICATOR([vasprintf]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) + gl_VERSION_ETC + gl_FUNC_VFPRINTF_POSIX + gl_STDIO_MODULE_INDICATOR([vfprintf-posix]) + gl_FUNC_VPRINTF_POSIX + gl_STDIO_MODULE_INDICATOR([vprintf-posix]) + gl_FUNC_VSNPRINTF + gl_STDIO_MODULE_INDICATOR([vsnprintf]) + gl_WCHAR_H + gl_XSIZE # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -889,139 +891,137 @@ changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) -AC_REQUIRE([AC_C_INLINE]) -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 -gl_FUNC_UNGETC_WORKS -gl_FUNC_FTRUNCATE -if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then - AC_LIBOBJ([ftruncate]) - gl_PREREQ_FTRUNCATE -fi -gl_UNISTD_MODULE_INDICATOR([ftruncate]) -gl_FUNC_GETCWD_LGPL -if test $REPLACE_GETCWD = 1; then - AC_LIBOBJ([getcwd-lgpl]) -fi -gl_UNISTD_MODULE_INDICATOR([getcwd]) -gl_FUNC_GETPAGESIZE -if test $REPLACE_GETPAGESIZE = 1; then - AC_LIBOBJ([getpagesize]) -fi -gl_UNISTD_MODULE_INDICATOR([getpagesize]) -AC_REQUIRE([AC_C_INLINE]) -AC_C_BIGENDIAN -AC_C_BIGENDIAN -gl_INTTYPES_H -gl_INTTYPES_INCOMPLETE -gl_FUNC_IOCTL -if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then - AC_LIBOBJ([ioctl]) -fi -gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) -gl_DOUBLE_EXPONENT_LOCATION -gl_FLOAT_EXPONENT_LOCATION -gl_LONG_DOUBLE_EXPONENT_LOCATION -AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) -gl_LOCK -gl_FUNC_LSTAT -if test $REPLACE_LSTAT = 1; then - AC_LIBOBJ([lstat]) - gl_PREREQ_LSTAT -fi -gl_SYS_STAT_MODULE_INDICATOR([lstat]) -gl_MALLOCA -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_FUNC_OPEN -if test $REPLACE_OPEN = 1; then - AC_LIBOBJ([open]) - gl_PREREQ_OPEN -fi -gl_FCNTL_MODULE_INDICATOR([open]) -gl_PATHMAX -gl_FUNC_PERROR -if test $REPLACE_PERROR = 1; then - AC_LIBOBJ([perror]) -fi -gl_STRING_MODULE_INDICATOR([perror]) -gl_FUNC_PIPE -if test $HAVE_PIPE = 0; then - AC_LIBOBJ([pipe]) -fi -gl_UNISTD_MODULE_INDICATOR([pipe]) -gl_FUNC_PUTENV -if test $REPLACE_PUTENV = 1; then - AC_LIBOBJ([putenv]) -fi -gl_STDLIB_MODULE_INDICATOR([putenv]) -dnl Check for prerequisites for memory fence checks. -gl_FUNC_MMAP_ANON -AC_CHECK_HEADERS_ONCE([sys/mman.h]) -AC_CHECK_FUNCS_ONCE([mprotect]) -AC_CHECK_HEADERS_ONCE([sys/wait.h]) -gl_FUNC_SETENV -if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then - AC_LIBOBJ([setenv]) -fi -gl_STDLIB_MODULE_INDICATOR([setenv]) -AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) -AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) -AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) -AC_CHECK_DECLS_ONCE([alarm]) -gl_FUNC_STAT -if test $REPLACE_STAT = 1; then - AC_LIBOBJ([stat]) - gl_PREREQ_STAT -fi -gl_SYS_STAT_MODULE_INDICATOR([stat]) -gt_TYPE_WCHAR_T -gt_TYPE_WINT_T -gl_FUNC_STRERROR_R -if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then - AC_LIBOBJ([strerror_r]) - gl_PREREQ_STRERROR_R -fi -gl_STRING_MODULE_INDICATOR([strerror_r]) -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_FUNC_SYMLINK -if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then - AC_LIBOBJ([symlink]) -fi -gl_UNISTD_MODULE_INDICATOR([symlink]) -gl_SYS_IOCTL_H -AC_PROG_MKDIR_P -AC_CHECK_FUNCS_ONCE([shutdown]) -gl_FUNC_UNSETENV -if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then - AC_LIBOBJ([unsetenv]) - gl_PREREQ_UNSETENV -fi -gl_STDLIB_MODULE_INDICATOR([unsetenv]) -gl_VALGRIND_TESTS -abs_aux_dir=`cd "$ac_aux_dir"; pwd` -AC_SUBST([abs_aux_dir]) + 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 + gl_FUNC_UNGETC_WORKS + gl_FUNC_FTRUNCATE + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + AC_LIBOBJ([ftruncate]) + gl_PREREQ_FTRUNCATE + fi + gl_UNISTD_MODULE_INDICATOR([ftruncate]) + gl_FUNC_GETCWD_LGPL + if test $REPLACE_GETCWD = 1; then + AC_LIBOBJ([getcwd-lgpl]) + fi + gl_UNISTD_MODULE_INDICATOR([getcwd]) + gl_FUNC_GETPAGESIZE + if test $REPLACE_GETPAGESIZE = 1; then + AC_LIBOBJ([getpagesize]) + fi + gl_UNISTD_MODULE_INDICATOR([getpagesize]) + AC_C_BIGENDIAN + AC_C_BIGENDIAN + gl_INTTYPES_H + gl_INTTYPES_INCOMPLETE + gl_FUNC_IOCTL + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + AC_LIBOBJ([ioctl]) + fi + gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) + gl_DOUBLE_EXPONENT_LOCATION + gl_FLOAT_EXPONENT_LOCATION + gl_LONG_DOUBLE_EXPONENT_LOCATION + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + gl_LOCK + gl_FUNC_LSTAT + if test $REPLACE_LSTAT = 1; then + AC_LIBOBJ([lstat]) + gl_PREREQ_LSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([lstat]) + gl_MALLOCA + 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_FUNC_OPEN + if test $REPLACE_OPEN = 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + gl_FCNTL_MODULE_INDICATOR([open]) + gl_PATHMAX + gl_FUNC_PERROR + if test $REPLACE_PERROR = 1; then + AC_LIBOBJ([perror]) + fi + gl_STRING_MODULE_INDICATOR([perror]) + gl_FUNC_PIPE + if test $HAVE_PIPE = 0; then + AC_LIBOBJ([pipe]) + fi + gl_UNISTD_MODULE_INDICATOR([pipe]) + gl_FUNC_PUTENV + if test $REPLACE_PUTENV = 1; then + AC_LIBOBJ([putenv]) + fi + gl_STDLIB_MODULE_INDICATOR([putenv]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_HEADERS_ONCE([sys/wait.h]) + gl_FUNC_SETENV + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + AC_LIBOBJ([setenv]) + fi + gl_STDLIB_MODULE_INDICATOR([setenv]) + AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) + AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) + gt_TYPE_WCHAR_T + gt_TYPE_WINT_T + gl_FUNC_STRERROR_R + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AC_LIBOBJ([strerror_r]) + gl_PREREQ_STRERROR_R + fi + gl_STRING_MODULE_INDICATOR([strerror_r]) + 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_FUNC_SYMLINK + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + AC_LIBOBJ([symlink]) + fi + gl_UNISTD_MODULE_INDICATOR([symlink]) + gl_SYS_IOCTL_H + AC_PROG_MKDIR_P + AC_CHECK_FUNCS_ONCE([shutdown]) + gl_FUNC_UNSETENV + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + fi + gl_STDLIB_MODULE_INDICATOR([unsetenv]) + gl_VALGRIND_TESTS + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) m4_popdef([gl_MODULE_INDICATOR_CONDITION]) m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || @@ -1195,6 +1195,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/gettime.c lib/gettimeofday.c lib/glthread/threadlib.c + lib/hash-pjw-bare.c + lib/hash-pjw-bare.h lib/inet_ntop.c lib/inet_pton.c lib/intprops.h @@ -1289,7 +1291,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/sysexits.in.h lib/time.in.h lib/time_r.c + lib/timespec.c lib/timespec.h + lib/u64.c lib/u64.h lib/unistd.in.h lib/vasnprintf.c @@ -1304,6 +1308,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/vsnprintf.c lib/w32sock.h lib/wchar.in.h + lib/xsize.c lib/xsize.h m4/00gnulib.m4 m4/alloca.m4 @@ -1328,6 +1333,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/exponentf.m4 m4/exponentl.m4 m4/extensions.m4 + m4/extern-inline.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 m4/fdopen.m4 @@ -1654,6 +1660,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-vsnprintf.c tests/test-wchar.c tests/zerosize-ptr.h + tests=lib/binary-io.c tests=lib/binary-io.h tests=lib/dup2.c tests=lib/fcntl.in.h diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4 index 4e1374d9bc..e1feab5405 100644 --- a/gl/m4/lib-ld.m4 +++ b/gl/m4/lib-ld.m4 @@ -1,33 +1,39 @@ -# lib-ld.m4 serial 5 (gettext-0.18.2) +# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2012 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 Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; + acl_cv_prog_gnu_ld=yes + ;; *) - acl_cv_prog_gnu_ld=no ;; + acl_cv_prog_gnu_ld=no + ;; esac]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) -dnl From libtool-1.4. Sets the variable LD. +dnl From libtool-2.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl +[AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld [default=no]])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -40,10 +46,11 @@ if test "${PATH_SEPARATOR+set}" != set; then || PATH_SEPARATOR=';' } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -53,11 +60,11 @@ if test "$GCC" = yes; then esac case $ac_prog in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -78,23 +85,26 @@ else fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; + test "$with_gnu_ld" != no && break + ;; *) - test "$with_gnu_ld" != yes && break ;; + test "$with_gnu_ld" != yes && break + ;; esac fi done - IFS="$ac_save_ifs" + IFS="$acl_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4 index 864fc85198..f3cb23be1c 100644 --- a/gl/m4/manywarnings.m4 +++ b/gl/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 4 +# manywarnings.m4 serial 5 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,14 +35,12 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT], # make sure your gcc understands it. AC_DEFUN([gl_MANYWARN_ALL_GCC], [ - dnl First, check if -Wno-missing-field-initializers is needed. - dnl -Wmissing-field-initializers is implied by -W, but that issues - dnl warnings with GCC version before 4.7, for the common idiom - dnl of initializing types on the stack to zero, using { 0, } + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) if test -n "$GCC"; then - dnl First, check -W -Werror -Wno-missing-field-initializers is supported + dnl Check if -W -Werror -Wno-missing-field-initializers is supported dnl with the current $CC $CFLAGS $CPPFLAGS. AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ @@ -77,107 +75,150 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], ]) AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) fi + + dnl Next, check if -Werror -Wuninitialized is useful with the + dnl user's choice of $CFLAGS; some versions of gcc warn that it + dnl has no effect if -O is not also used + AC_MSG_CHECKING([whether -Wuninitialized is supported]) + AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_uninitialized_supported=yes], + [gl_cv_cc_uninitialized_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + fi + # List all gcc warning categories. gl_manywarn_set= for gl_manywarn_item in \ - -Wall \ -W \ - -Wformat-y2k \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wmissing-include-dirs \ - -Wswitch-default \ - -Wswitch-enum \ - -Wunused \ - -Wunknown-pragmas \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wsystem-headers \ - -Wfloat-equal \ - -Wtraditional \ - -Wtraditional-conversion \ - -Wdeclaration-after-statement \ - -Wundef \ - -Wshadow \ - -Wunsafe-loop-optimizations \ - -Wpointer-arith \ + -Wabi \ + -Waddress \ + -Wall \ + -Warray-bounds \ + -Wattributes \ -Wbad-function-cast \ - -Wc++-compat \ - -Wcast-qual \ - -Wcast-align \ - -Wwrite-strings \ - -Wconversion \ - -Wsign-conversion \ - -Wlogical-op \ - -Waggregate-return \ - -Wstrict-prototypes \ - -Wold-style-definition \ - -Wmissing-prototypes \ - -Wmissing-declarations \ - -Wmissing-noreturn \ - -Wmissing-format-attribute \ - -Wpacked \ - -Wpadded \ - -Wredundant-decls \ - -Wnested-externs \ - -Wunreachable-code \ - -Winline \ - -Winvalid-pch \ - -Wlong-long \ - -Wvla \ - -Wvolatile-register-var \ - -Wdisabled-optimization \ - -Wstack-protector \ - -Woverlength-strings \ -Wbuiltin-macro-redefined \ - -Wmudflap \ - -Wpacked-bitfield-compat \ - -Wsync-nand \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ - -Wattributes \ + -Wcast-align \ + -Wchar-subscripts \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ -Wcoverage-mismatch \ - -Wunused-macros \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # More warnings from gcc 4.6.2 --help=warnings. - for gl_manywarn_item in \ - -Wabi \ -Wcpp \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdisabled-optimization \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wempty-body \ -Wendif-labels \ + -Wenum-compare \ -Wextra \ -Wformat-contains-nul \ -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-y2k \ -Wformat-zero-length \ -Wformat=2 \ + -Wfree-nonheap-object \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Winit-self \ + -Winline \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-format-attribute \ + -Wmissing-include-dirs \ + -Wmissing-noreturn \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmudflap \ -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ -Wnormalized=nfc \ + -Wold-style-declaration \ + -Wold-style-definition \ -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-sign \ -Wpointer-to-int-cast \ -Wpragmas \ + -Wreturn-type \ + -Wsequence-point \ + -Wshadow \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wswitch \ + -Wswitch-default \ + -Wsync-nand \ + -Wsystem-headers \ -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunreachable-code \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done - # Disable the missing-field-initializers warning if needed + # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" fi + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + $1=$gl_manywarn_set ]) diff --git a/gl/m4/timer_time.m4 b/gl/m4/timer_time.m4 index d6e0efeb61..bc84554b78 100644 --- a/gl/m4/timer_time.m4 +++ b/gl/m4/timer_time.m4 @@ -1,4 +1,4 @@ -# timer_time.m4 serial 1 +# timer_time.m4 serial 2 dnl Copyright (C) 2011-2012 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_TIMER_TIME], #endif #endif ], - [LIB_TIMER_TIME="$LIBMULTITHREAD $LIB_TIMER_TIME"]) + [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) AC_CHECK_FUNCS([timer_settime]) LIBS=$gl_saved_libs ]) diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4 index 597b9c2d1a..63c00e83cd 100644 --- a/gl/m4/timespec.m4 +++ b/gl/m4/timespec.m4 @@ -1,4 +1,4 @@ -#serial 14 +#serial 15 # Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc. @@ -8,8 +8,4 @@ dnl From Jim Meyering -AC_DEFUN([gl_TIMESPEC], -[ - dnl Prerequisites of lib/timespec.h. - AC_REQUIRE([AC_C_INLINE]) -]) +AC_DEFUN([gl_TIMESPEC], [:]) diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4 index b3b7feebfa..d85a5f10f8 100644 --- a/gl/m4/xsize.m4 +++ b/gl/m4/xsize.m4 @@ -1,4 +1,4 @@ -# xsize.m4 serial 4 +# xsize.m4 serial 5 dnl Copyright (C) 2003-2004, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,5 @@ AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) - AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS([stdint.h]) ]) diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h index ed1f9aa488..1f8caee4f2 100644 --- a/gl/stdbool.in.h +++ b/gl/stdbool.in.h @@ -66,24 +66,19 @@ # undef true #endif -/* For the sake of symbolic names in gdb, we define true and false as - enum constants, not only as macros. - It is tempting to write - typedef enum { false = 0, true = 1 } _Bool; - so that gdb prints values of type 'bool' symbolically. But if we do - this, values of type '_Bool' may promote to 'int' or 'unsigned int' - (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' - (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the - enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) +#ifdef __cplusplus +# define _Bool bool +# define bool bool +#else +# if defined __BEOS__ && !defined __HAIKU__ /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ typedef bool _Bool; -# endif -#else -# if !defined __GNUC__ +# endif +# else +# if !defined __GNUC__ /* If @HAVE__BOOL@: Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when the built-in _Bool type is used. See @@ -103,19 +98,35 @@ typedef bool _Bool; "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. The only benefit of the enum, debuggability, is not important with these compilers. So use 'signed char' and no enum. */ -# define _Bool signed char -# else +# define _Bool signed char +# else /* With this compiler, trust the _Bool type if the compiler has it. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ + /* For the sake of symbolic names in gdb, define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But then + values of type '_Bool' might promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif # endif # endif +# define bool _Bool #endif -#define bool _Bool /* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 +#ifdef __cplusplus +# define false false +# define true true +#else +# define false 0 +# define true 1 +#endif + #define __bool_true_false_are_defined 1 #endif /* _GL_STDBOOL_H */ diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h index 0aee2a16cb..ae8f90cae7 100644 --- a/gl/sys_select.in.h +++ b/gl/sys_select.in.h @@ -130,7 +130,7 @@ /* Re-define FD_ISSET to avoid a WSA call while we are not using network sockets. */ -static inline int +static int rpl_fd_isset (SOCKET fd, fd_set * set) { u_int i; diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am index f73d26b408..5a74e77a73 100644 --- a/gl/tests/Makefile.am +++ b/gl/tests/Makefile.am @@ -103,7 +103,7 @@ EXTRA_DIST += test-base64.c macros.h ## begin gnulib module binary-io -libtests_a_SOURCES += binary-io.h +libtests_a_SOURCES += binary-io.h binary-io.c ## end gnulib module binary-io diff --git a/gl/tests/binary-io.c b/gl/tests/binary-io.c new file mode 100644 index 0000000000..8bbdb44d12 --- /dev/null +++ b/gl/tests/binary-io.c @@ -0,0 +1,3 @@ +#include <config.h> +#define BINARY_IO_INLINE _GL_EXTERN_INLINE +#include "binary-io.h" diff --git a/gl/tests/binary-io.h b/gl/tests/binary-io.h index a33e32aee2..0f376e3893 100644 --- a/gl/tests/binary-io.h +++ b/gl/tests/binary-io.h @@ -25,6 +25,11 @@ so we include it here first. */ #include <stdio.h> +_GL_INLINE_HEADER_BEGIN +#ifndef BINARY_IO_INLINE +# define BINARY_IO_INLINE _GL_INLINE +#endif + /* set_binary_mode (fd, mode) sets the binary/text I/O mode of file descriptor fd to the given mode (must be O_BINARY or O_TEXT) and returns the previous mode. */ @@ -39,9 +44,9 @@ # endif #else /* On reasonable systems, binary I/O is the only choice. */ - /* Use an inline function rather than a macro, to avoid gcc warnings + /* Use a function rather than a macro, to avoid gcc warnings "warning: statement with no effect". */ -static inline int +BINARY_IO_INLINE int set_binary_mode (int fd, int mode) { (void) fd; @@ -62,4 +67,6 @@ set_binary_mode (int fd, int mode) # define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY)) #endif +_GL_INLINE_HEADER_END + #endif /* _BINARY_H */ diff --git a/gl/tests/ioctl.c b/gl/tests/ioctl.c index aa5df602c0..4a2fd3981f 100644 --- a/gl/tests/ioctl.c +++ b/gl/tests/ioctl.c @@ -53,8 +53,6 @@ rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */) # include "fd-hook.h" /* Get _get_osfhandle. */ # include "msvc-nothrow.h" -/* Get HANDLE */ -# include <windows.h> static int primary_ioctl (int fd, int request, void *arg) diff --git a/gl/tests/malloca.h b/gl/tests/malloca.h index 0cedf5f633..f06e9e7b46 100644 --- a/gl/tests/malloca.h +++ b/gl/tests/malloca.h @@ -42,7 +42,7 @@ extern "C" { and a page size can be as small as 4096 bytes. So we cannot safely allocate anything larger than 4096 bytes. Also care for the possibility of a few compiler-allocated temporary stack slots. - This must be a macro, not an inline function. */ + This must be a macro, not a function. */ # define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) #else # define safe_alloca(N) ((void) (N), NULL) diff --git a/gl/tests/test-select.h b/gl/tests/test-select.h index 1169e59290..af0e38cf09 100644 --- a/gl/tests/test-select.h +++ b/gl/tests/test-select.h @@ -84,6 +84,9 @@ open_server_socket (void) s = socket (AF_INET, SOCK_STREAM, 0); + x = 1; + setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); + memset (&ia, 0, sizeof (ia)); ia.sin_family = AF_INET; inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); @@ -94,9 +97,6 @@ open_server_socket (void) exit (77); } - x = 1; - setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); - if (listen (s, 1) < 0) { perror ("listen"); diff --git a/gl/timespec.c b/gl/timespec.c new file mode 100644 index 0000000000..2b6098ed7b --- /dev/null +++ b/gl/timespec.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE +#include "timespec.h" diff --git a/gl/timespec.h b/gl/timespec.h index a58707947c..d0a2194f61 100644 --- a/gl/timespec.h +++ b/gl/timespec.h @@ -21,6 +21,11 @@ # include <time.h> +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_TIMESPEC_INLINE +# define _GL_TIMESPEC_INLINE _GL_INLINE +#endif + /* Return negative, zero, positive if A < B, A == B, A > B, respectively. For each time stamp T, this code assumes that either: @@ -49,7 +54,7 @@ The (int) cast avoids a gcc -Wconversion warning. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 @@ -59,7 +64,7 @@ timespec_cmp (struct timespec a, struct timespec b) /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be nonnegative. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_sign (struct timespec a) { return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; @@ -73,7 +78,7 @@ struct timespec dtotimespec (double) _GL_ATTRIBUTE_CONST; /* Return an approximation to A, of type 'double'. */ -static inline double +_GL_TIMESPEC_INLINE double timespectod (struct timespec a) { return a.tv_sec + a.tv_nsec / 1e9; @@ -82,4 +87,6 @@ timespectod (struct timespec a) void gettime (struct timespec *); int settime (struct timespec const *); +_GL_INLINE_HEADER_END + #endif diff --git a/gl/u64.c b/gl/u64.c new file mode 100644 index 0000000000..04cf7a2994 --- /dev/null +++ b/gl/u64.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_U64_INLINE _GL_EXTERN_INLINE +#include "u64.h" @@ -19,6 +19,11 @@ #include <stdint.h> +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_U64_INLINE +# define _GL_U64_INLINE _GL_INLINE +#endif + /* Return X rotated left by N bits, where 0 < N < 64. */ #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n)) @@ -54,7 +59,7 @@ typedef struct { uint32_t lo, hi; } u64; /* Given the high and low-order 32-bit quantities HI and LO, return a u64 value representing (HI << 32) + LO. */ -static inline u64 +_GL_U64_INLINE u64 u64hilo (uint32_t hi, uint32_t lo) { u64 r; @@ -64,7 +69,7 @@ u64hilo (uint32_t hi, uint32_t lo) } /* Return a u64 value representing LO. */ -static inline u64 +_GL_U64_INLINE u64 u64lo (uint32_t lo) { u64 r; @@ -74,7 +79,7 @@ u64lo (uint32_t lo) } /* Return a u64 value representing SIZE. */ -static inline u64 +_GL_U64_INLINE u64 u64size (size_t size) { u64 r; @@ -84,14 +89,14 @@ u64size (size_t size) } /* Return X < Y. */ -static inline int +_GL_U64_INLINE int u64lt (u64 x, u64 y) { return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo); } /* Return X & Y. */ -static inline u64 +_GL_U64_INLINE u64 u64and (u64 x, u64 y) { u64 r; @@ -101,7 +106,7 @@ u64and (u64 x, u64 y) } /* Return X | Y. */ -static inline u64 +_GL_U64_INLINE u64 u64or (u64 x, u64 y) { u64 r; @@ -111,7 +116,7 @@ u64or (u64 x, u64 y) } /* Return X ^ Y. */ -static inline u64 +_GL_U64_INLINE u64 u64xor (u64 x, u64 y) { u64 r; @@ -121,7 +126,7 @@ u64xor (u64 x, u64 y) } /* Return X + Y. */ -static inline u64 +_GL_U64_INLINE u64 u64plus (u64 x, u64 y) { u64 r; @@ -131,7 +136,7 @@ u64plus (u64 x, u64 y) } /* Return X << N. */ -static inline u64 +_GL_U64_INLINE u64 u64shl (u64 x, int n) { u64 r; @@ -149,7 +154,7 @@ u64shl (u64 x, int n) } /* Return X >> N. */ -static inline u64 +_GL_U64_INLINE u64 u64shr (u64 x, int n) { u64 r; @@ -167,3 +172,5 @@ u64shr (u64 x, int n) } #endif + +_GL_INLINE_HEADER_END diff --git a/gl/verify.h b/gl/verify.h index cef14ad157..0c320b19ad 100644 --- a/gl/verify.h +++ b/gl/verify.h @@ -125,7 +125,7 @@ extern int (*dummy (void)) [sizeof (struct {...})]; * GCC warns about duplicate declarations of the dummy function if - -Wredundant_decls is used. GCC 4.3 and later have a builtin + -Wredundant-decls is used. GCC 4.3 and later have a builtin __COUNTER__ macro that can let us generate unique identifiers for each dummy function, to suppress this warning. @@ -133,6 +133,10 @@ which do not support _Static_assert, also do not warn about the last declaration mentioned above. + * GCC warns if -Wnested-externs is enabled and verify() is used + within a function body; but inside a function, you can always + arrange to use verify_expr() instead. + * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ diff --git a/gl/xsize.c b/gl/xsize.c new file mode 100644 index 0000000000..4b4914c2ca --- /dev/null +++ b/gl/xsize.c @@ -0,0 +1,3 @@ +#include <config.h> +#define XSIZE_INLINE _GL_EXTERN_INLINE +#include "xsize.h" diff --git a/gl/xsize.h b/gl/xsize.h index 515327e97f..a2942b9555 100644 --- a/gl/xsize.h +++ b/gl/xsize.h @@ -27,6 +27,11 @@ # include <stdint.h> #endif +_GL_INLINE_HEADER_BEGIN +#ifndef XSIZE_INLINE +# define XSIZE_INLINE _GL_INLINE +#endif + /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). @@ -48,7 +53,7 @@ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -59,7 +64,7 @@ xsum (size_t size1, size_t size2) } /* Sum of three sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -69,7 +74,7 @@ xsum3 (size_t size1, size_t size2, size_t size3) } /* Sum of four sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -79,7 +84,7 @@ xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) } /* Maximum of two sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -92,7 +97,7 @@ xmax (size_t size1, size_t size2) /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. - This is a macro, not an inline function, so that it works correctly even + This is a macro, not a function, so that it works correctly even when N is of a wider type and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) @@ -104,4 +109,6 @@ xmax (size_t size1, size_t size2) #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) +_GL_INLINE_HEADER_END + #endif /* _XSIZE_H */ @@ -28,6 +28,28 @@ ifneq ($(build_aux),) set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)") endif +# Helper variables. +_empty = +_sp = $(_empty) $(_empty) + +# _equal,S1,S2 +# ------------ +# If S1 == S2, return S1, otherwise the empty string. +_equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) + +# member-check,VARIABLE,VALID-VALUES +# ---------------------------------- +# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and +# return it. Die otherwise. +member-check = \ + $(strip \ + $(if $($(1)), \ + $(if $(findstring $(_sp),$($(1))), \ + $(error invalid $(1): '$($(1))', expected $(2)), \ + $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)), \ + $(error invalid $(1): '$($(1))', expected $(2)))), \ + $(error $(1) undefined))) + # Do not save the original name or timestamp in the .tar.gz file. # Use --rsyncable if available. gzip_rsyncable := \ @@ -52,9 +74,9 @@ _dot_escaped_srcdir = $(subst .,\.,$(srcdir)) # Post-process $(VC_LIST) output, prepending $(srcdir)/, but only # when $(srcdir) is not ".". ifeq ($(srcdir),.) -_prepend_srcdir_prefix = + _prepend_srcdir_prefix = else -_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|' + _prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|' endif # In order to be able to consistently filter "."-relative names, @@ -78,32 +100,41 @@ VERSION_REGEXP = $(subst .,\.,$(VERSION)) PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION)) ifeq ($(VC),$(GIT)) -this-vc-tag = v$(VERSION) -this-vc-tag-regexp = v$(VERSION_REGEXP) + this-vc-tag = v$(VERSION) + this-vc-tag-regexp = v$(VERSION_REGEXP) else -tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') -tag-this-version = $(subst .,_,$(VERSION)) -this-vc-tag = $(tag-package)-$(tag-this-version) -this-vc-tag-regexp = $(this-vc-tag) + tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]') + tag-this-version = $(subst .,_,$(VERSION)) + this-vc-tag = $(tag-package)-$(tag-this-version) + this-vc-tag-regexp = $(this-vc-tag) endif my_distdir = $(PACKAGE)-$(VERSION) # Old releases are stored here. release_archive_dir ?= ../release +# If RELEASE_TYPE is undefined, but RELEASE is, use its second word. +# But overwrite VERSION. +ifdef RELEASE + VERSION := $(word 1, $(RELEASE)) + RELEASE_TYPE ?= $(word 2, $(RELEASE)) +endif + +# Validate and return $(RELEASE_TYPE), or die. +RELEASE_TYPES = alpha beta stable +release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES)) + # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right. # Use alpha.gnu.org for alpha and beta releases. # Use ftp.gnu.org for stable releases. gnu_ftp_host-alpha = alpha.gnu.org gnu_ftp_host-beta = alpha.gnu.org gnu_ftp_host-stable = ftp.gnu.org -gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE)) +gnu_rel_host ?= $(gnu_ftp_host-$(release-type)) -ifeq ($(gnu_rel_host),ftp.gnu.org) -url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE) -else -url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE) -endif +url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org), \ + http://ftpmirror.gnu.org/$(PACKAGE), \ + ftp://$(gnu_rel_host)/gnu/$(PACKAGE)) # Override this in cfg.mk if you are using a different format in your # NEWS file. @@ -132,9 +163,9 @@ syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \ .PHONY: $(syntax-check-rules) ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) -local-checks-available += $(syntax-check-rules) + local-checks-available += $(syntax-check-rules) else -local-checks-available += no-vc-detected + local-checks-available += no-vc-detected no-vc-detected: @echo "No version control files detected; skipping syntax check" endif @@ -330,8 +361,8 @@ sc_prohibit_atoi_atof: sp_ = strcmp *\(.+\) sc_prohibit_strcmp: @prohibit='! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)' \ - exclude=':# *define STRN?EQ\(' \ - halt='$(ME): replace strcmp calls above with STREQ/STRNEQ' \ + exclude='# *define STRN?EQ\(' \ + halt='replace strcmp calls above with STREQ/STRNEQ' \ $(_sc_search_regexp) # Really. You don't want to use this function. @@ -353,8 +384,9 @@ sc_prohibit_strncpy: # | xargs --no-run-if-empty \ # perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/' sc_prohibit_magic_number_exit: - @prohibit='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,' \ - halt='use EXIT_* values rather than magic number' \ + @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]' \ + exclude='exit \(77\)|error ?\(((0|77),|[^,]*)' \ + halt='use EXIT_* values rather than magic number' \ $(_sc_search_regexp) # Using EXIT_SUCCESS as the first argument to error is misleading, @@ -569,8 +601,6 @@ sc_prohibit_c_ctype_without_use: @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \ $(_sc_header_without_use) -_empty = -_sp = $(_empty) $(_empty) # The following list was generated by running: # man signal.h|col -b|perl -ne '/bsd_signal.*;/.../sigwaitinfo.*;/ and print' \ # | perl -lne '/^\s+(?:int|void).*?(\w+).*/ and print $1' | fmt @@ -723,6 +753,7 @@ sc_require_test_exit_idiom: sc_trailing_blank: @prohibit='[ ]$$' \ halt='found trailing blank(s)' \ + exclude='^Binary file .* matches$$' \ $(_sc_search_regexp) # Match lines like the following, but where there is only one space @@ -743,7 +774,7 @@ _gl_translatable_diag_func_re ?= error sc_unmarked_diagnostics: @prohibit='\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \ exclude='(_|ngettext ?)\(' \ - halt='$(ME): found unmarked diagnostic(s)' \ + halt='found unmarked diagnostic(s)' \ $(_sc_search_regexp) # Avoid useless parentheses like those in this example: @@ -779,7 +810,7 @@ sc_prohibit_always_true_header_tests: sc_prohibit_defined_have_decl_tests: @prohibit='#[ ]*if(n?def|.*\<defined)\>[ (]+HAVE_DECL_' \ - halt='$(ME): HAVE_DECL macros are always defined' \ + halt='HAVE_DECL macros are always defined' \ $(_sc_search_regexp) # ================================================================== @@ -1019,7 +1050,7 @@ sc_redundant_const: sc_const_long_option: @prohibit='^ *static.*struct option ' \ exclude='const struct option|struct option const' \ - halt='$(ME): add "const" to the above declarations' \ + halt='add "const" to the above declarations' \ $(_sc_search_regexp) NEWS_hash = \ @@ -1066,7 +1097,7 @@ sc_makefile_at_at_check: && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : news-check: NEWS - if sed -n $(news-check-lines-spec)p $< \ + $(AM_V_GEN)if sed -n $(news-check-lines-spec)p $< \ | grep -E $(news-check-regexp) >/dev/null; then \ :; \ else \ @@ -1122,7 +1153,7 @@ sc_po_check: # Sometimes it is useful to change the PATH environment variable # in Makefiles. When doing so, it's better not to use the Unix-centric # path separator of ':', but rather the automake-provided '$(PATH_SEPARATOR)'. -msg = '$(ME): Do not use ":" above; use $$(PATH_SEPARATOR) instead' +msg = 'Do not use ":" above; use $$(PATH_SEPARATOR) instead' sc_makefile_path_separator_check: @prohibit='PATH[=].*:' \ in_vc_files='akefile|\.mk$$' \ @@ -1133,7 +1164,7 @@ sc_makefile_path_separator_check: # i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release) # and is read-only. writable-files: - if test -d $(release_archive_dir); then \ + $(AM_V_GEN)if test -d $(release_archive_dir); then \ for file in $(DIST_ARCHIVES); do \ for p in ./ $(release_archive_dir)/; do \ test -e $$p$$file || continue; \ @@ -1215,13 +1246,13 @@ sc_Wundef_boolean: # not be constant, or might overflow a stack. In general, use PATH_MAX as # a limit, not an array or alloca size. sc_prohibit_path_max_allocation: - @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX' \ + @prohibit='(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \ halt='Avoid stack allocations of size PATH_MAX' \ $(_sc_search_regexp) sc_vulnerable_makefile_CVE-2009-4029: @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \ - in_files=(^\|/)Makefile\\.in$$ \ + in_files='(^|/)Makefile\.in$$' \ halt=$$(printf '%s\n' \ 'the above files are vulnerable; beware of running' \ ' "make dist*" rules, and upgrade to fixed automake' \ @@ -1230,7 +1261,7 @@ sc_vulnerable_makefile_CVE-2009-4029: sc_vulnerable_makefile_CVE-2012-3386: @prohibit='chmod a\+w \$$\(distdir\)' \ - in_files=(^\|/)Makefile\\.in$$ \ + in_files='(^|/)Makefile\.in$$' \ halt=$$(printf '%s\n' \ 'the above files are vulnerable; beware of running' \ ' "make distcheck", and upgrade to fixed automake' \ @@ -1238,8 +1269,8 @@ sc_vulnerable_makefile_CVE-2012-3386: $(_sc_search_regexp) vc-diff-check: - (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : - if test -s vc-diffs; then \ + $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : + $(AM_V_at)if test -s vc-diffs; then \ cat vc-diffs; \ echo "Some files are locally modified:" 1>&2; \ exit 1; \ @@ -1255,31 +1286,37 @@ bootstrap-tools ?= autoconf,automake,gnulib # If it's not already specified, derive the GPG key ID from # the signed tag we've just applied to mark this release. -gpg_key_ID ?= \ - $$(git cat-file tag v$(VERSION) \ - | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \ - | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}') +gpg_key_ID ?= \ + $$(cd $(srcdir) \ + && git cat-file tag v$(VERSION) \ + | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \ + | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}') translation_project_ ?= coordinator@translationproject.org # Make info-gnu the default only for a stable release. -ifeq ($(RELEASE_TYPE),stable) - announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT) - announcement_mail_headers_ ?= \ - To: info-gnu@gnu.org \ - Cc: $(announcement_Cc_) \ - Mail-Followup-To: $(PACKAGE_BUGREPORT) -else - announcement_Cc_ ?= $(translation_project_) - announcement_mail_headers_ ?= \ - To: $(PACKAGE_BUGREPORT) \ - Cc: $(announcement_Cc_) -endif - +announcement_Cc_stable = $(translation_project_), $(PACKAGE_BUGREPORT) +announcement_mail_headers_stable = \ + To: info-gnu@gnu.org \ + Cc: $(announcement_Cc_) \ + Mail-Followup-To: $(PACKAGE_BUGREPORT) + +announcement_Cc_alpha = $(translation_project_) +announcement_mail_headers_alpha = \ + To: $(PACKAGE_BUGREPORT) \ + Cc: $(announcement_Cc_) + +announcement_mail_Cc_beta = $(announcement_mail_Cc_alpha) +announcement_mail_headers_beta = $(announcement_mail_headers_alpha) + +announcement_mail_Cc_ ?= $(announcement_mail_Cc_$(release-type)) +announcement_mail_headers_ ?= $(announcement_mail_headers_$(release-type)) announcement: NEWS ChangeLog $(rel-files) - @$(srcdir)/$(_build-aux)/announce-gen \ +# Not $(AM_V_GEN) since the output of this command serves as +# annoucement message: it would start with " GEN announcement". + $(AM_V_at)$(srcdir)/$(_build-aux)/announce-gen \ --mail-headers='$(announcement_mail_headers_)' \ - --release-type=$(RELEASE_TYPE) \ + --release-type=$(release-type) \ --package=$(PACKAGE) \ --prev=$(PREV_VERSION) \ --curr=$(VERSION) \ @@ -1292,6 +1329,12 @@ announcement: NEWS ChangeLog $(rel-files) --no-print-checksums \ $(addprefix --url-dir=, $(url_dir_list)) +.PHONY: release-commit +release-commit: + $(AM_V_GEN)cd $(srcdir) \ + && $(_build-aux)/do-release-commit-and-tag \ + -C $(abs_builddir) $(RELEASE) + ## ---------------- ## ## Updating files. ## ## ---------------- ## @@ -1300,16 +1343,22 @@ ftp-gnu = ftp://ftp.gnu.org/gnu www-gnu = http://www.gnu.org upload_dest_dir_ ?= $(PACKAGE) +upload_command = \ + $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \ + --to $(gnu_rel_host):$(upload_dest_dir_) \ + $(rel-files) emit_upload_commands: @echo ===================================== @echo ===================================== - @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\" - @echo " --to $(gnu_rel_host):$(upload_dest_dir_) \\" - @echo " $(rel-files)" + @echo '$(upload_command)' @echo '# send the ~/announce-$(my_distdir) e-mail' @echo ===================================== @echo ===================================== +.PHONY: upload +upload: + $(AM_V_GEN)$(upload_command) + define emit-commit-log printf '%s\n' 'maint: post-release administrivia' '' \ '* NEWS: Add header line for next release.' \ @@ -1319,7 +1368,7 @@ endef .PHONY: no-submodule-changes no-submodule-changes: - if test -d $(srcdir)/.git; then \ + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ diff=$$(cd $(srcdir) && git submodule -q foreach \ git diff-index --name-only HEAD) \ || exit 1; \ @@ -1355,19 +1404,22 @@ public-submodule-commit: gl_public_submodule_commit ?= public-submodule-commit check: $(gl_public_submodule_commit) -.PHONY: alpha beta stable +.PHONY: alpha beta stable release ALL_RECURSIVE_TARGETS += alpha beta stable alpha beta stable: $(local-check) writable-files $(submodule-checks) - test $@ = stable \ + $(AM_V_GEN)test $@ = stable \ && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \ || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ || : - $(MAKE) vc-diff-check - $(MAKE) news-check - $(MAKE) distcheck - $(MAKE) dist - $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@ - $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ + $(AM_V_at)$(MAKE) vc-diff-check + $(AM_V_at)$(MAKE) news-check + $(AM_V_at)$(MAKE) distcheck + $(AM_V_at)$(MAKE) dist + $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@ + $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ + +release: + $(AM_V_GEN)$(MAKE) $(release-type) # Override this in cfg.mk if you follow different procedures. release-prep-hook ?= release-prep @@ -1375,19 +1427,19 @@ release-prep-hook ?= release-prep gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?] .PHONY: release-prep release-prep: - case $$RELEASE_TYPE in alpha|beta|stable) ;; \ - *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac - $(MAKE) --no-print-directory -s announcement > ~/announce-$(my_distdir) - if test -d $(release_archive_dir); then \ + $(AM_V_GEN)$(MAKE) --no-print-directory -s announcement \ + > ~/announce-$(my_distdir) + $(AM_V_at)if test -d $(release_archive_dir); then \ ln $(rel-files) $(release_archive_dir); \ chmod a-w $(rel-files); \ fi - echo $(VERSION) > $(prev_version_file) - $(MAKE) update-NEWS-hash - perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' $(srcdir)/NEWS - $(emit-commit-log) > .ci-msg - $(VC) commit -F .ci-msg -a - rm .ci-msg + $(AM_V_at)echo $(VERSION) > $(prev_version_file) + $(AM_V_at)$(MAKE) update-NEWS-hash + $(AM_V_at)perl -pi \ + -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' \ + $(srcdir)/NEWS + $(AM_V_at)msg=$$($(emit-commit-log)) || exit 1; \ + cd $(srcdir) && $(VC) commit -m "$$msg" -a # Override this with e.g., -s $(srcdir)/some_other_name.texi # if the default $(PACKAGE)-derived name doesn't apply. @@ -1395,14 +1447,20 @@ gendocs_options_ ?= .PHONY: web-manual web-manual: - @test -z "$(manual_title)" \ + $(AM_V_GEN)test -z "$(manual_title)" \ && { echo define manual_title in cfg.mk 1>&2; exit 1; } || : - @cd '$(srcdir)/doc'; \ + $(AM_V_at)cd '$(srcdir)/doc'; \ $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \ -o '$(abs_builddir)/doc/manual' \ --email $(PACKAGE_BUGREPORT) $(PACKAGE) \ "$(PACKAGE_NAME) - $(manual_title)" - @echo " *** Upload the doc/manual directory to web-cvs." + $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs." + +.PHONY: web-manual-update +web-manual-update: + $(AM_V_GEN)cd $(srcdir) \ + && $(_build-aux)/gnu-web-doc-update -C $(abs_builddir) + # Code Coverage @@ -1428,6 +1486,31 @@ gen-coverage: coverage: init-coverage build-coverage gen-coverage +# Some projects carry local adjustments for gnulib modules via patches in +# a gnulib patch directory whose default name is gl/ (defined in bootstrap +# via local_gl_dir=gl). Those patches become stale as the originals evolve +# in gnulib. Use this rule to refresh any stale patches. It applies each +# patch to the original in $(gnulib_dir) and uses the temporary result to +# generate a fuzz-free .diff file. If you customize the name of your local +# gnulib patch directory via bootstrap.conf, this rule detects that name. +# Run this from a non-VPATH (i.e., srcdir) build directory. +.PHONY: refresh-gnulib-patches +refresh-gnulib-patches: + gl=gl; \ + if test -f bootstrap.conf; then \ + t=$$(perl -lne '/^\s*local_gl_dir=(\S+)/ and $$d=$$1;' \ + -e 'END{defined $$d and print $$d}' bootstrap.conf); \ + test -n "$$t" && gl=$$t; \ + fi; \ + for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \ + b=$$(printf %s "$$diff"|sed 's/\.diff$$//'); \ + VERSION_CONTROL=none \ + patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \ + ( cd $(gnulib_dir) || exit 1; \ + git diff "$$b" > "../$$gl/$$diff"; \ + git checkout $$b ) || exit 1; \ + done + # Update gettext files. PACKAGE ?= $(shell basename $(PWD)) PO_DOMAIN ?= $(PACKAGE) @@ -1461,7 +1544,7 @@ update-copyright-env ?= # in the file .x-update-copyright. .PHONY: update-copyright update-copyright: - grep -l -w Copyright \ + $(AM_V_GEN)grep -l -w Copyright \ $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \ | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@ @@ -1534,6 +1617,7 @@ _gl_TS_obj_files ?= *.$(OBJEXT) # Files in which to search for the one-line style extern declarations. # $(_gl_TS_dir)-relative. _gl_TS_headers ?= $(noinst_HEADERS) +_gl_TS_other_headers ?= *.h .PHONY: _gl_tight_scope _gl_tight_scope: $(bin_PROGRAMS) @@ -1556,7 +1640,8 @@ _gl_tight_scope: $(bin_PROGRAMS) && { echo the above functions should have static scope >&2; \ exit 1; } || : ; \ ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \ - perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' $$hdr *.h \ + perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' \ + $$hdr $(_gl_TS_other_headers) \ ) | sort -u > $$t; \ nm -e $(_gl_TS_obj_files) | sed -n 's/.* [BCDGRS] //p' \ | sort -u | grep -Ev -f $$t \ |