diff options
| author | Bruce Momjian <bruce@momjian.us> | 2003-05-27 16:36:50 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2003-05-27 16:36:50 +0000 |
| commit | 24daeb8e73f924df26a38185296d5a6a6c49acb1 (patch) | |
| tree | 24eb4be87f93a7070cbb4b43175d10083ffd0b67 /configure.in | |
| parent | e185583a379dca39434fd96cfb6a659637d8e565 (diff) | |
| download | postgresql-24daeb8e73f924df26a38185296d5a6a6c49acb1.tar.gz | |
Add configure thread tests.
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 29 |
1 files changed, 28 insertions, 1 deletions
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" |
