|
version 1.1.1.2, 2012/05/29 09:29:44
|
version 1.1.1.3, 2021/03/17 13:38:46
|
|
Line 1
|
Line 1
|
| # serial 10 -*- Autoconf -*- | # serial 18 -*- Autoconf -*- |
| # Enable extensions on systems that normally disable them. |
# Enable extensions on systems that normally disable them. |
| |
|
| # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc. | # Copyright (C) 2003, 2006-2019 Free Software Foundation, Inc. |
| # This file is free software; the Free Software Foundation |
# This file is free software; the Free Software Foundation |
| # gives unlimited permission to copy and/or distribute it, |
# gives unlimited permission to copy and/or distribute it, |
| # with or without modifications, as long as this notice is preserved. |
# with or without modifications, as long as this notice is preserved. |
| |
|
| # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS | # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git |
| # Autoconf. Perhaps we can remove this once we can assume Autoconf |
# Autoconf. Perhaps we can remove this once we can assume Autoconf |
| # 2.62 or later everywhere, but since CVS Autoconf mutates rapidly | # 2.70 or later everywhere, but since Autoconf mutates rapidly |
| # enough in this area it's likely we'll need to redefine |
# enough in this area it's likely we'll need to redefine |
| # AC_USE_SYSTEM_EXTENSIONS for quite some time. |
# AC_USE_SYSTEM_EXTENSIONS for quite some time. |
| |
|
|
Line 30
|
Line 30
|
| # ------------------------ |
# ------------------------ |
| # Enable extensions on systems that normally disable them, |
# Enable extensions on systems that normally disable them, |
| # typically due to standards-conformance issues. |
# typically due to standards-conformance issues. |
| |
# |
| # Remember that #undef in AH_VERBATIM gets replaced with #define by |
# Remember that #undef in AH_VERBATIM gets replaced with #define by |
| # AC_DEFINE. The goal here is to define all known feature-enabling |
# AC_DEFINE. The goal here is to define all known feature-enabling |
| # macros, then, if reports of conflicts are made, disable macros that |
# macros, then, if reports of conflicts are made, disable macros that |
|
Line 38 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
|
Line 39 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
|
| [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl |
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl |
| AC_BEFORE([$0], [AC_RUN_IFELSE])dnl |
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl |
| |
|
| AC_REQUIRE([AC_CANONICAL_HOST]) |
|
| |
|
| AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) |
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) |
| if test "$MINIX" = yes; then |
if test "$MINIX" = yes; then |
| AC_DEFINE([_POSIX_SOURCE], [1], |
AC_DEFINE([_POSIX_SOURCE], [1], |
| [Define to 1 if you need to in order for `stat' and other | [Define to 1 if you need to in order for 'stat' and other |
| things to work.]) |
things to work.]) |
| AC_DEFINE([_POSIX_1_SOURCE], [2], |
AC_DEFINE([_POSIX_1_SOURCE], [2], |
| [Define to 2 if the system does not provide POSIX.1 features |
[Define to 2 if the system does not provide POSIX.1 features |
| except with this defined.]) |
except with this defined.]) |
| AC_DEFINE([_MINIX], [1], |
AC_DEFINE([_MINIX], [1], |
| [Define to 1 if on MINIX.]) |
[Define to 1 if on MINIX.]) |
| |
AC_DEFINE([_NETBSD_SOURCE], [1], |
| |
[Define to 1 to make NetBSD features available. MINIX 3 needs this.]) |
| fi |
fi |
| |
|
| dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, | dnl Use a different key than __EXTENSIONS__, as that name broke existing |
| dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already | dnl configure.ac when using autoheader 2.62. |
| dnl provided. | AH_VERBATIM([USE_SYSTEM_EXTENSIONS], |
| case "$host_os" in | |
| hpux*) | |
| AC_DEFINE([_XOPEN_SOURCE], [500], | |
| [Define to 500 only on HP-UX.]) | |
| ;; | |
| esac | |
| |
| AH_VERBATIM([__EXTENSIONS__], | |
| [/* Enable extensions on AIX 3, Interix. */ |
[/* Enable extensions on AIX 3, Interix. */ |
| #ifndef _ALL_SOURCE |
#ifndef _ALL_SOURCE |
| # undef _ALL_SOURCE |
# undef _ALL_SOURCE |
| #endif |
#endif |
| /* Enable general extensions on MacOS X. */ | /* Enable general extensions on macOS. */ |
| #ifndef _DARWIN_C_SOURCE |
#ifndef _DARWIN_C_SOURCE |
| # undef _DARWIN_C_SOURCE |
# undef _DARWIN_C_SOURCE |
| #endif |
#endif |
|
Line 75 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
Line 68 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
| #ifndef _GNU_SOURCE |
#ifndef _GNU_SOURCE |
| # undef _GNU_SOURCE |
# undef _GNU_SOURCE |
| #endif |
#endif |
| |
/* Enable NetBSD extensions on NetBSD. */ |
| |
#ifndef _NETBSD_SOURCE |
| |
# undef _NETBSD_SOURCE |
| |
#endif |
| |
/* Enable OpenBSD extensions on NetBSD. */ |
| |
#ifndef _OPENBSD_SOURCE |
| |
# undef _OPENBSD_SOURCE |
| |
#endif |
| /* Enable threading extensions on Solaris. */ |
/* Enable threading extensions on Solaris. */ |
| #ifndef _POSIX_PTHREAD_SEMANTICS |
#ifndef _POSIX_PTHREAD_SEMANTICS |
| # undef _POSIX_PTHREAD_SEMANTICS |
# undef _POSIX_PTHREAD_SEMANTICS |
| #endif |
#endif |
| |
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ |
| |
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ |
| |
# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ |
| |
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ |
| |
# undef __STDC_WANT_IEC_60559_BFP_EXT__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ |
| |
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ |
| |
# undef __STDC_WANT_IEC_60559_DFP_EXT__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ |
| |
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ |
| |
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ |
| |
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ |
| |
# undef __STDC_WANT_IEC_60559_TYPES_EXT__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ |
| |
#ifndef __STDC_WANT_LIB_EXT2__ |
| |
# undef __STDC_WANT_LIB_EXT2__ |
| |
#endif |
| |
/* Enable extensions specified by ISO/IEC 24747:2009. */ |
| |
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ |
| |
# undef __STDC_WANT_MATH_SPEC_FUNCS__ |
| |
#endif |
| /* Enable extensions on HP NonStop. */ |
/* Enable extensions on HP NonStop. */ |
| #ifndef _TANDEM_SOURCE |
#ifndef _TANDEM_SOURCE |
| # undef _TANDEM_SOURCE |
# undef _TANDEM_SOURCE |
| #endif |
#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 X/Open compliant socket functions that do not require linking |
| |
with -lxnet on HP-UX 11.11. */ |
| |
#ifndef _HPUX_ALT_XOPEN_SOCKET_API |
| |
# undef _HPUX_ALT_XOPEN_SOCKET_API |
| |
#endif |
| /* Enable general extensions on Solaris. */ |
/* Enable general extensions on Solaris. */ |
| #ifndef __EXTENSIONS__ |
#ifndef __EXTENSIONS__ |
| # undef __EXTENSIONS__ |
# undef __EXTENSIONS__ |
|
Line 101 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
Line 141 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
| AC_DEFINE([_ALL_SOURCE]) |
AC_DEFINE([_ALL_SOURCE]) |
| AC_DEFINE([_DARWIN_C_SOURCE]) |
AC_DEFINE([_DARWIN_C_SOURCE]) |
| AC_DEFINE([_GNU_SOURCE]) |
AC_DEFINE([_GNU_SOURCE]) |
| |
AC_DEFINE([_NETBSD_SOURCE]) |
| |
AC_DEFINE([_OPENBSD_SOURCE]) |
| AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
| |
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) |
| |
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) |
| |
AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) |
| |
AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) |
| |
AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) |
| |
AC_DEFINE([__STDC_WANT_LIB_EXT2__]) |
| |
AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) |
| AC_DEFINE([_TANDEM_SOURCE]) |
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_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) |
| ])# AC_USE_SYSTEM_EXTENSIONS |
])# AC_USE_SYSTEM_EXTENSIONS |
| |
|
| # gl_USE_SYSTEM_EXTENSIONS |
# gl_USE_SYSTEM_EXTENSIONS |