summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-04-23 18:15:55 +0000
committerBruce Momjian <bruce@momjian.us>2004-04-23 18:15:55 +0000
commit7a66015e98e890c27e3483a413d5a88927c5b818 (patch)
tree3a58d7f41460697adb2eb1e24ba9e1d1c5dcfb03 /src
parent77528c9bd7e0203d5670a550947cfa367ac51ad8 (diff)
Add new auto-detection of thread flags.
Allow additional thread flags to be added via port templates. Change thread flag names to PTHREAD_CFLAGS and PTHREAD_LIBS to match new configure script.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in7
-rw-r--r--src/include/pg_config.h.in16
-rw-r--r--src/interfaces/ecpg/compatlib/Makefile6
-rw-r--r--src/interfaces/ecpg/ecpglib/Makefile6
-rw-r--r--src/interfaces/ecpg/pgtypeslib/Makefile4
-rw-r--r--src/interfaces/ecpg/preproc/Makefile6
-rw-r--r--src/interfaces/ecpg/test/Makefile8
-rw-r--r--src/interfaces/libpq/Makefile6
-rw-r--r--src/port/Makefile4
-rw-r--r--src/port/thread.c14
-rw-r--r--src/template/bsdi6
-rw-r--r--src/template/darwin9
-rw-r--r--src/template/freebsd6
-rw-r--r--src/template/linux10
-rw-r--r--src/template/netbsd3
-rw-r--r--src/template/osf7
-rw-r--r--src/template/solaris7
-rw-r--r--src/template/unixware12
-rw-r--r--src/tools/thread/Makefile6
-rw-r--r--src/tools/thread/README8
-rw-r--r--src/tools/thread/thread_test.c4
21 files changed, 49 insertions, 106 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 5ce53ccb0b3..9d6e1b41043 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.177 2004/04/20 00:33:46 pgsql Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.178 2004/04/23 18:15:53 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -147,9 +147,8 @@ 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@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
have_docbook = @have_docbook@
DOCBOOKSTYLE = @DOCBOOKSTYLE@
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index a3101668a48..c02f94c218f 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -43,15 +43,9 @@
(--enable-thread-safety) */
#undef ENABLE_THREAD_SAFETY
-/* Define if gethostbyname is not thread safe */
-#undef GETHOSTBYNAME_THREADSAFE
-
/* Define to 1 if getpwuid_r() takes a 5th argument. */
#undef GETPWUID_R_5ARG
-/* Define if getpwuid is not thread safe */
-#undef GETPWUID_THREADSAFE
-
/* Define to 1 if gettimeofday() takes only 1 argument. */
#undef GETTIMEOFDAY_1ARG
@@ -324,6 +318,9 @@
/* Define to 1 if the PS_STRINGS thing exists. */
#undef HAVE_PS_STRINGS
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
@@ -588,15 +585,16 @@
/* A string containing the version number, platform, and C compiler */
#undef PG_VERSION_STR
+/* Define to the necessary symbol if this constant uses a non-standard name on
+ your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
/* The size of a `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define if strerror is not thread safe */
-#undef STRERROR_THREADSAFE
-
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
diff --git a/src/interfaces/ecpg/compatlib/Makefile b/src/interfaces/ecpg/compatlib/Makefile
index 7902feab98c..253b2970f47 100644
--- a/src/interfaces/ecpg/compatlib/Makefile
+++ b/src/interfaces/ecpg/compatlib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.14 2004/02/10 07:26:25 tgl Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.15 2004/04/23 18:15:54 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,9 +16,9 @@ NAME= ecpg_compat
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 1
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(THREAD_CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(PTHREAD_CFLAGS)
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
- $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(THREAD_LIBS)
+ $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
OBJS= informix.o
diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile
index 58b13af19ae..5fa654d8fe7 100644
--- a/src/interfaces/ecpg/ecpglib/Makefile
+++ b/src/interfaces/ecpg/ecpglib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.14 2004/03/14 12:16:29 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.15 2004/04/23 18:15:54 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,13 +16,13 @@ NAME= ecpg
SO_MAJOR_VERSION= 4
SO_MINOR_VERSION= 2
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS)
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
connect.o misc.o
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
- $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(THREAD_LIBS)
+ $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
all: all-lib
diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
index c64d61998b2..c6a365a0247 100644
--- a/src/interfaces/ecpg/pgtypeslib/Makefile
+++ b/src/interfaces/ecpg/pgtypeslib/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.16 2004/02/24 16:07:49 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.17 2004/04/23 18:15:54 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -16,7 +16,7 @@ NAME= pgtypes
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 2
-override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS)
SHLIB_LINK += -lm
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
index 5380370d502..52fa7f79a6d 100644
--- a/src/interfaces/ecpg/preproc/Makefile
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.99 2004/03/02 06:45:05 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.100 2004/04/23 18:15:55 momjian Exp $
subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../..
@@ -8,7 +8,7 @@ MAJOR_VERSION=3
MINOR_VERSION=2
PATCHLEVEL=0
-override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) \
+override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS) \
-DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
-DINCLUDEDIR=\"$(includedir)\" \
@@ -25,7 +25,7 @@ OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\
all: submake-libpgport ecpg
ecpg: $(OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(THREAD_LIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(PTHREAD_LIBS) -o $@
# pgc is compiled as part of preproc
preproc.o: $(srcdir)/pgc.c
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 8abbb6fada6..c1afd84af84 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.44 2004/03/14 12:16:30 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.45 2004/04/23 18:15:55 momjian Exp $
subdir = src/interfaces/ecpg/test
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS)
+override CPPFLAGS := -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS)
ECPG = ../preproc/ecpg -I$(srcdir)/../include
@@ -16,10 +16,10 @@ endif
all: $(TESTS)
%: %.o
- $(CC) $(CFLAGS) $(LDFLAGS) -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lpq $(THREAD_LIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lpq $(PTHREAD_LIBS) -o $@
test_informix: test_informix.o
- $(CC) $(CFLAGS) $(LDFLAGS) -L../compatlib -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lecpg_compat -lpq $(THREAD_LIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) -L../compatlib -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lecpg_compat -lpq $(PTHREAD_LIBS) -o $@
%.c: %.pgc
$(ECPG) $<
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 3842fe6e131..0221bf9285d 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.101 2004/04/19 17:42:59 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.102 2004/04/23 18:15:55 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -18,7 +18,7 @@ NAME= pq
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 2
-override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
+override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) $(PTHREAD_CFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \
@@ -32,7 +32,7 @@ endif
# Add libraries that libpq depends (or might depend) on into the
# shared library link. (The order in which you list them here doesn't
# matter.)
-SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(THREAD_LIBS)
+SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(PTHREAD_LIBS)
ifeq ($(PORTNAME), win32)
SHLIB_LINK += -lwsock32 -lws2_32
endif
diff --git a/src/port/Makefile b/src/port/Makefile
index bdc60e87326..356a0b45856 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -7,7 +7,7 @@
# with broken/missing library files.
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/port/Makefile,v 1.9 2003/11/29 19:52:13 pgsql Exp $
+# $PostgreSQL: pgsql/src/port/Makefile,v 1.10 2004/04/23 18:15:55 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -23,7 +23,7 @@ libpgport.a: $(LIBOBJS)
$(AR) $(AROPT) $@ $^
thread.o: thread.c
- $(CC) $(CFLAGS) $(CPPFLAGS) $(THREAD_CPPFLAGS) -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(PTHREAD_CFLAGS) -c $<
clean distclean maintainer-clean:
rm -f libpgport.a $(LIBOBJS)
diff --git a/src/port/thread.c b/src/port/thread.c
index b814bb8359f..474ef969457 100644
--- a/src/port/thread.c
+++ b/src/port/thread.c
@@ -7,7 +7,7 @@
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/port/thread.c,v 1.19 2004/03/23 02:03:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/thread.c,v 1.20 2004/04/23 18:15:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -76,10 +76,6 @@ pqStrerror(int errnum, char *strerrbuf, size_t buflen)
#else
-#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && !defined(STRERROR_THREADSAFE)
-#error This platform can not create a thread-safe version because strerror is not thread-safe and there is no reentrant version
-#endif
-
/* no strerror_r() available, just use strerror */
StrNCpy(strerrbuf, strerror(errnum), buflen);
@@ -111,10 +107,6 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
#else
-#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && !defined(GETPWUID_THREADSAFE)
-#error This platform can not create a thread-safe version because getpwuid is not thread-safe and there is no reentrant version
-#endif
-
/* no getpwuid_r() available, just use getpwuid() */
*result = getpwuid(uid);
#endif
@@ -146,10 +138,6 @@ pqGethostbyname(const char *name,
#else
-#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && !defined(GETHOSTBYNAME_THREADSAFE)
-#error This platform can not create a thread-safe version because getaddrinfo is not thread-safe and there is no reentrant version
-#endif
-
/* no gethostbyname_r(), just use gethostbyname() */
*result = gethostbyname(name);
diff --git a/src/template/bsdi b/src/template/bsdi
index dd750bdc997..dce8fb404ea 100644
--- a/src/template/bsdi
+++ b/src/template/bsdi
@@ -1,9 +1,3 @@
case $host_os in
bsdi2.0 | bsdi2.1 | bsdi3*) CC=gcc2;;
esac
-
-THREAD_SUPPORT=yes
-# verified 4.3.1 2004-02-11
-STRERROR_THREADSAFE=yes
-GETPWUID_THREADSAFE=yes
-GETHOSTBYNAME_THREADSAFE=yes
diff --git a/src/template/darwin b/src/template/darwin
index cd60b83fe07..bffb0d4ea03 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -5,12 +5,5 @@ CC="$CC -no-cpp-precomp"
# Select appropriate semaphore support
USE_NAMED_POSIX_SEMAPHORES=1
-THREAD_SUPPORT=yes
# verified Mac OS X 10.3.3, Darwin Kernel Version 7.3.0, 2004-04-07
-THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
-THREAD_LIBS="-lpthread"
-
-STRERROR_THREADSAFE=yes
-GETPWUID_THREADSAFE=yes
-GETHOSTBYNAME_THREADSAFE=yes
-
+PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
diff --git a/src/template/freebsd b/src/template/freebsd
index c78b87bd761..38c58a6e6ef 100644
--- a/src/template/freebsd
+++ b/src/template/freebsd
@@ -2,9 +2,7 @@ case $host_cpu in
alpha*) CFLAGS="-O";; # alpha has problems with -O2
esac
-# tools/thread/thread_test must be run
-THREAD_CPPFLAGS="-D_THREAD_SAFE"
case $host_os in
- freebsd2*|freebsd3*|freebsd4*) THREAD_LIBS="-pthread";;
- *) THREAD_LIBS="-lc_r";;
+ freebsd2*|freebsd3*|freebsd4*) ;;
+ *) THREAD_LIBS="c_r";; # do we need this? 2004-04-23
esac
diff --git a/src/template/linux b/src/template/linux
index 3684f1a1802..95c1b182fe5 100644
--- a/src/template/linux
+++ b/src/template/linux
@@ -2,12 +2,4 @@
CPPFLAGS="-D_GNU_SOURCE"
# tools/thread/thread_test must be run
-THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
-THREAD_LIBS="-lpthread"
-
-THREAD_SUPPORT=yes
-# 2004-03-14, Linux 2.4.25-1-686
-STRERROR_THREADSAFE=yes
-GETPWUID_THREADSAFE=no
-GETHOSTBYNAME_THREADSAFE=no
-
+PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
diff --git a/src/template/netbsd b/src/template/netbsd
index 120ed59bf47..c45260ca136 100644
--- a/src/template/netbsd
+++ b/src/template/netbsd
@@ -1,5 +1,2 @@
# tools/thread/thread_test must be run
-case $build in
- *-netbsdelf[2-9]*) THREAD_CPPFLAGS="-pthread"; THREAD_LIBS="-pthread" ;;
-esac
diff --git a/src/template/osf b/src/template/osf
index c331ed7f3dc..e845cfecea8 100644
--- a/src/template/osf
+++ b/src/template/osf
@@ -2,10 +2,3 @@ if test "$GCC" != yes ; then
CC="$CC -std"
CFLAGS="-O -ieee"
fi
-
-# tools/thread/thread_test must be run
-if test "$GCC" = yes
-then THREAD_LIBS="-pthread"
-else THREAD_CPPFLAGS="-pthread"
- THREAD_LIBS="-lpthread"
-fi
diff --git a/src/template/solaris b/src/template/solaris
index ce71bbe9181..d6d9fbc794a 100644
--- a/src/template/solaris
+++ b/src/template/solaris
@@ -9,10 +9,5 @@ case $host in
i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
esac
-# tools/thread/thread_test must be run
# -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other things
-THREAD_CPPFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
-if test "$GCC" != yes
-then THREAD_CPPFLAGS="$THREAD_CPPFLAGS -mt"
-fi
-THREAD_LIBS="-lpthread"
+PTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
diff --git a/src/template/unixware b/src/template/unixware
index ea66f47f410..e7e63f65daa 100644
--- a/src/template/unixware
+++ b/src/template/unixware
@@ -1,5 +1,5 @@
if test "$GCC" = yes; then
- THREAD_CPPFLAGS="-pthread"
+ PTHREAD_CFLAGS="-pthread"
else
# The -Kno_host is for a bug in the compiler. See -hackers
# discussion on 7-8/Aug/2003.
@@ -21,17 +21,11 @@ __EOF__
fi
rm -f conftest.*
- THREAD_CPPFLAGS="-K pthread"
+ PTHREAD_CFLAGS="-Kpthread"
fi
# tools/thread/thread_test must be run
-THREAD_CPPFLAGS="$THREAD_CPPFLAGS -D_REENTRANT"
+PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT"
# Disabled because flags are required for all apps using libpq.
# Waiting to see if other platforms need this too. 2004-03-22
-#THREAD_SUPPORT=yes
-# verified UnixWare 7.1.4 2004-03-18
-STRERROR_THREADSAFE=yes
-GETPWUID_THREADSAFE=yes
-GETHOSTBYNAME_THREADSAFE=yes
-
diff --git a/src/tools/thread/Makefile b/src/tools/thread/Makefile
index bfe67a33dd8..3334d41e248 100644
--- a/src/tools/thread/Makefile
+++ b/src/tools/thread/Makefile
@@ -4,7 +4,7 @@
#
# Copyright (C) 2003 by PostgreSQL Global Development Team
#
-# $PostgreSQL: pgsql/src/tools/thread/Makefile,v 1.3 2003/11/29 19:52:14 pgsql Exp $
+# $PostgreSQL: pgsql/src/tools/thread/Makefile,v 1.4 2004/04/23 18:15:55 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -19,9 +19,9 @@ ifeq ($(THREAD_SUPPORT), )
$(error You have not configured your template/$$port file. See the README)
endif
-override CFLAGS += $(THREAD_CPPFLAGS)
+override CFLAGS += $(PTHREAD_CFLAGS)
-LDFLAGS += $(THREAD_LIBS)
+LDFLAGS += $(PTHREAD_LIBS)
all: thread_test
diff --git a/src/tools/thread/README b/src/tools/thread/README
index 6d285302179..d5b9dab7924 100644
--- a/src/tools/thread/README
+++ b/src/tools/thread/README
@@ -6,9 +6,11 @@ thread-safe, or if we should use *_r functions or thread locking.
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 the main source tree
o compile and run this program
+
+If your platform requires special thread flags that are not tested by
+/config/acx_pthread.m4, add PTHREAD_CFLAGS and PTHREAD_LIBS defines to
+your template/${port} file.
+
diff --git a/src/tools/thread/thread_test.c b/src/tools/thread/thread_test.c
index 2b322140e4e..d866f21dbd1 100644
--- a/src/tools/thread/thread_test.c
+++ b/src/tools/thread/thread_test.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.19 2004/04/22 23:58:03 momjian Exp $
+ * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.20 2004/04/23 18:15:55 momjian Exp $
*
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
}
printf("\
-Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'\n\
+Make sure you have added any needed 'PTHREAD_CFLAGS' and 'PTHREAD_LIBS'\n\
defines to your template/$port file before compiling this program.\n\n"
);