Finalize configuration of thread_test program.
authorBruce Momjian <bruce@momjian.us>
Sat, 27 Sep 2003 16:24:45 +0000 (16:24 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 27 Sep 2003 16:24:45 +0000 (16:24 +0000)
13 files changed:
configure
configure.in
src/Makefile.global.in
src/template/bsdi
src/template/freebsd
src/template/linux
src/template/netbsd
src/template/osf
src/template/solaris
src/template/unixware
src/tools/thread/Makefile
src/tools/thread/README
src/tools/thread/thread_test.c

index 1e842aeb60402986f5452f7522487b6069c78cc9..999bfaed7c5eb1a5977992e2c998a2ac691d96d8 100755 (executable)
--- a/configure
+++ b/configure
@@ -13273,7 +13273,7 @@ fi
 
 
 
-if test "$SUPPORTS_THREADS" != yes; then
+if test "$THREAD_SUPPORT" != yes; then
 { { echo "$as_me:$LINENO: error:
 Cannot enable threads on your platform.
 Please report your platform threading info to the PostgreSQL mailing lists
@@ -13299,6 +13299,7 @@ fi
 
 
 
+
 #
 # Check for re-entrant versions of certain functions
 #
@@ -18211,6 +18212,7 @@ s,@python_includespec@,$python_includespec,;t t
 s,@python_libspec@,$python_libspec,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@HAVE_IPV6@,$HAVE_IPV6,;t t
+s,@THREAD_SUPPORT@,$THREAD_SUPPORT,;t t
 s,@THREAD_CPPFLAGS@,$THREAD_CPPFLAGS,;t t
 s,@THREAD_LIBS@,$THREAD_LIBS,;t t
 s,@HAVE_POSIX_SIGNALS@,$HAVE_POSIX_SIGNALS,;t t
index a3b67addc325c894fb40dc547b72e97410edeb1c..aedfeced7f46b943221e5eca04076d52b4b233e2 100644 (file)
@@ -1,4 +1,4 @@
-\dnl Process this file with autoconf to produce a configure script.
+dnl Process this file with autoconf to produce a configure script.
 dnl $Header$
 dnl
 dnl Developers, please strive to achieve this order:
@@ -1002,7 +1002,7 @@ AC_FUNC_FSEEKO
 if test "$enable_thread_safety" = yes; then
 AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --enable-thread-safetys])])
 
-if test "$SUPPORTS_THREADS" != yes; then
+if test "$THREAD_SUPPORT" != yes; then
 AC_MSG_ERROR([
 Cannot enable threads on your platform.
 Please report your platform threading info to the PostgreSQL mailing lists
@@ -1016,6 +1016,7 @@ else
 THREAD_CPPFLAGS=
 THREAD_LIBS=
 fi
+AC_SUBST(THREAD_SUPPORT)
 AC_SUBST(THREAD_CPPFLAGS)
 AC_SUBST(THREAD_LIBS)
 
index 42395a29d03b7a1466c05945bbea2536d00ae2e7..80a4153a134785c4435dfb61344a5da6ea140c65 100644 (file)
@@ -150,6 +150,7 @@ TK_LIBS                     = @TK_LIBS@
 TK_LIB_SPEC            = @TK_LIB_SPEC@
 TK_XINCLUDES           = @TK_XINCLUDES@
 
+THREAD_SUPPORT         = @THREAD_SUPPORT@
 THREAD_CPPFLAGS                = @THREAD_CPPFLAGS@
 THREAD_LIBS            = @THREAD_LIBS@
 
index a5996a5402d2e2f24f5fca2433f38879f03b9078..acb2c42d3c9a75646bfec88c6366c1a30e12ca5b 100644 (file)
@@ -10,5 +10,5 @@ case $host_os in
     ;;
 esac
 
-SUPPORTS_THREADS=yes
+THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=no                # verified 4.3 2003-09-26
index 0711a83212c14ff5e62484828a9fda0d6e9bde90..082afc077b29646946eb7aca0affc25682db9792 100644 (file)
@@ -4,9 +4,8 @@ case $host_cpu in
   alpha*)   CFLAGS="$CFLAGS -O" ;;
 esac
 
-SUPPORTS_THREADS=yes
-NEED_REENTRANT_FUNCS=yes       # 4.8, 5.1  2003-09-12
-
+THREAD_SUPPORT=yes
+NEED_REENTRANT_FUNCS=yes
 THREAD_CPPFLAGS="-D_THREAD_SAFE"
 case $host_os in
                freebsd2*|freebsd3*|freebsd4*)
index a690b44968cf4155f009992a0097d1f0101f632a..2a3209ccb07cc65a335f9f86c51006bcb1929cb7 100644 (file)
@@ -2,8 +2,8 @@ CFLAGS=-O2
 # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
 CPPFLAGS="-D_GNU_SOURCE"
 
-SUPPORTS_THREADS=yes
-NEED_REENTRANT_FUNCS=yes       # verified glibc 2.1 2003-09-03
+THREAD_SUPPORT=yes
+NEED_REENTRANT_FUNCS=yes
 THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
 THREAD_LIBS="-lpthread"
 
index 0fd61a70b286383932e743188fcf4fae3d2a1c60..f510dc9ef0c47305e2921d36b017296b9d45480d 100644 (file)
@@ -1,4 +1,4 @@
 CFLAGS='-O2 -pipe'
 
-SUPPORTS_THREADS=yes
+THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes       # 1.6 2003-09-14
index 0856f5c898170084d11f69ee135f36656940e26e..b5c60413de88b39641489a9337625e679ff79a77 100644 (file)
@@ -5,6 +5,6 @@ else
   CFLAGS='-O4 -Olimit 2000'
 fi
 
-SUPPORTS_THREADS=yes
+THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=no                # 4.0 2003-09-13
 THREAD_LIBS="-pthread"
index b333f006602e5f407e71a527872d1b35ce83b119..083b1d3659fa37ea8982a9dd1d555e01d5ecab5b 100644 (file)
@@ -5,7 +5,7 @@ else
   CFLAGS=-v                    # -v is like gcc -Wall
 fi
 
-SUPPORTS_THREADS=yes
+THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes       # 5.6 2003-09-13
 THREAD_LIBS="-pthread"
 
index a228fa56ef82bf59f84cfd36012447e276fd0981..e1991bcc9c8ad682778be843ad33faa50af8c1f2 100644 (file)
@@ -9,6 +9,6 @@ else
   THREAD_CPPFLAGS="-K pthread"
 fi
 
-SUPPORTS_THREADS=yes
+THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=no                # verified 7.1.3 2003-09-03
 THREAD_CPPFLAGS="$THREAD_CPPFLAGS -D_REENTRANT"
index 61665ae0e9dab28765f1031908ff52e2d7bc397c..ac253e680ccf4c3fda343a803bb8417760aefde9 100644 (file)
@@ -12,6 +12,13 @@ subdir = tools/thread
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
+ifeq ($(THREAD_SUPPORT), no)
+$(error Your platform does not support threads)
+endif
+ifeq ($(THREAD_SUPPORT), )
+$(error You have not configured your template/$$port file.  See the README)
+endif
+
 override CFLAGS += $(THREAD_CPPFLAGS)
 
 LDFLAGS += $(THREAD_LIBS)
index f17e59248fdacf90bcb7924c2cbd17ed322041cb..ac8133c108857f011dd8f1e7b29486e2a8290715 100644 (file)
@@ -4,5 +4,10 @@ new platforms.
 Run thread_test program to determine if your native libc functions are
 thread-safe, or if we should use *_r functions or thread locking.
 
-Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'
-defines to your template/${port} file before compiling this program.
+To use this program, you must:
+
+       o add "THREAD_SUPPORT=yes" to your template/${port} file 
+       o add any THREAD_CPPFLAGS and THREAD_LIBS defines to your
+         template/${port} file
+       o run "configure --enable-thread-safety"
+       o compile and run this program
index b152162fd4b975a4cd9060f3e6916b21e151aa84..455eecc5392e0c8ad77efcac42ff7fce78661e2d 100644 (file)
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
 
        printf("\
 Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'\n\
-defines to your template/${port} file before compiling this program.\n\n"
+defines to your template/$port file before compiling this program.\n\n"
 );
        pthread_create(&thread1, NULL, (void * (*)(void *)) func_call_1, NULL);
        pthread_create(&thread2, NULL, (void * (*)(void *)) func_call_2, NULL);
@@ -82,20 +82,14 @@ defines to your template/${port} file before compiling this program.\n\n"
                strerror_p1 != strerror_p2)
        {
                printf("All your non-*_r functions are thread-safe.\n");
-               printf("Add this to your template/${port} file:\n\n");
-               printf("\
-SUPPORTS_THREADS=yes\n\
-NEED_REENTRANT_FUNCS=no\n"
-                         );
+               printf("Add this to your template/$port file:\n\n");
+               printf("NEED_REENTRANT_FUNCS=no\n");
        }
        else
        {
                printf("Not all non-*_r functions are thread-safe.\n");
-               printf("Add this to your template/${port} file:\n\n");
-               printf("\
-SUPPORTS_THREADS=yes\n\
-NEED_REENTRANT_FUNCS=yes\n"
-                         );
+               printf("Add this to your template/$port file:\n\n");
+               printf("NEED_REENTRANT_FUNCS=yes\n");
        }
 
        return 0;