Commit cacd21c0 authored by Ondřej Surý's avatar Ondřej Surý

Enable system extensions macros using AC_USE_SYSTEM_EXTENSIONS

and remove handcrafted code that enabled __EXTENSIONS__ and _GNU_SOURCE
parent b938f50d
......@@ -26,9 +26,6 @@
/** define if sigwait() is the UnixWare flavor */
#undef HAVE_UNIXWARE_SIGWAIT
/** define on Solaris to get sigwait() to work using pthreads semantics */
#undef _POSIX_PTHREAD_SEMANTICS
/** define if LinuxThreads is in use */
#undef HAVE_LINUXTHREADS
......
......@@ -26,9 +26,6 @@
/** define if sigwait() is the UnixWare flavor */
#undef HAVE_UNIXWARE_SIGWAIT
/** define on Solaris to get sigwait() to work using pthreads semantics */
#undef _POSIX_PTHREAD_SEMANTICS
/** define if LinuxThreads is in use */
#undef HAVE_LINUXTHREADS
......@@ -455,6 +452,9 @@
/* Define if Thread-Local Storage is available */
#undef HAVE_TLS
/* Define to 1 if you have the <uchar.h> header file. */
#undef HAVE_UCHAR_H
/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
......@@ -552,6 +552,28 @@
/* define if PKCS11 is used for Public-Key Cryptography */
#undef USE_PKCS11
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_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 general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* the default value of dnssec-validation option */
#undef VALIDATION_DEFAULT
......@@ -570,6 +592,19 @@
# endif
#endif
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Select RFC3542 IPv6 API on macOS */
#undef __APPLE_USE_RFC_3542
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
......
This diff is collapsed.
......@@ -8,12 +8,16 @@
# information regarding copyright ownership.
AC_INIT(BIND, [9.13], [info@isc.org], [], [https://www.isc.org/downloads/BIND/])
AC_PREREQ(2.59)
AC_PREREQ([2.60])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_USE_SYSTEM_EXTENSIONS
# Enable RFC 3542 APIs on macOS
AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
AC_PROG_MAKE_SET
......@@ -393,34 +397,6 @@ esac
AC_PROG_CC
AC_PROG_CC_C99
#
# OS dependent CC flags
#
case "$host" in
# Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
*-solaris*)
STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
;;
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
# parts of the IPv6 Advanced Socket API as a result. This is stupid
# as it breaks how the two halves (Basic and Advanced) of the IPv6
# Socket API were designed to be used but we have to live with it.
# Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
*-linux* | *-kfreebsd*-gnu*)
STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
;;
#
# Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use.
# Setting this is sufficient to select the correct behavior for BIND 9.
#
*-darwin*)
STD_CDEFINES="$STD_CDEFINES -D__APPLE_USE_RFC_3542"
CPPFLAGS="$CPPFLAGS -D__APPLE_USE_RFC_3542"
;;
esac
#
# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
#
......@@ -884,15 +860,6 @@ case "$host" in
*-linux*)
AC_DEFINE(HAVE_LINUXTHREADS)
;;
#
# Ensure the right sigwait() semantics on Solaris and make
# sure we call pthread_setconcurrency.
#
*-solaris*)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
AC_CHECK_FUNC(pthread_setconcurrency,
AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
;;
esac
# Look for functions relating to thread naming
......
......@@ -77,7 +77,7 @@ isc_thread_setconcurrency(unsigned int level) {
void
isc_thread_setname(isc_thread_t thread, const char *name) {
#if defined(HAVE_PTHREAD_SETNAME_NP) && defined(_GNU_SOURCE)
#if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__APPLE__)
/*
* macOS has pthread_setname_np but only works on the
* current thread so it's not used here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment