* lib/Makefile.am lib/alloca.in.h lib/argp-ba.c lib/argp-eexst.c lib/argp-fmtstream.c lib/argp-fmtstream.h lib/argp-fs-xinl.c 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/argp.h lib/asnprintf.c lib/basename-lgpl.c lib/dirname-lgpl.c lib/dirname.h lib/dosname.h lib/errno.in.h lib/error.c lib/error.h lib/fcntl.in.h lib/float+.h lib/float.c lib/float.in.h lib/gethrxtime.c lib/gethrxtime.h lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/gettime.c lib/gettimeofday.c lib/intprops.h lib/itold.c lib/lstat.c lib/malloc.c lib/memchr.c lib/mempcpy.c lib/mkstemp.c lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c lib/msvc-nothrow.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/rawmemchr.c lib/size_max.h lib/sleep.c lib/stat.c lib/stdalign.in.h lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h lib/stdio.in.h lib/stdlib.in.h lib/strcasecmp.c lib/strchrnul.c lib/strerror-override.c lib/strerror-override.h lib/strerror.c lib/string.in.h lib/strings.in.h lib/stripslash.c lib/strncasecmp.c lib/strndup.c lib/strnlen.c lib/sys_stat.in.h lib/sys_time.in.h lib/sys_types.in.h lib/sys_wait.in.h lib/sysexits.in.h lib/tempname.c lib/tempname.h lib/time.in.h lib/timespec.h lib/unistd.in.h lib/vasnprintf.c lib/vasnprintf.h lib/verify.h lib/vsnprintf.c lib/wchar.in.h lib/xsize.h lib/xtime.h m4/00gnulib.m4 m4/alloca.m4 m4/argp.m4 m4/clock_time.m4 m4/dirname.m4 m4/double-slash-root.m4 m4/errno_h.m4 m4/error.m4 m4/exponentd.m4 m4/extensions.m4 m4/extern-inline.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 m4/float_h.m4 m4/gethrxtime.m4 m4/getopt.m4 m4/gettime.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/intmax_t.m4 m4/inttypes_h.m4 m4/largefile.m4 m4/longlong.m4 m4/lstat.m4 m4/malloc.m4 m4/math_h.m4 m4/memchr.m4 m4/mempcpy.m4 m4/mkstemp.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/rawmemchr.m4 m4/size_max.m4 m4/sleep.m4 m4/ssize_t.m4 m4/stat.m4 m4/stdalign.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdint_h.m4 m4/stdio_h.m4 m4/stdlib_h.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/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/sysexits.m4 m4/tempname.m4 m4/time_h.m4 m4/timespec.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/wint_t.m4 m4/xsize.m4 tools/snippet/arg-nonnull.h tools/snippet/c++defs.h tools/snippet/warn-on-use.h: Upgrade to gnulib 9ceceed274f83094127f9ff0bf061293c9fe1e7f. * m4/secure_getenv.m4, lib/secure_getenv.c, lib/unistd.c, lib/xtime.c: New files. * src/bin/Makefile.am: Link with the libtool library.
138 lines
5.2 KiB
Text
138 lines
5.2 KiB
Text
# serial 13 -*- Autoconf -*-
|
|
# Enable extensions on systems that normally disable them.
|
|
|
|
# Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
|
|
# This file is free software; the Free Software Foundation
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
|
|
# Autoconf. Perhaps we can remove this once we can assume Autoconf
|
|
# 2.70 or later everywhere, but since Autoconf mutates rapidly
|
|
# enough in this area it's likely we'll need to redefine
|
|
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
|
|
|
|
# If autoconf reports a warning
|
|
# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
|
|
# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
|
|
# the fix is
|
|
# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
|
|
# but always AC_REQUIREd,
|
|
# 2) to ensure that for each occurrence of
|
|
# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
|
# or
|
|
# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
|
# the corresponding gnulib module description has 'extensions' among
|
|
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
|
|
# invocation occurs in gl_EARLY, not in gl_INIT.
|
|
|
|
# AC_USE_SYSTEM_EXTENSIONS
|
|
# ------------------------
|
|
# Enable extensions on systems that normally disable them,
|
|
# typically due to standards-conformance issues.
|
|
#
|
|
# Remember that #undef in AH_VERBATIM gets replaced with #define by
|
|
# AC_DEFINE. The goal here is to define all known feature-enabling
|
|
# macros, then, if reports of conflicts are made, disable macros that
|
|
# cause problems on some platforms (such as __EXTENSIONS__).
|
|
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
|
|
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
|
|
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
|
|
|
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
|
|
if test "$MINIX" = yes; then
|
|
AC_DEFINE([_POSIX_SOURCE], [1],
|
|
[Define to 1 if you need to in order for 'stat' and other
|
|
things to work.])
|
|
AC_DEFINE([_POSIX_1_SOURCE], [2],
|
|
[Define to 2 if the system does not provide POSIX.1 features
|
|
except with this defined.])
|
|
AC_DEFINE([_MINIX], [1],
|
|
[Define to 1 if on MINIX.])
|
|
AC_DEFINE([_NETBSD_SOURCE], [1],
|
|
[Define to 1 to make NetBSD features available. MINIX 3 needs this.])
|
|
fi
|
|
|
|
dnl Use a different key than __EXTENSIONS__, as that name broke existing
|
|
dnl configure.ac when using autoheader 2.62.
|
|
AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
|
|
[/* Enable extensions on AIX 3, Interix. */
|
|
#ifndef _ALL_SOURCE
|
|
# undef _ALL_SOURCE
|
|
#endif
|
|
/* Enable general extensions on OS X. */
|
|
#ifndef _DARWIN_C_SOURCE
|
|
# undef _DARWIN_C_SOURCE
|
|
#endif
|
|
/* Enable GNU extensions on systems that have them. */
|
|
#ifndef _GNU_SOURCE
|
|
# undef _GNU_SOURCE
|
|
#endif
|
|
/* Enable threading extensions on Solaris. */
|
|
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
# undef _POSIX_PTHREAD_SEMANTICS
|
|
#endif
|
|
/* Enable extensions on HP NonStop. */
|
|
#ifndef _TANDEM_SOURCE
|
|
# undef _TANDEM_SOURCE
|
|
#endif
|
|
/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
|
|
mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
|
|
whether compiling with -Ae or -D_HPUX_SOURCE=1. */
|
|
#ifndef _XOPEN_SOURCE
|
|
# undef _XOPEN_SOURCE
|
|
#endif
|
|
/* Enable general extensions on Solaris. */
|
|
#ifndef __EXTENSIONS__
|
|
# undef __EXTENSIONS__
|
|
#endif
|
|
])
|
|
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
|
|
[ac_cv_safe_to_define___extensions__],
|
|
[AC_COMPILE_IFELSE(
|
|
[AC_LANG_PROGRAM([[
|
|
# define __EXTENSIONS__ 1
|
|
]AC_INCLUDES_DEFAULT])],
|
|
[ac_cv_safe_to_define___extensions__=yes],
|
|
[ac_cv_safe_to_define___extensions__=no])])
|
|
test $ac_cv_safe_to_define___extensions__ = yes &&
|
|
AC_DEFINE([__EXTENSIONS__])
|
|
AC_DEFINE([_ALL_SOURCE])
|
|
AC_DEFINE([_DARWIN_C_SOURCE])
|
|
AC_DEFINE([_GNU_SOURCE])
|
|
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
|
|
AC_DEFINE([_TANDEM_SOURCE])
|
|
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
|
|
[ac_cv_should_define__xopen_source],
|
|
[ac_cv_should_define__xopen_source=no
|
|
AC_COMPILE_IFELSE(
|
|
[AC_LANG_PROGRAM([[
|
|
#include <wchar.h>
|
|
mbstate_t x;]])],
|
|
[],
|
|
[AC_COMPILE_IFELSE(
|
|
[AC_LANG_PROGRAM([[
|
|
#define _XOPEN_SOURCE 500
|
|
#include <wchar.h>
|
|
mbstate_t x;]])],
|
|
[ac_cv_should_define__xopen_source=yes])])])
|
|
test $ac_cv_should_define__xopen_source = yes &&
|
|
AC_DEFINE([_XOPEN_SOURCE], [500])
|
|
])# AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
# gl_USE_SYSTEM_EXTENSIONS
|
|
# ------------------------
|
|
# Enable extensions on systems that normally disable them,
|
|
# typically due to standards-conformance issues.
|
|
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
|
|
[
|
|
dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
|
|
dnl gnulib does not need it. But if it gets required by third-party macros
|
|
dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
|
|
dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
|
|
dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
|
|
dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
|
|
AC_REQUIRE([AC_GNU_SOURCE])
|
|
|
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
|
])
|