Commit 24daeb8e authored by Bruce Momjian's avatar Bruce Momjian

Add configure thread tests.

parent e185583a
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.253 2003/05/22 16:39:28 tgl Exp $
dnl $Header: /cvsroot/pgsql/configure.in,v 1.254 2003/05/27 16:36:50 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
......@@ -506,6 +506,9 @@ PGAC_ARG_BOOL(with, zlib, yes,
[ --without-zlib do not use Zlib])
#
# Elf
#
# Assume system is ELF if it predefines __ELF__ as 1,
# otherwise believe host_os based default.
......@@ -527,7 +530,31 @@ else
fi])
AC_SUBST(ELF_SYS)
#
# Pthreads
#
AC_CHECK_HEADER(pthread.h,
[AC_DEFINE(HAVE_THREADS, 1, [Define to 1 if you have the threads interface.])])
if test ! -z "$HAVE_THREADS"
then
case $host_os in
# BSD/OS and NetBSD require no special libraries or flags
netbsd*|bsdi*) ;;
freebsd2*|freebsd3*|freebsd4*) THREAD_CFLAGS="-pthread" ;;
freebsd*) THREAD_LIBS="-lc_r" ;;
linux*) THREAD_LIBS="-lpthread"
THREAD_CFLAGS="-D_REENTRANT" ;;
# other operating systems might fail because they have pthread.h but need
# special libs we don't know about yet.
esac
fi
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)
#
# Assignments
#
CPPFLAGS="$CPPFLAGS $INCLUDES"
LDFLAGS="$LDFLAGS $LIBDIRS"
......
# -*-makefile-*-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.162 2003/05/11 20:50:53 tgl Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.163 2003/05/27 16:36:50 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
......@@ -152,6 +152,9 @@ TK_LIBS = @TK_LIBS@
TK_LIB_SPEC = @TK_LIB_SPEC@
TK_XINCLUDES = @TK_XINCLUDES@
THREAD_CFLAGS = @THREAD_CFLAGS@
THREAD_LIBS = @THREAD_LIBS@
have_docbook = @have_docbook@
DOCBOOKSTYLE = @DOCBOOKSTYLE@
COLLATEINDEX = @COLLATEINDEX@
......
......@@ -465,6 +465,9 @@
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the threads interface. */
#undef HAVE_THREADS
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#undef HAVE_TM_ZONE
......
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