|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that |
|
dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. |
|
m4_ifndef([AC_CHECK_INCLUDES_DEFAULT], |
|
[AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m4_version_prereq([2.72], [], [ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], |
|
[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl |
|
AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl |
|
AC_BEFORE([$0], [AC_LINK_IFELSE])dnl |
|
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl |
|
AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl |
|
dnl |
|
dnl Use a different key than __EXTENSIONS__, as that name broke existing |
|
dnl configure.ac when using autoheader 2.62. |
|
dnl The macros below are in alphabetical order ignoring leading _ or __ |
|
dnl prefixes. |
|
AH_VERBATIM([USE_SYSTEM_EXTENSIONS], |
|
[/* Enable extensions on AIX 3, Interix. */ |
|
|
|
|
|
|
|
/* Enable general extensions on macOS. */ |
|
|
|
|
|
|
|
/* Enable general extensions on Solaris. */ |
|
|
|
|
|
|
|
/* Enable GNU extensions on systems that have them. */ |
|
|
|
|
|
|
|
/* Enable X/Open compliant socket functions that do not require linking |
|
with -lxnet on HP-UX 11.11. */ |
|
|
|
|
|
|
|
/* Identify the host operating system as Minix. |
|
This macro does not affect the system headers' behavior. |
|
A future release of Autoconf may stop defining this macro. */ |
|
|
|
|
|
|
|
/* Enable general extensions on NetBSD. |
|
Enable NetBSD compatibility extensions on Minix. */ |
|
|
|
|
|
|
|
/* Enable OpenBSD compatibility extensions on NetBSD. |
|
Oddly enough, this does nothing on OpenBSD. */ |
|
|
|
|
|
|
|
/* Define to 1 if needed for POSIX-compatible behavior. */ |
|
|
|
|
|
|
|
/* Define to 2 if needed for POSIX-compatible behavior. */ |
|
|
|
|
|
|
|
/* Enable POSIX-compatible threading on Solaris. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by C23 Annex F. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ |
|
|
|
|
|
|
|
/* Enable extensions specified by ISO/IEC 24747:2009. */ |
|
|
|
|
|
|
|
/* Enable extensions on HP NonStop. */ |
|
|
|
|
|
|
|
/* Enable X/Open extensions. Define to 500 only if necessary |
|
to make mbstate_t available. */ |
|
|
|
|
|
|
|
])dnl |
|
|
|
AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl |
|
_AC_CHECK_HEADER_ONCE([wchar.h]) |
|
_AC_CHECK_HEADER_ONCE([minix/config.h]) |
|
|
|
dnl Defining __EXTENSIONS__ may break the system headers on some systems. |
|
dnl (FIXME: Which ones?) |
|
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], |
|
[ac_cv_safe_to_define___extensions__], |
|
[AC_COMPILE_IFELSE( |
|
[AC_LANG_PROGRAM([[ |
|
|
|
]AC_INCLUDES_DEFAULT])], |
|
[ac_cv_safe_to_define___extensions__=yes], |
|
[ac_cv_safe_to_define___extensions__=no])]) |
|
|
|
dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to |
|
dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. |
|
dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms |
|
dnl not covered by turn-on-extensions macros (notably Dragonfly, Free, |
|
dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so |
|
dnl it should only be defined when necessary. |
|
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], |
|
[ac_cv_should_define__xopen_source], |
|
[ac_cv_should_define__xopen_source=no |
|
AS_IF([test $ac_cv_header_wchar_h = yes], |
|
[AC_COMPILE_IFELSE( |
|
[AC_LANG_PROGRAM([[ |
|
|
|
mbstate_t x;]])], |
|
[], |
|
[AC_COMPILE_IFELSE( |
|
[AC_LANG_PROGRAM([[ |
|
|
|
|
|
mbstate_t x;]])], |
|
[ac_cv_should_define__xopen_source=yes])])])]) |
|
|
|
AC_DEFINE([_ALL_SOURCE]) |
|
AC_DEFINE([_DARWIN_C_SOURCE]) |
|
AC_DEFINE([_GNU_SOURCE]) |
|
AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) |
|
AC_DEFINE([_NETBSD_SOURCE]) |
|
AC_DEFINE([_OPENBSD_SOURCE]) |
|
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_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]) |
|
AS_IF([test $ac_cv_header_minix_config_h = yes], |
|
[MINIX=yes |
|
AC_DEFINE([_MINIX]) |
|
AC_DEFINE([_POSIX_SOURCE]) |
|
AC_DEFINE([_POSIX_1_SOURCE], [2])], |
|
[MINIX=]) |
|
AS_IF([test $ac_cv_safe_to_define___extensions__ = yes], |
|
[AC_DEFINE([__EXTENSIONS__])]) |
|
AS_IF([test $ac_cv_should_define__xopen_source = yes], |
|
[AC_DEFINE([_XOPEN_SOURCE], [500])]) |
|
]) |
|
]) |
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], |
|
[ |
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
|
|
|
dnl On OpenBSD 6.8 with GCC, the include files contain a couple of |
|
dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE. |
|
dnl That's because this version of GCC (4.2.1) supports the option |
|
dnl '-std=gnu99' but not the option '-std=gnu11'. |
|
AC_REQUIRE([AC_CANONICAL_HOST]) |
|
case "$host_os" in |
|
openbsd*) |
|
AC_DEFINE([_ISOC11_SOURCE], [1], |
|
[Define to enable the declarations of ISO C 11 types and functions.]) |
|
;; |
|
esac |
|
]) |
|
|