summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-06-13 23:10:08 +0000
committerBruce Momjian <bruce@momjian.us>2003-06-13 23:10:08 +0000
commit02d847fe9f86b0c6ff4658eb9d49fbb98c8fa69a (patch)
treecafe975dd792471ada4a62b2c6dfd7abcf40a69d /configure.in
parent26188e8c1751a2ef97fb6192fbc1bbc9f313a4d6 (diff)
downloadpostgresql-02d847fe9f86b0c6ff4658eb9d49fbb98c8fa69a.tar.gz
Add --with-threads configure option to control threaded libpq.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in35
1 files changed, 24 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index 46647f11e1..f323dc767f 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.260 2003/06/12 16:05:09 tgl Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.261 2003/06/13 23:10:07 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -320,6 +320,14 @@ done
IFS=$ac_save_IFS
#
+# Enable libpq to be thread-safe
+#
+AC_MSG_CHECKING([allow threaded libpq])
+PGAC_ARG_BOOL(with, threads, no, [ --with-threads allow libpq to be thread-safe])
+AC_MSG_RESULT([$with_threads])
+AC_SUBST(with_threads)
+
+#
# Tcl/Tk
#
AC_MSG_CHECKING([whether to build with Tcl])
@@ -544,20 +552,25 @@ 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*) ;;
+if test "$with_threads" = yes; then
+AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --with-threads])])
+case $host_os in
+ netbsd*|bsdi*)
+ # these require no special flags or libraries
+ ;;
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.
+ *)
+ # other operating systems might fail because they have pthread.h but need
+ # special libs we don't know about yet.
+ AC_MSG_ERROR([
+Cannot enable threads on your platform.
+Please report your platform threading info to the PostgreSQL mailing lists
+so it can be added to the next release. Report any compile or link flags,
+or libraries required for threading support.
+])
esac
fi
AC_SUBST(THREAD_LIBS)