Improve autoconf pthread detection

This commit is contained in:
Ondřej Surý
2018-08-15 11:12:03 +02:00
committed by Witold Kręcicki
parent 5cdb38c2c7
commit c692da2182
19 changed files with 1252 additions and 1621 deletions

View File

@@ -18,7 +18,7 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/unix/include \
-I${srcdir}/@ISC_THREAD_DIR@/include \
-I${srcdir}/pthreads/include \
-I${srcdir}/@ISC_ARCH_DIR@/include \
-I./include \
-I${srcdir}/include ${DNS_INCLUDES} @OPENSSL_INCLUDES@
@@ -36,9 +36,7 @@ UNIXOBJS = @ISC_ISCIPV6_O@ unix/pk11_api.@O@ \
NLSOBJS = nls/msgcat.@O@
THREADOPTOBJS = @ISC_THREAD_DIR@/condition.@O@ @ISC_THREAD_DIR@/mutex.@O@
THREADOBJS = @THREADOPTOBJS@ @ISC_THREAD_DIR@/thread.@O@
THREADOBJS = pthreads/condition.@O@ pthreads/mutex.@O@ pthreads/thread.@O@
WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/errno.@O@ \
win32/file.@O@ win32/fsaccess.@O@ \
@@ -85,7 +83,7 @@ LIBS = @OPENSSL_LIBS@ @LIBS@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
SUBDIRS = include unix nls @ISC_THREAD_DIR@ @ISC_ARCH_DIR@
SUBDIRS = include unix nls pthreads @ISC_ARCH_DIR@
TARGETS = timestamp
TESTDIRS = @UNITTESTS@

View File

@@ -1,32 +0,0 @@
# 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.
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
CINCLUDES = -I${srcdir}/include \
-I${srcdir}/../unix/include \
-I../include \
-I${srcdir}/../include \
-I${srcdir}/..
CDEFINES =
CWARNINGS =
THREADOPTOBJS = condition.@O@ mutex.@O@
OBJS = @THREADOPTOBJS@ thread.@O@
THREADOPTSRCS = condition.c mutex.c
SRCS = @THREADOPTSRCS@ thread.c
SUBDIRS = include
TARGETS = ${OBJS}
@BIND9_MAKE_RULES@

View File

@@ -1,17 +0,0 @@
/*
* 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.
*/
#include <config.h>
#include <isc/util.h>
EMPTY_TRANSLATION_UNIT

View File

@@ -1,17 +0,0 @@
# 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.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = isc
TARGETS =
@BIND9_MAKE_RULES@

View File

@@ -1,34 +0,0 @@
# 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.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
HEADERS = condition.h mutex.h once.h thread.h
SUBDIRS =
TARGETS =
@BIND9_MAKE_RULES@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/isc
install:: installdirs
for i in ${HEADERS}; do \
${INSTALL_DATA} $(srcdir)/$$i ${DESTDIR}${includedir}/isc ; \
done
uninstall::
for i in ${HEADERS}; do \
rm -f ${DESTDIR}${includedir}/isc/$$i ; \
done

View File

@@ -1,52 +0,0 @@
/*
* 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.
*/
/*
* This provides a limited subset of the isc_condition_t
* functionality for use by single-threaded programs that
* need to block waiting for events. Only a single
* call to isc_condition_wait() may be blocked at any given
* time, and the _waituntil and _broadcast functions are not
* supported. This is intended primarily for use by the omapi
* library, and may go away once omapi goes away. Use for
* other purposes is strongly discouraged.
*/
#ifndef ISC_CONDITION_H
#define ISC_CONDITION_H 1
#include <isc/mutex.h>
typedef int isc_condition_t;
isc_result_t isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp);
isc_result_t isc__nothread_signal_hack(isc_condition_t *cp);
#define isc_condition_init(cp) \
(*(cp) = 0, ISC_R_SUCCESS)
#define isc_condition_wait(cp, mp) \
isc__nothread_wait_hack(cp, mp)
#define isc_condition_waituntil(cp, mp, tp) \
((void)(cp), (void)(mp), (void)(tp), ISC_R_NOTIMPLEMENTED)
#define isc_condition_signal(cp) \
isc__nothread_signal_hack(cp)
#define isc_condition_broadcast(cp) \
((void)(cp), ISC_R_NOTIMPLEMENTED)
#define isc_condition_destroy(cp) \
(*(cp) == 0 ? (*(cp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED)
#endif /* ISC_CONDITION_H */

View File

@@ -1,31 +0,0 @@
/*
* 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.
*/
#ifndef ISC_MUTEX_H
#define ISC_MUTEX_H 1
#include <isc/result.h> /* for ISC_R_ codes */
typedef int isc_mutex_t;
#define isc_mutex_init(mp) \
(*(mp) = 0, ISC_R_SUCCESS)
#define isc_mutex_lock(mp) \
((*(mp))++ == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
#define isc_mutex_unlock(mp) \
(--(*(mp)) == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
#define isc_mutex_trylock(mp) \
(*(mp) == 0 ? ((*(mp))++, ISC_R_SUCCESS) : ISC_R_LOCKBUSY)
#define isc_mutex_destroy(mp) \
(*(mp) == 0 ? (*(mp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED)
#define isc_mutex_stats(fp)
#endif /* ISC_MUTEX_H */

View File

@@ -1,27 +0,0 @@
/*
* 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.
*/
#ifndef ISC_ONCE_H
#define ISC_ONCE_H 1
#include <stdbool.h>
#include <isc/result.h>
typedef bool isc_once_t;
#define ISC_ONCE_INIT false
#define isc_once_do(op, f) \
(!*(op) ? (f(), *(op) = true, ISC_R_SUCCESS) : ISC_R_SUCCESS)
#endif /* ISC_ONCE_H */

View File

@@ -1,40 +0,0 @@
/*
* 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.
*/
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
#include <isc/lang.h>
#include <isc/result.h>
ISC_LANG_BEGINDECLS
/* Placeholder types (they are not accessed) */
typedef void * isc_thread_t;
typedef void * isc_threadresult_t;
typedef void * isc_threadarg_t;
typedef void * isc_threadfunc_t;
typedef void * isc_thread_key_t;
void
isc_thread_setconcurrency(unsigned int level);
void
isc_thread_setname(isc_thread_t thread, const char *name);
#define isc_thread_self() ((unsigned long)0)
#define isc_thread_yield() ((void)0)
ISC_LANG_ENDDECLS
#endif /* ISC_THREAD_H */

View File

@@ -1,18 +0,0 @@
/*
* 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.
*/
#include <config.h>
#include <isc/util.h>
EMPTY_TRANSLATION_UNIT

View File

@@ -1,26 +0,0 @@
/*
* 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.
*/
#include <config.h>
#include <isc/thread.h>
#include <isc/util.h>
void
isc_thread_setconcurrency(unsigned int level) {
UNUSED(level);
}
void isc_thread_setname(isc_thread_t thread, const char *name) {
UNUSED(thread);
UNUSED(name);
}

View File

@@ -12,7 +12,7 @@ VPATH = @srcdir@
top_srcdir = @top_srcdir@
CINCLUDES = -I${srcdir}/include \
-I${srcdir}/../@ISC_THREAD_DIR@/include \
-I${srcdir}/../pthreads/include \
-I../include \
-I${srcdir}/../include \
-I${srcdir}/.. @OPENSSL_INCLUDES@