Commit 9ceaa92a authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

--enable-threads default value should not override user-specified value

parent 892abf31
This diff is collapsed.
......@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.179 $)
AC_REVISION($Revision: 1.180 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
......@@ -129,19 +129,18 @@ esac
#
# Decide whether to use multithreading or not.
#
enable_threads=yes
AC_MSG_CHECKING(whether to use threads)
AC_ARG_ENABLE(threads,
[ --enable-threads use multithreading])
case "$enable_threads" in
yes)
yes|'')
AC_MSG_RESULT(yes)
ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1" ;;
no)
AC_MSG_RESULT(no)
ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS" ;;
*)
AC_MSG_ERROR("--enable-threads take yes or no") ;;
AC_MSG_ERROR(["--enable-threads takes yes or no"]) ;;
esac
AC_SUBST(ISC_PLATFORM_USETHREADS)
......@@ -311,17 +310,33 @@ case "$use_randomdev" in
;;
esac
AC_PROG_CC
AC_PROG_YACC
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h)
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
if "$enable_threads" = "yes"
then
#
# NetBSD has multiple pthreads implementations. The recommended
# one to use is "unproven-pthreads". The older "mit-pthreads"
# may also work on some NetBSD versions. The PTL2 thread
# library does not currently work with bind9, but can be
# chosen with the --with-ptl2 option for those who wish to
# experiment with it.
# Search for / configure pthreads in a system-dependent fashion.
#
case "$host" in
*-netbsd*)
#
# NetBSD has multiple pthreads implementations. The recommended
# one to use is "unproven-pthreads". The older "mit-pthreads"
# may also work on some NetBSD versions. The PTL2 thread
# library does not currently work with bind9, but can be
# chosen with the --with-ptl2 option for those who wish to
# experiment with it.
#
CC="gcc"
AC_MSG_CHECKING(which NetBSD thread library to use)
......@@ -356,28 +371,11 @@ Please install the devel/unproven-pthreads package and rerun configure.
STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
fi
;;
esac
AC_PROG_CC
AC_PROG_YACC
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h)
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
case "$host" in
*-netbsd*)
;;
*)
AC_CHECK_LIB(pthread, pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create)
AC_CHECK_LIB(pthread, __pthread_create_system))
;;
;;
esac
#
......@@ -436,6 +434,54 @@ esac
#
AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
if test "X$GCC" = "Xyes"; then
case "$host" in
*-freebsd*)
CC="$CC -pthread"
CCOPT="$CCOPT -pthread"
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
*-openbsd*)
CC="$CC -pthread"
CCOPT="$CCOPT -pthread"
;;
*-solaris*)
LIBS="$LIBS -lthread"
;;
*-ibm-aix*)
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
esac
else
case $host in
*-dec-osf*)
CC="$CC -std -pthread"
CCOPT="$CCOPT -std -pthread"
MKDEPCC="$CC"
;;
*-solaris*)
CC="$CC -mt"
CCOPT="$CCOPT -mt"
;;
*-hp-hpux*)
CC="$CC -Ae -z +w1"
CCOPT="CCOPT -Ae -z"
;;
*-ibm-aix*)
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
*-UnixWare*)
CC="$CC -Kthread -w"
CCOPT="$CCOPT -Kthread"
;;
esac
fi
fi
#
# End of pthreads stuff.
#
#
# NLS
#
......@@ -465,39 +511,13 @@ MKDEPCFLAGS="-M"
IRIX_DNSSEC_WARNINGS_HACK=""
if test "X$GCC" = "Xyes"; then
STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings"
case "$host" in
*-freebsd*)
CC="$CC -pthread"
CCOPT="$CCOPT -pthread"
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
*-openbsd*)
CC="$CC -pthread"
CCOPT="$CCOPT -pthread"
;;
*-solaris*)
LIBS="$LIBS -lthread"
;;
*-ibm-aix*)
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
esac
else
case "$host" in
*-dec-osf*)
CC="$CC -std -pthread"
CCOPT="$CCOPT -std -pthread"
MKDEPCC="$CC"
;;
*-solaris*)
CC="$CC -mt"
CCOPT="$CCOPT -mt"
MKDEPCC="$CC"
MKDEPCFLAGS="-xM"
;;
*-hp-hpux*)
CC="$CC -Ae -z +w1"
CCOPT="CCOPT -Ae -z"
*-hp-hpux*)
LIBS="-Wl,+vnocompatwarnings $LIBS"
MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
;;
......@@ -512,12 +532,7 @@ else
#
IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
;;
*-ibm-aix*)
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
;;
*-UnixWare*)
CC="$CC -Kthread -w"
CCOPT="$CCOPT -Kthread"
MKDEPCC="$CC"
YACC="yacc" # bison calls alloca, avoid on UnixWare
;;
......
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