Commit ae80e616 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Merge branch '509-use-xsi-strerror_r' into 'master'

Resolve "current master not building on ubuntu 16.04 using --with-libtool --enable-developer"

Closes #509

See merge request !727
parents b938f50d 1656152d
Pipeline #4346 passed with stages
in 8 minutes and 32 seconds
......@@ -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
......
......@@ -40,6 +40,7 @@
#include <isc/print.h>
#include <isc/resource.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <named/globals.h>
......
......@@ -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
......
......@@ -33,6 +33,7 @@
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
......
......@@ -29,6 +29,7 @@
#include <isc/serial.h>
#include <isc/stats.h>
#include <isc/stdtime.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/taskpool.h>
#include <isc/thread.h>
......
......@@ -32,7 +32,7 @@ HEADERS = aes.h app.h assertions.h atomic.h backtrace.h base32.h base64.h \
radix.h random.h ratelimiter.h refcount.h regex.h \
region.h resource.h result.h resultclass.h rwlock.h \
safe.h serial.h sha1.h sha2.h sockaddr.h socket.h \
stats.h stdio.h stdlib.h string.h symtab.h \
stats.h stdio.h stdlib.h strerr.h string.h symtab.h \
task.h taskpool.h timer.h tm.h types.h util.h version.h \
xml.h
......
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#pragma once
/*! \file isc/strerr.h */
#include <config.h>
#include <string.h>
#if _GNU_SOURCE
#undef strerror_r
#define strerror_r isc_string_strerror_r
#endif
......@@ -34,4 +34,7 @@ isc_string_strlcat(char *dst, const char *src, size_t size);
#define strlcat isc_string_strlcat
#endif
int
isc_string_strerror_r(int errnum, char *buf, size_t buflen);
ISC_LANG_ENDDECLS
......@@ -18,6 +18,7 @@
#include <isc/condition.h>
#include <isc/msgs.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
......
......@@ -16,7 +16,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <errno.h>
......@@ -24,6 +23,8 @@
#include <isc/mutex.h>
#include <isc/util.h>
#include <isc/print.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/once.h>
#if ISC_MUTEX_PROFILE
......
......@@ -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
......
......@@ -42,7 +42,10 @@
#include <config.h> // IWYU pragma: keep
#ifdef _GNU_SOURCE
#undef _GNU_SOURCE
#include <string.h>
#endif
#include "isc/string.h" // IWYU pragma: keep
......@@ -103,3 +106,8 @@ isc_string_strlcat(char *dst, const char *src, size_t size)
return(dlen + (s - src)); /* count does not include NUL */
}
int
isc_string_strerror_r(int errnum, char *buf, size_t buflen) {
return (strerror_r(errnum, buf, buflen));
}
......@@ -36,6 +36,7 @@
#include <isc/mutex.h>
#include <isc/event.h>
#include <isc/platform.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/time.h>
......
......@@ -15,10 +15,11 @@
#include <config.h>
#include <stdbool.h>
#include <string.h>
#include <isc/platform.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
#include "errno2result.h"
......
......@@ -34,6 +34,7 @@
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/types.h>
#include <isc/util.h>
......
......@@ -32,6 +32,7 @@
#include <isc/net.h>
#include <isc/netdb.h>
#include <isc/once.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
......
......@@ -35,7 +35,6 @@
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <isc/buffer.h>
......@@ -56,6 +55,7 @@
#include <isc/resource.h>
#include <isc/socket.h>
#include <isc/stats.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/thread.h>
......
......@@ -27,6 +27,7 @@
#include <isc/log.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/tm.h>
......
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