summaryrefslogtreecommitdiff
path: root/gl/m4
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-07-14 13:10:45 +0200
committerSimon Josefsson <simon@josefsson.org>2011-07-14 13:10:45 +0200
commit22467f04196c52ebfdf14255748de1b977bff865 (patch)
treedcc3bbeadbe38e3c930a9dcf3246d62f10171b86 /gl/m4
parentc5f7aa11f5fb3095320cfd39903d933e9c27a67b (diff)
downloadlibtasn1-22467f04196c52ebfdf14255748de1b977bff865.tar.gz
Update gnulib files.
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/errno_h.m4119
-rw-r--r--gl/m4/fseeko.m450
-rw-r--r--gl/m4/ftell.m415
-rw-r--r--gl/m4/ftello.m410
-rw-r--r--gl/m4/getopt.m4120
-rw-r--r--gl/m4/gnulib-cache.m43
-rw-r--r--gl/m4/gnulib-common.m470
-rw-r--r--gl/m4/gnulib-comp.m450
-rw-r--r--gl/m4/lseek.m415
-rw-r--r--gl/m4/malloc.m412
-rw-r--r--gl/m4/read-file.m48
-rw-r--r--gl/m4/realloc.m412
-rw-r--r--gl/m4/stdint.m44
-rw-r--r--gl/m4/unistd_h.m48
-rw-r--r--gl/m4/warnings.m46
15 files changed, 353 insertions, 149 deletions
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
new file mode 100644
index 0000000..a6d37f3
--- /dev/null
+++ b/gl/m4/errno_h.m4
@@ -0,0 +1,119 @@
+# errno_h.m4 serial 9
+dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
+ AC_EGREP_CPP([booboo],[
+#include <errno.h>
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+ ],
+ [gl_cv_header_errno_h_complete=no],
+ [gl_cv_header_errno_h_complete=yes])
+ ])
+ if test $gl_cv_header_errno_h_complete = yes; then
+ ERRNO_H=''
+ else
+ gl_NEXT_HEADERS([errno.h])
+ ERRNO_H='errno.h'
+ fi
+ AC_SUBST([ERRNO_H])
+ AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
+ gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
+ gl_REPLACE_ERRNO_VALUE([ENOLINK])
+ gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
+])
+
+# Assuming $1 = EOVERFLOW.
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
+# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+# Check for the value of EOVERFLOW.
+# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
+AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
+[
+ if test -n "$ERRNO_H"; then
+ AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
+ AC_EGREP_CPP([yes],[
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ],
+ [gl_cv_header_errno_h_]$1[=yes],
+ [gl_cv_header_errno_h_]$1[=no])
+ if test $gl_cv_header_errno_h_]$1[ = no; then
+ AC_EGREP_CPP([yes],[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ], [gl_cv_header_errno_h_]$1[=hidden])
+ if test $gl_cv_header_errno_h_]$1[ = hidden; then
+ dnl The macro exists but is hidden.
+ dnl Define it to the same value.
+ AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+])
+ fi
+ fi
+ ])
+ case $gl_cv_header_errno_h_]$1[ in
+ yes | no)
+ ]$1[_HIDDEN=0; ]$1[_VALUE=
+ ;;
+ *)
+ ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
+ ;;
+ esac
+ AC_SUBST($1[_HIDDEN])
+ AC_SUBST($1[_VALUE])
+ fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
index 76507d1..391948d 100644
--- a/gl/m4/fseeko.m4
+++ b/gl/m4/fseeko.m4
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 11
+# fseeko.m4 serial 15
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,28 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FSEEKO],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_HAVE_FSEEKO])
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
-
- AC_CHECK_DECLS_ONCE([fseeko])
- if test $ac_cv_have_decl_fseeko = no; then
- HAVE_DECL_FSEEKO=0
- fi
-
- if test $gl_cv_func_fseeko = no; then
- HAVE_FSEEKO=0
- gl_REPLACE_FSEEKO
- else
- if test $gl_cv_var_stdin_large_offset = no; then
- gl_REPLACE_FSEEKO
- fi
- fi
-])
-
-dnl Tests whether fseeko is available.
-dnl Result is gl_cv_func_fseeko.
-AC_DEFUN([gl_HAVE_FSEEKO],
-[
AC_REQUIRE([AC_PROG_CC])
dnl Persuade glibc <stdio.h> to declare fseeko().
@@ -40,18 +19,25 @@ AC_DEFUN([gl_HAVE_FSEEKO],
]], [fseeko (stdin, 0, 0);])],
[gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
])
-])
-AC_DEFUN([gl_REPLACE_FSEEKO],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_HAVE_FSEEKO])
- if test $gl_cv_func_fseeko = yes; then
- REPLACE_FSEEKO=1
+ AC_CHECK_DECLS_ONCE([fseeko])
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ else
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FSEEKO=1
+ fi
+ m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
+ gl_FUNC_FFLUSH_STDIN
+ if test $gl_cv_func_fflush_stdin = no; then
+ REPLACE_FSEEKO=1
+ fi
+ ])
fi
- AC_LIBOBJ([fseeko])
- dnl If we are also using the fseek module, then fseek needs replacing, too.
- m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
])
dnl Code shared by fseeko and ftello. Determine if large files are supported,
diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4
new file mode 100644
index 0000000..c529c50
--- /dev/null
+++ b/gl/m4/ftell.m4
@@ -0,0 +1,15 @@
+# ftell.m4 serial 3
+dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FTELL],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_FTELLO])
+ dnl When ftello needs fixes, ftell needs them too.
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ REPLACE_FTELL=1
+ fi
+])
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
index 599f8f2..10cf429 100644
--- a/gl/m4/ftello.m4
+++ b/gl/m4/ftello.m4
@@ -1,4 +1,4 @@
-# ftello.m4 serial 9
+# ftello.m4 serial 10
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -124,12 +124,4 @@ main (void)
esac
fi
fi
- if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
- gl_REPLACE_FTELLO
- fi
-])
-
-AC_DEFUN([gl_REPLACE_FTELLO],
-[
- AC_LIBOBJ([ftello])
])
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 035a530..7e49ddd 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 34
+# getopt.m4 serial 38
dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,10 +9,25 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
[
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- gl_GETOPT_IFELSE([
- gl_REPLACE_GETOPT
- ],
- [])
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ gl_GETOPT_IFELSE([], [])
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ gl_GETOPT_IFELSE([
+ REPLACE_GETOPT=1
+ ],
+ [])
+ ])
+ if test $REPLACE_GETOPT = 1; then
+ dnl Arrange for getopt.h to be created.
+ gl_GETOPT_SUBSTITUTE_HEADER
+ dnl Arrange for unistd.h to include getopt.h.
+ GNULIB_UNISTD_H_GETOPT=1
+ fi
])
# Request a POSIX compliant getopt function with GNU extensions (such as
@@ -25,20 +40,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
])
-# Request the gnulib implementation of the getopt functions unconditionally.
-# argp.m4 uses this.
-AC_DEFUN([gl_REPLACE_GETOPT],
-[
- dnl Arrange for getopt.h to be created.
- gl_GETOPT_SUBSTITUTE_HEADER
- dnl Arrange for unistd.h to include getopt.h.
- GNULIB_UNISTD_H_GETOPT=1
- dnl Arrange to compile the getopt implementation.
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
- gl_PREREQ_GETOPT
-])
-
# emacs' configure.in uses this.
AC_DEFUN([gl_GETOPT_IFELSE],
[
@@ -88,15 +89,15 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_CACHE_CHECK([whether getopt is POSIX compatible],
[gl_cv_func_getopt_posix],
[
- dnl BSD getopt_long uses an incompatible method to reset
- dnl option processing. Existence of the variable, in and of
+ dnl BSD getopt_long uses an incompatible method to reset option
+ dnl processing. Existence of the optreset variable, in and of
dnl itself, is not a reason to replace getopt, but knowledge
dnl of the variable is needed to determine how to reset and
dnl whether a reset reparses the environment. Solaris
dnl supports neither optreset nor optind=0, but keeps no state
dnl that needs a reset beyond setting optind=1; detect Solaris
dnl by getopt_clip.
- AC_COMPILE_IFELSE(
+ AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <unistd.h>]],
[[int *p = &optreset; return optreset;]])],
@@ -120,22 +121,20 @@ int
main ()
{
{
- int argc = 0;
- char *argv[10];
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
int c;
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
optind = OPTIND_MIN;
opterr = 0;
- c = getopt (argc, argv, "ab");
+ c = getopt (4, argv, "ab");
if (!(c == 'a'))
return 1;
- c = getopt (argc, argv, "ab");
+ c = getopt (4, argv, "ab");
if (!(c == -1))
return 2;
if (!(optind == 2))
@@ -143,22 +142,20 @@ main ()
}
/* Some internal state exists at this point. */
{
- int argc = 0;
- char *argv[10];
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
int c;
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
optind = OPTIND_MIN;
opterr = 0;
- c = getopt (argc, argv, "+abp:q:");
+ c = getopt (7, argv, "+abp:q:");
if (!(c == -1))
return 4;
if (!(strcmp (argv[0], "program") == 0))
@@ -180,7 +177,9 @@ main ()
}
/* Detect MacOS 10.5, AIX 7.1 bug. */
{
- char *argv[3] = { "program", "-ab", NULL };
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
optind = OPTIND_MIN;
opterr = 0;
if (getopt (2, argv, "ab:") != 'a')
@@ -238,19 +237,22 @@ dnl is ambiguous with environment values that contain newlines.
and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
OSF/1 5.1, Solaris 10. */
{
- char *myargv[3];
- myargv[0] = "conftest";
- myargv[1] = "-+";
- myargv[2] = 0;
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
opterr = 0;
- if (getopt (2, myargv, "+a") != '?')
+ if (getopt (2, argv, "+a") != '?')
result |= 1;
}
/* This code succeeds on glibc 2.8, mingw,
and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
{
- char *argv[] = { "program", "-p", "foo", "bar", NULL };
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
optind = 1;
if (getopt (4, argv, "p::") != 'p')
@@ -264,7 +266,10 @@ dnl is ambiguous with environment values that contain newlines.
}
/* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
{
- char *argv[] = { "program", "foo", "-p", NULL };
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
optind = 0;
if (getopt (3, argv, "-p") != 1)
result |= 16;
@@ -273,13 +278,26 @@ dnl is ambiguous with environment values that contain newlines.
}
/* This code fails on glibc 2.11. */
{
- char *argv[] = { "program", "-b", "-a", NULL };
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
optind = opterr = 0;
if (getopt (3, argv, "+:a:b") != 'b')
result |= 64;
else if (getopt (3, argv, "+:a:b") != ':')
result |= 64;
}
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 128;
+ }
return result;
]])],
[gl_cv_func_getopt_gnu=yes],
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 6486ac9..de63961 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,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=tests --aux-dir=build-aux --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files autobuild fdl-1.3 gendocs getopt-gnu maintainer-makefile manywarnings pmccabe2html progname read-file stdint update-copyright valgrind-tests version-etc-fsf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
@@ -46,4 +46,5 @@ gl_MAKEFILE_NAME([])
gl_LIBTOOL
gl_MACRO_PREFIX([gl])
gl_PO_DOMAIN([])
+gl_WITNESS_C_DOMAIN([])
gl_VC_FILES([false])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index c4d7a20..6b5923a 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 24
+# gnulib-common.m4 serial 28
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,6 +12,19 @@ AC_DEFUN([gl_COMMON], [
AC_REQUIRE([gl_COMMON_BODY])
])
AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of draft C1X. */
+#ifndef _Noreturn
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+])
AH_VERBATIM([isoc99_inline],
[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
@@ -34,6 +47,20 @@ AC_DEFUN([gl_COMMON_BODY], [
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
])
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
@@ -47,16 +74,49 @@ AC_DEFUN([gl_COMMON_BODY], [
# expands to a C preprocessor expression that evaluates to 1 or 0, depending
# whether a gnulib module that has been requested shall be considered present
# or not.
-AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
# sets the shell variable that indicates the presence of the given module to
# a C preprocessor expression that will evaluate to 1.
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
[
- GNULIB_[]m4_translit([[$1]],
- [abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+ [GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+ [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+ [
+ dnl Simplify the expression VALUE || 1 to 1.
+ $1=1
+ ],
+ [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+ [gl_MODULE_INDICATOR_CONDITION])])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition. The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+ dnl Simplify the expression 1 || CONDITION to 1.
+ if test "$[]$1" != 1; then
+ dnl Simplify the expression 0 || CONDITION to CONDITION.
+ if test "$[]$1" = 0; then
+ $1=$2
+ else
+ $1="($[]$1 || $2)"
+ fi
+ fi
])
# gl_MODULE_INDICATOR([modulename])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 8be1edc..6b5ed3f 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -26,13 +26,13 @@ AC_DEFUN([gl_EARLY],
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([AC_PROG_RANLIB])
- # Code from module arg-nonnull:
# Code from module autobuild:
AB_INIT
- # Code from module c++defs:
+ # Code from module errno:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module fdl-1.3:
+ # Code from module ftell:
# Code from module ftello:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module gendocs:
@@ -50,6 +50,10 @@ AC_DEFUN([gl_EARLY],
# Code from module progname:
# Code from module read-file:
# Code from module realloc-posix:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/warn-on-use:
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
@@ -69,7 +73,6 @@ AC_DEFUN([gl_EARLY],
# Code from module vc-list-files:
# Code from module version-etc:
# Code from module version-etc-fsf:
- # Code from module warn-on-use:
# Code from module warnings:
])
@@ -87,11 +90,30 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='gl'
+gl_HEADER_ERRNO_H
+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])
+fi
gl_STDIO_MODULE_INDICATOR([ftello])
gl_FUNC_GETOPT_GNU
+if test $REPLACE_GETOPT = 1; then
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ gl_PREREQ_GETOPT
+fi
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
+fi
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
# Autoconf 2.61a.99 and earlier don't support linking a file only
@@ -105,17 +127,26 @@ m4_if(m4_version_compare([2.61a.100],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])])
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_POSIX
+if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+fi
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
gl_MULTIARCH
AC_PATH_PROG([PMCCABE], [pmccabe], [false])
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
-gl_FUNC_READ_FILE
+gl_PREREQ_READ_FILE
gl_FUNC_REALLOC_POSIX
+if test $REPLACE_REALLOC = 1; then
+ AC_LIBOBJ([realloc])
+fi
gl_STDLIB_MODULE_INDICATOR([realloc-posix])
gl_STDARG_H
gl_STDDEF_H
@@ -266,17 +297,20 @@ AC_DEFUN([gltests_LIBSOURCES], [
# This macro records the list of files which have been installed by
# gnulib-tool and may be removed by future gnulib-tool invocations.
AC_DEFUN([gl_FILE_LIST], [
- build-aux/arg-nonnull.h
- build-aux/c++defs.h
build-aux/gendocs.sh
build-aux/pmccabe.css
build-aux/pmccabe2html
+ build-aux/snippet/_Noreturn.h
+ build-aux/snippet/arg-nonnull.h
+ build-aux/snippet/c++defs.h
+ build-aux/snippet/warn-on-use.h
build-aux/update-copyright
build-aux/useless-if-before-free
build-aux/vc-list-files
- build-aux/warn-on-use.h
doc/fdl-1.3.texi
doc/gendocs_template
+ lib/errno.in.h
+ lib/ftell.c
lib/ftello.c
lib/getopt.c
lib/getopt.in.h
@@ -304,8 +338,10 @@ AC_DEFUN([gl_FILE_LIST], [
lib/version-etc.h
m4/00gnulib.m4
m4/autobuild.m4
+ m4/errno_h.m4
m4/extensions.m4
m4/fseeko.m4
+ m4/ftell.m4
m4/ftello.m4
m4/getopt.m4
m4/gnulib-common.m4
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
index f6452f6..b454884 100644
--- a/gl/m4/lseek.m4
+++ b/gl/m4/lseek.m4
@@ -1,4 +1,4 @@
-# lseek.m4 serial 6
+# lseek.m4 serial 7
dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -35,15 +35,8 @@ AC_DEFUN([gl_FUNC_LSEEK],
[gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
fi])
if test $gl_cv_func_lseek_pipe = no; then
- gl_REPLACE_LSEEK
+ REPLACE_LSEEK=1
+ AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+ [Define to 1 if lseek does not detect pipes.])
fi
])
-
-AC_DEFUN([gl_REPLACE_LSEEK],
-[
- AC_LIBOBJ([lseek])
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- REPLACE_LSEEK=1
- AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
- [Define to 1 if lseek does not detect pipes.])
-])
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 8094444..87018ec 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 12
+# malloc.m4 serial 13
dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
[Define to 1 if your system has a GNU libc compatible 'malloc'
function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_MALLOC_GNU], [0])
- gl_REPLACE_MALLOC
+ REPLACE_MALLOC=1
])
])
@@ -33,7 +33,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
AC_DEFINE([HAVE_MALLOC_POSIX], [1],
[Define if the 'malloc' function is POSIX compliant.])
else
- gl_REPLACE_MALLOC
+ REPLACE_MALLOC=1
fi
])
@@ -58,9 +58,3 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
[gl_cv_func_malloc_posix=no])
])
])
-
-AC_DEFUN([gl_REPLACE_MALLOC],
-[
- AC_LIBOBJ([malloc])
- REPLACE_MALLOC=1
-])
diff --git a/gl/m4/read-file.m4 b/gl/m4/read-file.m4
index 60d0360..93e0ac3 100644
--- a/gl/m4/read-file.m4
+++ b/gl/m4/read-file.m4
@@ -1,14 +1,8 @@
-# read-file.m4 serial 2
+# read-file.m4 serial 3
dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_FUNC_READ_FILE],
-[
- AC_LIBOBJ([read-file])
- gl_PREREQ_READ_FILE
-])
-
# Prerequisites of lib/read-file.c.
AC_DEFUN([gl_PREREQ_READ_FILE], [:])
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index a403d9f..5cc1340 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,4 +1,4 @@
-# realloc.m4 serial 11
+# realloc.m4 serial 12
dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU],
[Define to 1 if your system has a GNU libc compatible 'realloc'
function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_REALLOC_GNU], [0])
- gl_REPLACE_REALLOC
+ REPLACE_REALLOC=1
])
])# gl_FUNC_REALLOC_GNU
@@ -33,12 +33,6 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX],
AC_DEFINE([HAVE_REALLOC_POSIX], [1],
[Define if the 'realloc' function is POSIX compliant.])
else
- gl_REPLACE_REALLOC
+ REPLACE_REALLOC=1
fi
])
-
-AC_DEFUN([gl_REPLACE_REALLOC],
-[
- AC_LIBOBJ([realloc])
- REPLACE_REALLOC=1
-])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index dff37fe..c75e957 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 40
+# stdint.m4 serial 41
dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert and Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.
-AC_DEFUN([gl_STDINT_H],
+AC_DEFUN_ONCE([gl_STDINT_H],
[
AC_PREREQ([2.59])dnl
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index eeb3360..fb6fe07 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 55
+# unistd_h.m4 serial 56
dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,8 +36,8 @@ AC_DEFUN([gl_UNISTD_H],
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
- readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+ endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
usleep])
])
@@ -72,6 +72,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
+ GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
@@ -110,6 +111,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
+ HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
HAVE_LINK=1; AC_SUBST([HAVE_LINK])
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index a8f3466..b2d1a29 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 2
+# warnings.m4 serial 3
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,12 +21,12 @@ m4_ifdef([AS_VAR_APPEND],
AC_DEFUN([gl_WARN_ADD],
[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
- save_CPPFLAGS="$CPPFLAGS"
+ gl_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="${CPPFLAGS} $1"
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
[AS_VAR_SET([gl_Warn], [yes])],
[AS_VAR_SET([gl_Warn], [no])])
- CPPFLAGS="$save_CPPFLAGS"
+ CPPFLAGS="$gl_save_CPPFLAGS"
])
AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])