* lib/dosname.h, lib/glthread/lock.c, lib/glthread/lock.h, lib/glthread/threadlib.c, lib/windows-mutex.c, lib/windows-mutex.h, lib/windows-once.c, lib/windows-once.h, lib/windows-recmutex.c, lib/windows-recmutex.h, lib/windows-rwlock.c, lib/windows-rwlock.h, m4/host-cpu-c-abi.m4, m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4, m4/lock.m4, m4/longlong.m4, m4/pthread_rwlock_rdlock.m4, tools/config.rpath: Delete. * lib/alloca.in.h, lib/argmatch.c, lib/argmatch.h, lib/arg-nonnull.h, lib/argp-ba.c, lib/argp-eexst.c, lib/argp-fmtstream.c, lib/argp-fmtstream.h, lib/argp-fs-xinl.c, lib/argp.h, lib/argp-help.c, lib/argp-namefrob.h, lib/argp-parse.c, lib/argp-pin.c, lib/argp-pv.c, lib/argp-pvh.c, lib/argp-xinl.c, lib/asnprintf.c, lib/basename-lgpl.c, lib/c-ctype.h, lib/c++defs.h, lib/cdefs.h, lib/closeout.c, lib/closeout.h, lib/close-stream.c, lib/c-strcasecmp.c, lib/c-strcaseeq.h, lib/c-strcase.h, lib/c-strncasecmp.c, lib/dirname.h, lib/dirname-lgpl.c, lib/errno.in.h, lib/error.c, lib/error.h, lib/exitfail.c, lib/exitfail.h, lib/fcntl.in.h, lib/filename.h, lib/float.c, lib/float+.h, lib/float.in.h, lib/fpending.c, lib/fpending.h, lib/getopt1.c, lib/getopt.c, lib/getopt-cdefs.in.h, lib/getopt-core.h, lib/getopt-ext.h, lib/getopt.in.h, lib/getopt_int.h, lib/getopt-pfx-core.h, lib/getopt-pfx-ext.h, lib/getprogname.c, lib/getprogname.h, lib/gettext.h, lib/gettimeofday.c, lib/hard-locale.c, lib/hard-locale.h, lib/intprops.h, lib/isatty.c, lib/itold.c, lib/libc-config.h, lib/limits.in.h, lib/localcharset.c, lib/localcharset.h, lib/localtime-buffer.c, lib/localtime-buffer.h, lib/lstat.c, lib/Makefile.am, lib/malloca.c, lib/malloca.h, lib/malloc.c, lib/mbrtowc.c, lib/mbsinit.c, lib/memchr.c, lib/memchr.valgrind, lib/mempcpy.c, lib/minmax.h, lib/mkdir.c, lib/mkstemp.c, lib/mkstemps.c, lib/msvc-inval.c, lib/msvc-inval.h, lib/msvc-nothrow.c, lib/msvc-nothrow.h, lib/_Noreturn.h, lib/pathmax.h, lib/printf-args.c, lib/printf-args.h, lib/printf-parse.c, lib/printf-parse.h, lib/progname.c, lib/progname.h, lib/quotearg.c, lib/quotearg.h, lib/quote.h, lib/rawmemchr.c, lib/rawmemchr.valgrind, lib/secure_getenv.c, lib/size_max.h, lib/sleep.c, lib/stat.c, lib/stat-time.h, lib/stat-w32.c, lib/stat-w32.h, lib/stdalign.in.h, lib/stdbool.in.h, lib/stddef.in.h, lib/stdint.in.h, lib/stdio-impl.h, lib/stdio.in.h, lib/stdlib.in.h, lib/stpcpy.c, lib/strcasecmp.c, lib/strchrnul.c, lib/strchrnul.valgrind, lib/streq.h, lib/strerror.c, lib/strerror-override.c, lib/strerror-override.h, lib/string.in.h, lib/strings.in.h, lib/stripslash.c, lib/strncasecmp.c, lib/strndup.c, lib/strnlen.c, lib/strverscmp.c, lib/sysexits.in.h, lib/sys_stat.in.h, lib/sys_time.in.h, lib/sys_types.in.h, lib/sys_wait.in.h, lib/tempname.c, lib/tempname.h, lib/time.in.h, lib/unistd.in.h, lib/vasnprintf.c, lib/vasnprintf.h, lib/verify.h, lib/vsnprintf.c, lib/warn-on-use.h, lib/wchar.in.h, lib/wctype.in.h, lib/windows-initguard.h, lib/xalloc-die.c, lib/xalloc.h, lib/xalloc-oversized.h, lib/xmalloc.c, lib/xsize.h, m4/00gnulib.m4, m4/absolute-header.m4, m4/alloca.m4, m4/argp.m4, m4/codeset.m4, m4/dirname.m4, m4/double-slash-root.m4, m4/eealloc.m4, m4/errno_h.m4, m4/error.m4, m4/exponentd.m4, m4/extensions.m4, m4/extern-inline.m4, m4/fcntl_h.m4, m4/fcntl-o.m4, m4/float_h.m4, m4/fpending.m4, m4/getopt.m4, m4/getprogname.m4, m4/gettimeofday.m4, m4/gnulib-cache.m4, m4/gnulib-common.m4, m4/gnulib-comp.m4, m4/gnulib-tool.m4, m4/include_next.m4, m4/__inline.m4, m4/intmax_t.m4, m4/inttypes_h.m4, m4/isatty.m4, m4/largefile.m4, m4/limits-h.m4, m4/localcharset.m4, m4/locale-fr.m4, m4/locale-ja.m4, m4/locale-zh.m4, m4/localtime-buffer.m4, m4/lstat.m4, m4/malloca.m4, m4/malloc.m4, m4/math_h.m4, m4/mbrtowc.m4, m4/mbsinit.m4, m4/mbstate_t.m4, m4/memchr.m4, m4/mempcpy.m4, m4/minmax.m4, m4/mkdir.m4, m4/mkstemp.m4, m4/mkstemps.m4, m4/mmap-anon.m4, m4/msvc-inval.m4, m4/msvc-nothrow.m4, m4/multiarch.m4, m4/nocrash.m4, m4/off_t.m4, m4/pathmax.m4, m4/printf.m4, m4/quotearg.m4, m4/quote.m4, m4/rawmemchr.m4, m4/secure_getenv.m4, m4/size_max.m4, m4/sleep.m4, m4/ssize_t.m4, m4/stat.m4, m4/stat-time.m4, m4/stdalign.m4, m4/stdbool.m4, m4/stddef_h.m4, m4/std-gnu11.m4, m4/stdint_h.m4, m4/stdint.m4, m4/stdio_h.m4, m4/stdlib_h.m4, m4/stpcpy.m4, m4/strcase.m4, m4/strchrnul.m4, m4/strerror.m4, m4/string_h.m4, m4/strings_h.m4, m4/strndup.m4, m4/strnlen.m4, m4/strverscmp.m4, m4/sysexits.m4, m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/sys_types_h.m4, m4/sys_wait_h.m4, m4/tempname.m4, m4/threadlib.m4, m4/time_h.m4, m4/unistd_h.m4, m4/vasnprintf.m4, m4/vsnprintf.m4, m4/warn-on-use.m4, m4/wchar_h.m4, m4/wchar_t.m4, m4/wctype_h.m4, m4/wint_t.m4, m4/xalloc.m4, m4/xsize.m4: Update. * lib/inttypes.in.h, lib/lc-charset-dispatch.c, lib/lc-charset-dispatch.h, lib/locale.in.h, lib/mbrtowc-impl.h, lib/mbrtowc-impl-utf8.h, lib/mbtowc-lock.c, lib/mbtowc-lock.h, lib/setlocale-lock.c, lib/setlocale_null.c, lib/setlocale_null.h, m4/inttypes.m4, m4/locale_h.m4, m4/setlocale_null.m4, m4/visibility.m4, m4/zzgnulib.m4: New files.
224 lines
8.5 KiB
Text
224 lines
8.5 KiB
Text
# include_next.m4 serial 24
|
|
dnl Copyright (C) 2006-2020 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, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
|
|
dnl and PRAGMA_COLUMNS.
|
|
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])
|