From 7a66015e98e890c27e3483a413d5a88927c5b818 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 23 Apr 2004 18:15:55 +0000 Subject: 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. --- src/tools/thread/Makefile | 6 +++--- src/tools/thread/README | 8 +++++--- src/tools/thread/thread_test.c | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/tools') diff --git a/src/tools/thread/Makefile b/src/tools/thread/Makefile index bfe67a33dd..3334d41e24 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 6d28530217..d5b9dab792 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 2b322140e4..d866f21dbd 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" ); -- cgit v1.2.3