Move thread os defines into template files.
authorBruce Momjian <bruce@momjian.us>
Sat, 14 Jun 2003 19:21:42 +0000 (19:21 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 14 Jun 2003 19:21:42 +0000 (19:21 +0000)
configure
configure.in
src/template/bsdi
src/template/freebsd
src/template/linux
src/template/netbsd

index e7cc47661402747a93bc753390f70b989db40b84..8cbc95fe116f663f7c017607b99e1edf111ab4eb 100755 (executable)
--- a/configure
+++ b/configure
@@ -3903,41 +3903,24 @@ echo "$as_me: error: pthread.h not found, required for --with-threads" >&2;}
 fi
 
 
-case $host_os in
-       netbsd*|bsdi*)
-           # these require no special flags or libraries
-           NEED_REENTRANT_FUNC_NAMES=no
-           ;;
-       freebsd2*|freebsd3*|freebsd4*)
-           THREAD_CFLAGS="-pthread"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       freebsd*)
-           THREAD_LIBS="-lc_r"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       linux*) THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
-           THREAD_LIBS="-lpthread"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       *)
-           # other operating systems might fail because they have pthread.h but need
-           # special libs we don't know about yet.
-           { { echo "$as_me:$LINENO: error:
+
+if test "$SUPPORTS_THREADS" != yes; then
+{ { echo "$as_me:$LINENO: 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.
+so it can be added to the next release.  Report any compile flags, link flags,
+functions, or libraries required for threading support.
 " >&5
 echo "$as_me: 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.
+so it can be added to the next release.  Report any compile flags, link flags,
+functions, or libraries required for threading support.
 " >&2;}
    { (exit 1); exit 1; }; }
-esac
 fi
+fi
+
 
 
 
index a5b7108db95b7738c41cf29c8c70c9da3b713206..9ae42b36e418464a7d7144f82bf1143588bf3422 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.263 2003/06/14 17:49:53 momjian Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.264 2003/06/14 19:21:42 momjian Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -560,37 +560,20 @@ AC_SUBST(ELF_SYS)
 NEED_REENTRANT_FUNC_NAMES=no
 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
-           NEED_REENTRANT_FUNC_NAMES=no
-           ;;
-       freebsd2*|freebsd3*|freebsd4*)
-           THREAD_CFLAGS="-pthread"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       freebsd*)
-           THREAD_LIBS="-lc_r"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       linux*) THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
-           THREAD_LIBS="-lpthread"
-           NEED_REENTRANT_FUNC_NAMES=yes
-           ;;
-       *)
-           # other operating systems might fail because they have pthread.h but need
-           # special libs we don't know about yet.
-           AC_MSG_ERROR([
+
+if test "$SUPPORTS_THREADS" != yes; then
+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.
+so it can be added to the next release.  Report any compile flags, link flags,
+functions, or libraries required for threading support.
 ])
-esac
+fi
 fi
 AC_SUBST(THREAD_CFLAGS)
 AC_SUBST(THREAD_LIBS)
 
+
 #
 # Assignments
 #
index 967d055a54f9c9968ec1d45c0aa9defe2f8b22ee..ec73bc60d072fb2a7de00b17f995c7b5317811e0 100644 (file)
@@ -9,3 +9,7 @@ case $host_os in
     CC=gcc2
     ;;
 esac
+
+SUPPORTS_THREADS=yes
+NEED_REENTRANT_FUNC_NAMES=no
+
index 89958c28b73a42006bfe7e27264908c5e42676c2..f35b76a99930b4b841bb533a129e4f8e968b023c 100644 (file)
@@ -3,3 +3,15 @@ CFLAGS='-pipe'
 case $host_cpu in
   alpha*)   CFLAGS="$CFLAGS -O" ;;
 esac
+
+SUPPORTS_THREADS=yes
+case $host_os in
+       freebsd2*|freebsd3*|freebsd4*)
+           THREAD_CFLAGS="-pthread"
+           NEED_REENTRANT_FUNC_NAMES=yes
+           ;;
+       *)
+           THREAD_LIBS="-lc_r"
+           NEED_REENTRANT_FUNC_NAMES=yes
+           ;;
+esac
index 64f27c68cabb2b5d97d9bd6a58ea7ead961373f8..fc5c874d844d495f6befa06b9d98bdf59abd4d7c 100644 (file)
@@ -1 +1,7 @@
 CFLAGS=-O2
+
+SUPPORTS_THREADS=yes
+THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
+THREAD_LIBS="-lpthread"
+NEED_REENTRANT_FUNC_NAMES=yes
+
index bfbcbdd59755014424118ae8abec0bfcb1abe81d..c18fccb9bea2e7f006d060bb205e76fecf83541f 100644 (file)
@@ -1 +1,5 @@
 CFLAGS='-O2 -pipe'
+
+SUPPORTS_THREADS=yes
+NEED_REENTRANT_FUNC_NAMES=no
+