summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-03-11 20:54:11 +0100
committerSimon Josefsson <simon@josefsson.org>2008-03-11 20:54:11 +0100
commit06e5c18f65a705c45735b4e18a34f8b3afc567e1 (patch)
treeb7f2ed901f2e7bc9c7a2f97d9ebaa0e99b49cdb9
parentd65690c152ff765878438f91a3235980a940e448 (diff)
downloadgnutls-06e5c18f65a705c45735b4e18a34f8b3afc567e1.tar.gz
Update gnulib files.
-rw-r--r--gl/gnulib.mk20
-rw-r--r--gl/m4/gnulib-comp.m41
-rw-r--r--gl/m4/include_next.m47
-rw-r--r--gl/m4/stdarg.m453
-rw-r--r--gl/stdarg.in.h31
-rw-r--r--lgl/Makefile.am9
-rw-r--r--lgl/m4/absolute-header.m449
-rw-r--r--lgl/m4/gnulib-comp.m41
-rw-r--r--lgl/m4/include_next.m47
9 files changed, 102 insertions, 76 deletions
diff --git a/gl/gnulib.mk b/gl/gnulib.mk
index 80b164bd0e..d72e891acc 100644
--- a/gl/gnulib.mk
+++ b/gl/gnulib.mk
@@ -193,6 +193,26 @@ EXTRA_libgnu_la_SOURCES += readline.c
## end gnulib module readline
+## begin gnulib module stdarg
+
+BUILT_SOURCES += $(STDARG_H)
+
+# We need the following in order to create <stdarg.h> when the system
+# doesn't have one that works with the given compiler.
+stdarg.h: stdarg.in.h
+ rm -f $@-t $@
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
+ < $(srcdir)/stdarg.in.h; \
+ } > $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += stdarg.h stdarg.h-t
+
+EXTRA_DIST += stdarg.in.h
+
+## end gnulib module stdarg
+
## begin gnulib module strdup
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index d9fd011da9..9b4c130517 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -217,6 +217,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/progname.h
lib/readline.c
lib/readline.h
+ lib/stdarg.in.h
lib/strdup.c
lib/strerror.c
lib/version-etc-fsf.c
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 7ce472bc0a..7c08e9319b 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 4
-dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# include_next.m4 serial 5
+dnl Copyright (C) 2006-2008 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.
@@ -63,6 +63,9 @@ EOF
# The three "///" are to pacify Sun C 5.8, which otherwise would say
# "warning: #include of /usr/include/... may be non-portable".
# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[
AC_REQUIRE([gl_INCLUDE_NEXT])
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
index e8e680a5c9..21910e4bec 100644
--- a/gl/m4/stdarg.m4
+++ b/gl/m4/stdarg.m4
@@ -1,5 +1,5 @@
-# stdarg.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# stdarg.m4 serial 2
+dnl Copyright (C) 2006, 2008 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.
@@ -9,6 +9,8 @@ dnl Provide a working va_copy in combination with <stdarg.h>.
AC_DEFUN([gl_STDARG_H],
[
+ STDARG_H=''; AC_SUBST([STDARG_H])
+ NEXT_STDARG_H='<stdarg.h>'; AC_SUBST([NEXT_STDARG_H])
AC_MSG_CHECKING([for va_copy])
AC_CACHE_VAL([gl_cv_func_va_copy], [
AC_TRY_COMPILE([#include <stdarg.h>], [
@@ -19,22 +21,47 @@ void (*func) (va_list, va_list) = va_copy;
[gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])])
AC_MSG_RESULT([$gl_cv_func_va_copy])
if test $gl_cv_func_va_copy = no; then
- # Provide a substitute, either __va_copy or as a simple assignment.
- AC_CACHE_VAL([gl_cv_func___va_copy], [
- AC_TRY_COMPILE([#include <stdarg.h>], [
+ dnl Provide a substitute.
+ dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
+ dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
+ dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
+ dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
+ dnl approach on other platforms, because <stdarg.h> often defines only
+ dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
+ dnl not work in this situation.
+ AC_EGREP_CPP([vaccine],
+ [#if defined _AIX && !defined __GNUC__
+ AIX vaccine
+ #endif
+ ], [gl_aixcc=yes], [gl_aixcc=no])
+ if test $gl_aixcc = yes; then
+ dnl Provide a substitute <stdarg.h> file.
+ STDARG_H=stdarg.h
+ gl_CHECK_NEXT_HEADERS([stdarg.h])
+ dnl Fallback for the case when <stdarg.h> contains only macro definitions.
+ if test "$gl_cv_next_stdarg_h" = '""'; then
+ gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
+ NEXT_STDARG_H="$gl_cv_next_stdarg_h"
+ fi
+ else
+ dnl Provide a substitute in <config.h>, either __va_copy or as a simple
+ dnl assignment.
+ AC_CACHE_VAL([gl_cv_func___va_copy], [
+ AC_TRY_COMPILE([#include <stdarg.h>], [
#ifndef __va_copy
error, bail out
#endif
],
- [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
- if test $gl_cv_func___va_copy = yes; then
- AC_DEFINE([va_copy], [__va_copy],
- [Define as a macro for copying va_list variables.])
- else
- AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
+ [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
+ if test $gl_cv_func___va_copy = yes; then
+ AC_DEFINE([va_copy], [__va_copy],
+ [Define as a macro for copying va_list variables.])
+ else
+ AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
#define gl_va_copy(a,b) ((a) = (b))])
- AC_DEFINE([va_copy], [gl_va_copy],
- [Define as a macro for copying va_list variables.])
+ AC_DEFINE([va_copy], [gl_va_copy],
+ [Define as a macro for copying va_list variables.])
+ fi
fi
fi
])
diff --git a/gl/stdarg.in.h b/gl/stdarg.in.h
new file mode 100644
index 0000000000..6a054ddc26
--- /dev/null
+++ b/gl/stdarg.in.h
@@ -0,0 +1,31 @@
+/* Substitute for and wrapper around <stdarg.h>.
+ Copyright (C) 2008 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, 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, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _GL_STDARG_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDARG_H@
+
+#ifndef _GL_STDARG_H
+#define _GL_STDARG_H
+
+#ifndef va_copy
+# define va_copy(a,b) ((a) = (b))
+#endif
+
+#endif /* _GL_STDARG_H */
+#endif /* _GL_STDARG_H */
diff --git a/lgl/Makefile.am b/lgl/Makefile.am
index 902faa3663..dd94a7cb5e 100644
--- a/lgl/Makefile.am
+++ b/lgl/Makefile.am
@@ -35,15 +35,6 @@ liblgnu_la_DEPENDENCIES = $(lgl_LTLIBOBJS)
EXTRA_liblgnu_la_SOURCES =
liblgnu_la_LDFLAGS = $(AM_LDFLAGS)
-## begin gnulib module absolute-header
-
-# Use this preprocessor expression to decide whether #include_next works.
-# Do not rely on a 'configure'-time test for this, since the expression
-# might appear in an installed header, which is used by some other compiler.
-HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
-
-## end gnulib module absolute-header
-
## begin gnulib module alloca-opt
BUILT_SOURCES += $(ALLOCA_H)
diff --git a/lgl/m4/absolute-header.m4 b/lgl/m4/absolute-header.m4
deleted file mode 100644
index 5b7a2fc35f..0000000000
--- a/lgl/m4/absolute-header.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-# absolute-header.m4 serial 7
-dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Derek Price.
-
-# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
-# ---------------------------------------
-# Find the absolute name of a header file, assuming the header exists.
-# If the header were sys/inttypes.h, this macro would define
-# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
-# in config.h
-# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
-# The three "///" are to pacify Sun C 5.8, which otherwise would say
-# "warning: #include of /usr/include/... may be non-portable".
-# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
-AC_DEFUN([gl_ABSOLUTE_HEADER],
-[AC_LANG_PREPROC_REQUIRE()dnl
-AC_FOREACH([gl_HEADER_NAME], [$1],
- [AS_VAR_PUSHDEF([gl_absolute_header],
- [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
- AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
- m4_quote(m4_defn([gl_absolute_header])),
- [AS_VAR_PUSHDEF([ac_header_exists],
- [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
- AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
- if test AS_VAR_GET(ac_header_exists) = yes; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
-dnl eval is necessary to expand ac_cpp.
-dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
- AS_VAR_SET(gl_absolute_header,
-[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
- s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
- s#^/[^/]#//&#
- p
- q
-}'`])
- fi
- AS_VAR_POPDEF([ac_header_exists])dnl
- ])dnl
- AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
- ["AS_VAR_GET(gl_absolute_header)"],
- [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
- AS_VAR_POPDEF([gl_absolute_header])dnl
-])dnl
-])# gl_ABSOLUTE_HEADER
diff --git a/lgl/m4/gnulib-comp.m4 b/lgl/m4/gnulib-comp.m4
index f4a1f11441..79586543b6 100644
--- a/lgl/m4/gnulib-comp.m4
+++ b/lgl/m4/gnulib-comp.m4
@@ -294,7 +294,6 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/vasprintf.c
lib/wchar.in.h
lib/xsize.h
- m4/absolute-header.m4
m4/alloca.m4
m4/arcfour.m4
m4/arctwo.m4
diff --git a/lgl/m4/include_next.m4 b/lgl/m4/include_next.m4
index 7ce472bc0a..7c08e9319b 100644
--- a/lgl/m4/include_next.m4
+++ b/lgl/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 4
-dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# include_next.m4 serial 5
+dnl Copyright (C) 2006-2008 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.
@@ -63,6 +63,9 @@ EOF
# The three "///" are to pacify Sun C 5.8, which otherwise would say
# "warning: #include of /usr/include/... may be non-portable".
# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[
AC_REQUIRE([gl_INCLUDE_NEXT])