Commit 30a06fe2 authored by Bruce Momjian's avatar Bruce Momjian

Unconditionally define:

	-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS

for all ports.  It can't hurt if they are not supported, but it makes
our job easier for porting.

Should fix Darwin compile and other platforms without mucking with the
thread detection code.
parent f5b6ce7c
dnl PGSGL: When updating, comment out port-specific part below;
dnl see the comment below with the word "PostgreSQL".
dnl
dnl Available from the GNU Autoconf Macro Archive at: dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
dnl dnl
...@@ -165,10 +168,11 @@ if test "x$acx_pthread_ok" = xyes; then ...@@ -165,10 +168,11 @@ if test "x$acx_pthread_ok" = xyes; then
AC_MSG_CHECKING([if more special flags are required for pthreads]) AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no flag=no
case "${host_cpu}-${host_os}" in # We handle this ourselves in PostgreSQL
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; # case "${host_cpu}-${host_os}" in
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; # *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
esac # *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
# esac
AC_MSG_RESULT(${flag}) AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
......
...@@ -13387,10 +13387,11 @@ echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;} ...@@ -13387,10 +13387,11 @@ echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;}
echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6 echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
flag=no flag=no
case "${host_cpu}-${host_os}" in # We handle this ourselves in PostgreSQL
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; # case "${host_cpu}-${host_os}" in
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; # *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
esac # *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
# esac
echo "$as_me:$LINENO: result: ${flag}" >&5 echo "$as_me:$LINENO: result: ${flag}" >&5
echo "${ECHO_T}${flag}" >&6 echo "${ECHO_T}${flag}" >&6
if test "x$flag" != xno; then if test "x$flag" != xno; then
...@@ -13465,6 +13466,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ...@@ -13465,6 +13466,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# set thread flags # set thread flags
# Some platforms use these, so just defineed them. They can't hurt if they
# are not supported.
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
# At this point, we don't want to muck with the compiler name for threading. # At this point, we don't want to muck with the compiler name for threading.
# Let's see who fails, perhaps AIX. 2004-04-23 # Let's see who fails, perhaps AIX. 2004-04-23
if test "$PTHREAD_CC" != "$CC"; then if test "$PTHREAD_CC" != "$CC"; then
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.333 2004/04/26 00:44:39 momjian Exp $ dnl $PostgreSQL: pgsql/configure.in,v 1.334 2004/04/26 04:04:42 momjian Exp $
dnl dnl
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -959,6 +959,11 @@ AC_FUNC_FSEEKO ...@@ -959,6 +959,11 @@ AC_FUNC_FSEEKO
if test "$enable_thread_safety" = yes; then if test "$enable_thread_safety" = yes; then
ACX_PTHREAD # set thread flags ACX_PTHREAD # set thread flags
# Some platforms use these, so just defineed them. They can't hurt if they
# are not supported.
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
# At this point, we don't want to muck with the compiler name for threading. # At this point, we don't want to muck with the compiler name for threading.
# Let's see who fails, perhaps AIX. 2004-04-23 # Let's see who fails, perhaps AIX. 2004-04-23
if test "$PTHREAD_CC" != "$CC"; then if test "$PTHREAD_CC" != "$CC"; then
......
...@@ -4,6 +4,3 @@ CC="$CC -no-cpp-precomp" ...@@ -4,6 +4,3 @@ CC="$CC -no-cpp-precomp"
# Select appropriate semaphore support # Select appropriate semaphore support
USE_NAMED_POSIX_SEMAPHORES=1 USE_NAMED_POSIX_SEMAPHORES=1
# verified Mac OS X 10.3.3, Darwin Kernel Version 7.3.0, 2004-04-07
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
case $host_cpu in case $host_cpu in
alpha*) CFLAGS="-O";; # alpha has problems with -O2 alpha*) CFLAGS="-O";; # alpha has problems with -O2
esac esac
case $host_os in
freebsd2*|freebsd3*|freebsd4*) ;;
*) PTHREAD_LIBS="c_r";; # do we need this? 2004-04-23
esac
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
CPPFLAGS="-D_GNU_SOURCE" CPPFLAGS="-D_GNU_SOURCE"
# tools/thread/thread_test must be run
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
...@@ -10,4 +10,3 @@ case $host in ...@@ -10,4 +10,3 @@ case $host in
esac esac
# -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other things # -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other things
PTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
...@@ -24,8 +24,5 @@ __EOF__ ...@@ -24,8 +24,5 @@ __EOF__
PTHREAD_CFLAGS="-Kpthread" PTHREAD_CFLAGS="-Kpthread"
fi fi
# tools/thread/thread_test must be run
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT"
# Disabled because flags are required for all apps using libpq. # Disabled because flags are required for all apps using libpq.
# Waiting to see if other platforms need this too. 2004-03-22 # Waiting to see if other platforms need this too. 2004-03-22
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