dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.612 2009/10/01 01:58:57 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.615 2009/12/02 14:07:25 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
# Enable thread-safe client libraries
#
AC_MSG_CHECKING([allow thread-safe client libraries])
-if test "$PORTNAME" != "win32"; then
-PGAC_ARG_BOOL(enable, thread-safety, no, [make client libraries thread-safe])
-else
-# Win32 should always use threads
-PGAC_ARG_BOOL(enable, thread-safety, yes, [make client libraries thread-safe])
-fi
-
-PGAC_ARG_BOOL(enable, thread-safety-force, no, [force thread-safety despite thread test failure])
-if test "$enable_thread_safety" = yes -o \
- "$enable_thread_safety_force" = yes; then
- enable_thread_safety="yes" # for 'force'
- AC_DEFINE([ENABLE_THREAD_SAFETY], 1,
- [Define to 1 to build client libraries as thread-safe code. (--enable-thread-safety)])
-fi
+PGAC_ARG_BOOL(enable, thread-safety, yes, [disable thread-safety in client libraries])
AC_MSG_RESULT([$enable_thread_safety])
AC_SUBST(enable_thread_safety)
if test "$PTHREAD_CC" != "$CC"; then
AC_MSG_ERROR([
PostgreSQL does not support platforms that require a special compiler
-for thread safety.])
-fi
-
-if test "$THREAD_SUPPORT" = no; then
-AC_MSG_ERROR([cannot enable threads on this platform
-This platform is known to not support thread-safe programs. For details,
-compile and run src/bin/pg_thread_test.])
+for thread safety; use --disable-thread-safety to disable thread safety.])
fi
# Check for *_r functions
LIBS="$LIBS $PTHREAD_LIBS"
if test "$PORTNAME" != "win32"; then
-AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --enable-thread-safety])])
+AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([
+pthread.h not found; use --disable-thread-safety to disable thread safety])])
fi
AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r])
if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
AC_MSG_ERROR([
Thread-safety requires POSIX signals, which are not supported by this
-operating system.])
+operating system; use --disable-thread-safety to disable thread safety.])
fi
fi
# We have to run the thread test near the end so we have all our symbols
# defined. Cross compiling throws a warning.
#
-if test "$enable_thread_safety_force" = yes; then
-if test "$PORTNAME" != "win32"
-then
- AC_MSG_WARN([
-*** Skipping thread test program. --enable-thread-safety-force was used.
-*** Run the program in src/test/thread on the your machine and add proper
-*** locking function calls to your applications to guarantee thread safety.
-])
-else
-AC_MSG_WARN([*** skipping thread test on Win32])
-fi
-elif test "$enable_thread_safety" = yes; then
+if test "$enable_thread_safety" = yes; then
if test "$PORTNAME" != "win32"
then
AC_MSG_CHECKING([thread safety of required library functions])
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_ERROR([thread test program failed
-This platform is not thread-safe. Check the file 'config.log' for the
-exact reason.
-
-You can use the configure option --enable-thread-safety-force to force
-threads to be enabled. But you must then run the program in
-src/test/thread and add locking function calls to your applications to
-guarantee thread safety.])],
+This platform is not thread-safe. Check the file 'config.log' or compile
+and run src/test/thread/thread_test for the exact reason.
+Use --disable-thread-safety to disable thread safety.])],
[AC_MSG_RESULT(maybe)
AC_MSG_WARN([
*** Skipping thread test program because of cross-compile build.