From 24daeb8e73f924df26a38185296d5a6a6c49acb1 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 27 May 2003 16:36:50 +0000 Subject: Add configure thread tests. --- configure.in | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 2e0a7c8b32..aece9bd6c7 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ 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" -- cgit v1.2.1