Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 30a06fe

Browse files
committed
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.
1 parent f5b6ce7 commit 30a06fe

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

config/acx_pthread.m4

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
dnl PGSGL: When updating, comment out port-specific part below;
2+
dnl see the comment below with the word "PostgreSQL".
3+
dnl
14
dnl Available from the GNU Autoconf Macro Archive at:
25
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
36
dnl
@@ -165,10 +168,11 @@ if test "x$acx_pthread_ok" = xyes; then
165168
166169
AC_MSG_CHECKING([if more special flags are required for pthreads])
167170
flag=no
168-
case "${host_cpu}-${host_os}" in
169-
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
170-
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
171-
esac
171+
# We handle this ourselves in PostgreSQL
172+
# case "${host_cpu}-${host_os}" in
173+
# *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
174+
# *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
175+
# esac
172176
AC_MSG_RESULT(${flag})
173177
if test "x$flag" != xno; then
174178
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"

configure

+10-4
Original file line numberDiff line numberDiff line change
@@ -13387,10 +13387,11 @@ echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;}
1338713387
echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
1338813388
echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
1338913389
flag=no
13390-
case "${host_cpu}-${host_os}" in
13391-
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
13392-
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
13393-
esac
13390+
# We handle this ourselves in PostgreSQL
13391+
# case "${host_cpu}-${host_os}" in
13392+
# *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
13393+
# *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
13394+
# esac
1339413395
echo "$as_me:$LINENO: result: ${flag}" >&5
1339513396
echo "${ECHO_T}${flag}" >&6
1339613397
if test "x$flag" != xno; then
@@ -13465,6 +13466,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1346513466

1346613467
# set thread flags
1346713468

13469+
# Some platforms use these, so just defineed them. They can't hurt if they
13470+
# are not supported.
13471+
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
13472+
13473+
1346813474
# At this point, we don't want to muck with the compiler name for threading.
1346913475
# Let's see who fails, perhaps AIX. 2004-04-23
1347013476
if test "$PTHREAD_CC" != "$CC"; then

configure.in

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.333 2004/04/26 00:44:39 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.334 2004/04/26 04:04:42 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -959,6 +959,11 @@ AC_FUNC_FSEEKO
959959
if test "$enable_thread_safety" = yes; then
960960
ACX_PTHREAD # set thread flags
961961

962+
# Some platforms use these, so just defineed them. They can't hurt if they
963+
# are not supported.
964+
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
965+
966+
962967
# At this point, we don't want to muck with the compiler name for threading.
963968
# Let's see who fails, perhaps AIX. 2004-04-23
964969
if test "$PTHREAD_CC" != "$CC"; then

src/template/darwin

-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ CC="$CC -no-cpp-precomp"
44

55
# Select appropriate semaphore support
66
USE_NAMED_POSIX_SEMAPHORES=1
7-
8-
# verified Mac OS X 10.3.3, Darwin Kernel Version 7.3.0, 2004-04-07
9-
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"

src/template/freebsd

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
case $host_cpu in
22
alpha*) CFLAGS="-O";; # alpha has problems with -O2
33
esac
4-
5-
case $host_os in
6-
freebsd2*|freebsd3*|freebsd4*) ;;
7-
*) PTHREAD_LIBS="c_r";; # do we need this? 2004-04-23
8-
esac

src/template/linux

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
22
CPPFLAGS="-D_GNU_SOURCE"
3-
4-
# tools/thread/thread_test must be run
5-
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"

src/template/solaris

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ case $host in
1010
esac
1111

1212
# -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other things
13-
PTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"

src/template/unixware

-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@ __EOF__
2424
PTHREAD_CFLAGS="-Kpthread"
2525
fi
2626

27-
# tools/thread/thread_test must be run
28-
PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT"
29-
3027
# Disabled because flags are required for all apps using libpq.
3128
# Waiting to see if other platforms need this too. 2004-03-22

0 commit comments

Comments
 (0)