Commit ffa3bfbc authored by Bruce Momjian's avatar Bruce Momjian

Move thread os defines into template files.

parent 467839df
...@@ -3903,41 +3903,24 @@ echo "$as_me: error: pthread.h not found, required for --with-threads" >&2;} ...@@ -3903,41 +3903,24 @@ echo "$as_me: error: pthread.h not found, required for --with-threads" >&2;}
fi fi
case $host_os in
netbsd*|bsdi*) if test "$SUPPORTS_THREADS" != yes; then
# these require no special flags or libraries { { echo "$as_me:$LINENO: error:
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:
Cannot enable threads on your platform. Cannot enable threads on your platform.
Please report your platform threading info to the PostgreSQL mailing lists 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, so it can be added to the next release. Report any compile flags, link flags,
or libraries required for threading support. functions, or libraries required for threading support.
" >&5 " >&5
echo "$as_me: error: echo "$as_me: error:
Cannot enable threads on your platform. Cannot enable threads on your platform.
Please report your platform threading info to the PostgreSQL mailing lists 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, so it can be added to the next release. Report any compile flags, link flags,
or libraries required for threading support. functions, or libraries required for threading support.
" >&2;} " >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
esac
fi fi
fi
......
dnl Process this file with autoconf to produce a configure script. 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
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -560,37 +560,20 @@ AC_SUBST(ELF_SYS) ...@@ -560,37 +560,20 @@ AC_SUBST(ELF_SYS)
NEED_REENTRANT_FUNC_NAMES=no NEED_REENTRANT_FUNC_NAMES=no
if test "$with_threads" = yes; then if test "$with_threads" = yes; then
AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --with-threads])]) AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --with-threads])])
case $host_os in
netbsd*|bsdi*) if test "$SUPPORTS_THREADS" != yes; then
# these require no special flags or libraries AC_MSG_ERROR([
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([
Cannot enable threads on your platform. Cannot enable threads on your platform.
Please report your platform threading info to the PostgreSQL mailing lists 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, so it can be added to the next release. Report any compile flags, link flags,
or libraries required for threading support. functions, or libraries required for threading support.
]) ])
esac fi
fi fi
AC_SUBST(THREAD_CFLAGS) AC_SUBST(THREAD_CFLAGS)
AC_SUBST(THREAD_LIBS) AC_SUBST(THREAD_LIBS)
# #
# Assignments # Assignments
# #
......
...@@ -9,3 +9,7 @@ case $host_os in ...@@ -9,3 +9,7 @@ case $host_os in
CC=gcc2 CC=gcc2
;; ;;
esac esac
SUPPORTS_THREADS=yes
NEED_REENTRANT_FUNC_NAMES=no
...@@ -3,3 +3,15 @@ CFLAGS='-pipe' ...@@ -3,3 +3,15 @@ CFLAGS='-pipe'
case $host_cpu in case $host_cpu in
alpha*) CFLAGS="$CFLAGS -O" ;; alpha*) CFLAGS="$CFLAGS -O" ;;
esac 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
CFLAGS=-O2 CFLAGS=-O2
SUPPORTS_THREADS=yes
THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-lpthread"
NEED_REENTRANT_FUNC_NAMES=yes
CFLAGS='-O2 -pipe' CFLAGS='-O2 -pipe'
SUPPORTS_THREADS=yes
NEED_REENTRANT_FUNC_NAMES=no
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment