4a626d0a0f
2015-08-24 Pedro Alves <palves@redhat.com> * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to 1029a8112290f6eee9d7878a391c49db42c999bd. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate. * gnulib/import/Makefile.am: Update. * gnulib/import/Makefile.in: Update. * gnulib/import/alloca.in.h: Update. * gnulib/import/basename-lgpl.c: Update. * gnulib/import/canonicalize-lgpl.c: Update. * gnulib/import/config.charset: Update. * gnulib/import/dirent.in.h: Update. * gnulib/import/dirfd.c: Update. * gnulib/import/dirname-lgpl.c: Update. * gnulib/import/dirname.h: Update. * gnulib/import/dosname.h: Update. * gnulib/import/errno.in.h: Update. * gnulib/import/extra/snippet/arg-nonnull.h: Update. * gnulib/import/extra/snippet/c++defs.h: Update. * gnulib/import/extra/snippet/warn-on-use.h: Update. * gnulib/import/extra/update-copyright: Update. * gnulib/import/float+.h: Update. * gnulib/import/float.c: Update. * gnulib/import/float.in.h: Update. * gnulib/import/fnmatch.c: Update. * gnulib/import/fnmatch.in.h: Update. * gnulib/import/fnmatch_loop.c: Update. * gnulib/import/fpucw.h: Update. * gnulib/import/frexp.c: Update. * gnulib/import/frexpl.c: Update. * gnulib/import/gettimeofday.c: Update. * gnulib/import/inttypes.in.h: Update. * gnulib/import/isnan.c: Update. * gnulib/import/isnand-nolibm.h: Update. * gnulib/import/isnand.c: Update. * gnulib/import/isnanl-nolibm.h: Update. * gnulib/import/isnanl.c: Update. * gnulib/import/itold.c: Update. * gnulib/import/localcharset.c: Update. * gnulib/import/localcharset.h: Update. * gnulib/import/lstat.c: Update. * gnulib/import/m4/00gnulib.m4: Update. * gnulib/import/m4/absolute-header.m4: Update. * gnulib/import/m4/alloca.m4: Update. * gnulib/import/m4/canonicalize.m4: Update. * gnulib/import/m4/codeset.m4: Update. * gnulib/import/m4/configmake.m4: Update. * gnulib/import/m4/dirent_h.m4: Update. * gnulib/import/m4/dirfd.m4: Update. * gnulib/import/m4/dirname.m4: Update. * gnulib/import/m4/double-slash-root.m4: Update. * gnulib/import/m4/eealloc.m4: Update. * gnulib/import/m4/errno_h.m4: Update. * gnulib/import/m4/exponentd.m4: Update. * gnulib/import/m4/exponentl.m4: Update. * gnulib/import/m4/extensions.m4: Update. * gnulib/import/m4/extern-inline.m4: Update. * gnulib/import/m4/fcntl-o.m4: Update. * gnulib/import/m4/float_h.m4: Update. * gnulib/import/m4/fnmatch.m4: Update. * gnulib/import/m4/fpieee.m4: Update. * gnulib/import/m4/frexp.m4: Update. * gnulib/import/m4/frexpl.m4: Update. * gnulib/import/m4/gettimeofday.m4: Update. * gnulib/import/m4/glibc21.m4: Update. * gnulib/import/m4/gnulib-cache.m4: Update. * gnulib/import/m4/gnulib-common.m4: Update. * gnulib/import/m4/gnulib-comp.m4: Update. * gnulib/import/m4/gnulib-tool.m4: Update. * gnulib/import/m4/include_next.m4: Update. * gnulib/import/m4/inttypes-pri.m4: Update. * gnulib/import/m4/inttypes.m4: Update. * gnulib/import/m4/isnand.m4: Update. * gnulib/import/m4/isnanl.m4: Update. * gnulib/import/m4/largefile.m4: Update. * gnulib/import/m4/localcharset.m4: Update. * gnulib/import/m4/locale-fr.m4: Update. * gnulib/import/m4/locale-ja.m4: Update. * gnulib/import/m4/locale-zh.m4: Update. * gnulib/import/m4/longlong.m4: Update. * gnulib/import/m4/lstat.m4: Update. * gnulib/import/m4/malloc.m4: Update. * gnulib/import/m4/malloca.m4: Update. * gnulib/import/m4/math_h.m4: Update. * gnulib/import/m4/mbrtowc.m4: Update. * gnulib/import/m4/mbsinit.m4: Update. * gnulib/import/m4/mbsrtowcs.m4: Update. * gnulib/import/m4/mbstate_t.m4: Update. * gnulib/import/m4/memchr.m4: Update. * gnulib/import/m4/memmem.m4: Update. * gnulib/import/m4/mmap-anon.m4: Update. * gnulib/import/m4/multiarch.m4: Update. * gnulib/import/m4/nocrash.m4: Update. * gnulib/import/m4/off_t.m4: Update. * gnulib/import/m4/pathmax.m4: Update. * gnulib/import/m4/readlink.m4: Update. * gnulib/import/m4/rename.m4: Update. * gnulib/import/m4/rmdir.m4: Update. * gnulib/import/m4/ssize_t.m4: Update. * gnulib/import/m4/stat.m4: Update. * gnulib/import/m4/stdbool.m4: Update. * gnulib/import/m4/stddef_h.m4: Update. * gnulib/import/m4/stdint.m4: Update. * gnulib/import/m4/stdio_h.m4: Update. * gnulib/import/m4/stdlib_h.m4: Update. * gnulib/import/m4/string_h.m4: Update. * gnulib/import/m4/strstr.m4: Update. * gnulib/import/m4/strtok_r.m4: Update. * gnulib/import/m4/sys_socket_h.m4: Update. * gnulib/import/m4/sys_stat_h.m4: Update. * gnulib/import/m4/sys_time_h.m4: Update. * gnulib/import/m4/sys_types_h.m4: Update. * gnulib/import/m4/time_h.m4: Update. * gnulib/import/m4/unistd_h.m4: Update. * gnulib/import/m4/warn-on-use.m4: Update. * gnulib/import/m4/wchar_h.m4: Update. * gnulib/import/m4/wchar_t.m4: Update. * gnulib/import/m4/wctype_h.m4: Update. * gnulib/import/m4/wint_t.m4: Update. * gnulib/import/malloc.c: Update. * gnulib/import/malloca.c: Update. * gnulib/import/malloca.h: Update. * gnulib/import/math.in.h: Update. * gnulib/import/mbrtowc.c: Update. * gnulib/import/mbsinit.c: Update. * gnulib/import/mbsrtowcs-impl.h: Update. * gnulib/import/mbsrtowcs-state.c: Update. * gnulib/import/mbsrtowcs.c: Update. * gnulib/import/memchr.c: Update. * gnulib/import/memmem.c: Update. * gnulib/import/pathmax.h: Update. * gnulib/import/readlink.c: Update. * gnulib/import/ref-add.sin: Update. * gnulib/import/ref-del.sin: Update. * gnulib/import/rename.c: Update. * gnulib/import/rmdir.c: Update. * gnulib/import/same-inode.h: Update. * gnulib/import/stat.c: Update. * gnulib/import/stdbool.in.h: Update. * gnulib/import/stddef.in.h: Update. * gnulib/import/stdint.in.h: Update. * gnulib/import/stdio.c: Update. * gnulib/import/stdio.in.h: Update. * gnulib/import/stdlib.in.h: Update. * gnulib/import/str-two-way.h: Update. * gnulib/import/streq.h: Update. * gnulib/import/string.in.h: Update. * gnulib/import/stripslash.c: Update. * gnulib/import/strnlen1.c: Update. * gnulib/import/strnlen1.h: Update. * gnulib/import/strstr.c: Update. * gnulib/import/strtok_r.c: Update. * gnulib/import/sys_stat.in.h: Update. * gnulib/import/sys_time.in.h: Update. * gnulib/import/sys_types.in.h: Update. * gnulib/import/time.in.h: Update. * gnulib/import/unistd.in.h: Update. * gnulib/import/verify.h: Update. * gnulib/import/wchar.in.h: Update. * gnulib/import/wctype.in.h: Update. * gnulib/import/gettimeofday.c: New file. * gnulib/import/m4/absolute-header.m4: New file. * gnulib/import/m4/gettimeofday.m4: New file. * gnulib/import/m4/sys_socket_h.m4: New file. * gnulib/import/m4/sys_time_h.m4: New file. * gnulib/import/stdio.c: Delete file. * gnulib/import/sys_time.in.h: New file.
223 lines
8.5 KiB
Text
223 lines
8.5 KiB
Text
# include_next.m4 serial 23
|
|
dnl Copyright (C) 2006-2015 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 Paul Eggert and Derek Price.
|
|
|
|
dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
|
|
dnl
|
|
dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
|
|
dnl 'include' otherwise.
|
|
dnl
|
|
dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler
|
|
dnl supports it in the special case that it is the first include directive in
|
|
dnl the given file, or to 'include' otherwise.
|
|
dnl
|
|
dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
|
|
dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
|
|
dnl '#pragma GCC system_header' has the same effect as if the file was found
|
|
dnl through the include search path specified with '-isystem' options (as
|
|
dnl opposed to the search path specified with '-I' options). Namely, gcc
|
|
dnl does not warn about some things, and on some systems (Solaris and Interix)
|
|
dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
|
|
dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
|
|
dnl of plain '__STDC__'.
|
|
dnl
|
|
dnl PRAGMA_COLUMNS can be used in files that override system header files, so
|
|
dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
|
|
dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
|
|
dnl has the effect of truncating the lines of that file and all files that it
|
|
dnl includes to 80 columns) and the gnulib file has lines longer than 80
|
|
dnl columns.
|
|
|
|
AC_DEFUN([gl_INCLUDE_NEXT],
|
|
[
|
|
AC_LANG_PREPROC_REQUIRE()
|
|
AC_CACHE_CHECK([whether the preprocessor supports include_next],
|
|
[gl_cv_have_include_next],
|
|
[rm -rf conftestd1a conftestd1b conftestd2
|
|
mkdir conftestd1a conftestd1b conftestd2
|
|
dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on
|
|
dnl AIX 6.1 support include_next when used as first preprocessor directive
|
|
dnl in a file, but not when preceded by another include directive. Check
|
|
dnl for this bug by including <stdio.h>.
|
|
dnl Additionally, with this same compiler, include_next is a no-op when
|
|
dnl used in a header file that was included by specifying its absolute
|
|
dnl file name. Despite these two bugs, include_next is used in the
|
|
dnl compiler's <math.h>. By virtue of the second bug, we need to use
|
|
dnl include_next as well in this case.
|
|
cat <<EOF > conftestd1a/conftest.h
|
|
#define DEFINED_IN_CONFTESTD1
|
|
#include_next <conftest.h>
|
|
#ifdef DEFINED_IN_CONFTESTD2
|
|
int foo;
|
|
#else
|
|
#error "include_next doesn't work"
|
|
#endif
|
|
EOF
|
|
cat <<EOF > conftestd1b/conftest.h
|
|
#define DEFINED_IN_CONFTESTD1
|
|
#include <stdio.h>
|
|
#include_next <conftest.h>
|
|
#ifdef DEFINED_IN_CONFTESTD2
|
|
int foo;
|
|
#else
|
|
#error "include_next doesn't work"
|
|
#endif
|
|
EOF
|
|
cat <<EOF > conftestd2/conftest.h
|
|
#ifndef DEFINED_IN_CONFTESTD1
|
|
#error "include_next test doesn't work"
|
|
#endif
|
|
#define DEFINED_IN_CONFTESTD2
|
|
EOF
|
|
gl_save_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
|
|
dnl We intentionally avoid using AC_LANG_SOURCE here.
|
|
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
|
|
[gl_cv_have_include_next=yes],
|
|
[CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
|
|
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
|
|
[gl_cv_have_include_next=buggy],
|
|
[gl_cv_have_include_next=no])
|
|
])
|
|
CPPFLAGS="$gl_save_CPPFLAGS"
|
|
rm -rf conftestd1a conftestd1b conftestd2
|
|
])
|
|
PRAGMA_SYSTEM_HEADER=
|
|
if test $gl_cv_have_include_next = yes; then
|
|
INCLUDE_NEXT=include_next
|
|
INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
|
|
if test -n "$GCC"; then
|
|
PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
|
|
fi
|
|
else
|
|
if test $gl_cv_have_include_next = buggy; then
|
|
INCLUDE_NEXT=include
|
|
INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
|
|
else
|
|
INCLUDE_NEXT=include
|
|
INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
|
|
fi
|
|
fi
|
|
AC_SUBST([INCLUDE_NEXT])
|
|
AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
|
|
AC_SUBST([PRAGMA_SYSTEM_HEADER])
|
|
AC_CACHE_CHECK([whether system header files limit the line length],
|
|
[gl_cv_pragma_columns],
|
|
[dnl HP NonStop systems, which define __TANDEM, have this misfeature.
|
|
AC_EGREP_CPP([choke me],
|
|
[
|
|
#ifdef __TANDEM
|
|
choke me
|
|
#endif
|
|
],
|
|
[gl_cv_pragma_columns=yes],
|
|
[gl_cv_pragma_columns=no])
|
|
])
|
|
if test $gl_cv_pragma_columns = yes; then
|
|
PRAGMA_COLUMNS="#pragma COLUMNS 10000"
|
|
else
|
|
PRAGMA_COLUMNS=
|
|
fi
|
|
AC_SUBST([PRAGMA_COLUMNS])
|
|
])
|
|
|
|
# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
|
|
# ------------------------------------------
|
|
# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
|
|
# '<foo.h>'; otherwise define it to be
|
|
# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
|
|
# Also, if #include_next works as first preprocessing directive in a file,
|
|
# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to
|
|
# be
|
|
# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
|
|
# That way, a header file with the following line:
|
|
# #@INCLUDE_NEXT@ @NEXT_FOO_H@
|
|
# or
|
|
# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
|
|
# behaves (after sed substitution) as if it contained
|
|
# #include_next <foo.h>
|
|
# even if the compiler does not support include_next.
|
|
# 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.
|
|
#
|
|
# This macro also checks whether each header exists, by invoking
|
|
# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
|
|
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
|
|
[
|
|
gl_NEXT_HEADERS_INTERNAL([$1], [check])
|
|
])
|
|
|
|
# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
|
|
# ------------------------------------
|
|
# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
|
|
# This is suitable for headers like <stddef.h> that are standardized by C89
|
|
# and therefore can be assumed to exist.
|
|
AC_DEFUN([gl_NEXT_HEADERS],
|
|
[
|
|
gl_NEXT_HEADERS_INTERNAL([$1], [assume])
|
|
])
|
|
|
|
# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
|
|
AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
|
|
[
|
|
AC_REQUIRE([gl_INCLUDE_NEXT])
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
|
m4_if([$2], [check],
|
|
[AC_CHECK_HEADERS_ONCE([$1])
|
|
])
|
|
|
|
dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
|
|
dnl until we can assume autoconf 2.64 or newer.
|
|
m4_foreach_w([gl_HEADER_NAME], [$1],
|
|
[AS_VAR_PUSHDEF([gl_next_header],
|
|
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
|
|
if test $gl_cv_have_include_next = yes; then
|
|
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
|
|
else
|
|
AC_CACHE_CHECK(
|
|
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
|
|
m4_defn([gl_next_header]),
|
|
[m4_if([$2], [check],
|
|
[AS_VAR_PUSHDEF([gl_header_exists],
|
|
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
|
|
if test AS_VAR_GET(gl_header_exists) = yes; then
|
|
AS_VAR_POPDEF([gl_header_exists])
|
|
])
|
|
gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
|
|
AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
|
|
AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
|
|
m4_if([$2], [check],
|
|
[else
|
|
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
|
|
fi
|
|
])
|
|
])
|
|
fi
|
|
AC_SUBST(
|
|
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
|
|
[AS_VAR_GET(gl_next_header)])
|
|
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
|
|
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
|
|
gl_next_as_first_directive='<'gl_HEADER_NAME'>'
|
|
else
|
|
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
|
|
gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
|
|
fi
|
|
AC_SUBST(
|
|
AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
|
|
[$gl_next_as_first_directive])
|
|
AS_VAR_POPDEF([gl_next_header])])
|
|
])
|
|
|
|
# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
|
|
# this fallback is safe for all earlier autoconf versions.
|
|
m4_define_default([AC_LANG_DEFINES_PROVIDED])
|