Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit391dceb

Browse files
committed
Finalize configuration of thread_test program.
1 parenta6790ce commit391dceb

File tree

13 files changed

+39
-30
lines changed

13 files changed

+39
-30
lines changed

‎configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13273,7 +13273,7 @@ fi
1327313273

1327413274

1327513275

13276-
if test "$SUPPORTS_THREADS" != yes; then
13276+
if test "$THREAD_SUPPORT" != yes; then
1327713277
{ { echo "$as_me:$LINENO: error:
1327813278
Cannot enable threads on your platform.
1327913279
Please report your platform threading info to the PostgreSQL mailing lists
@@ -13299,6 +13299,7 @@ fi
1329913299

1330013300

1330113301

13302+
1330213303
#
1330313304
# Check for re-entrant versions of certain functions
1330413305
#
@@ -18211,6 +18212,7 @@ s,@python_includespec@,$python_includespec,;t t
1821118212
s,@python_libspec@,$python_libspec,;t t
1821218213
s,@LIBOBJS@,$LIBOBJS,;t t
1821318214
s,@HAVE_IPV6@,$HAVE_IPV6,;t t
18215+
s,@THREAD_SUPPORT@,$THREAD_SUPPORT,;t t
1821418216
s,@THREAD_CPPFLAGS@,$THREAD_CPPFLAGS,;t t
1821518217
s,@THREAD_LIBS@,$THREAD_LIBS,;t t
1821618218
s,@HAVE_POSIX_SIGNALS@,$HAVE_POSIX_SIGNALS,;t t

‎configure.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
\dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.291 2003/09/2715:32:47 momjian Exp $
1+
dnl Process this file with autoconf to produce a configure script.
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.292 2003/09/2716:24:44 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1002,7 +1002,7 @@ AC_FUNC_FSEEKO
10021002
if test "$enable_thread_safety" = yes; then
10031003
AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --enable-thread-safetys])])
10041004

1005-
if test "$SUPPORTS_THREADS" != yes; then
1005+
if test "$THREAD_SUPPORT" != yes; then
10061006
AC_MSG_ERROR([
10071007
Cannot enable threads on your platform.
10081008
Please report your platform threading info to the PostgreSQL mailing lists
@@ -1016,6 +1016,7 @@ else
10161016
THREAD_CPPFLAGS=
10171017
THREAD_LIBS=
10181018
fi
1019+
AC_SUBST(THREAD_SUPPORT)
10191020
AC_SUBST(THREAD_CPPFLAGS)
10201021
AC_SUBST(THREAD_LIBS)
10211022

‎src/Makefile.global.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.169 2003/09/2715:32:47 momjian Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.170 2003/09/2716:24:44 momjian Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -150,6 +150,7 @@ TK_LIBS= @TK_LIBS@
150150
TK_LIB_SPEC= @TK_LIB_SPEC@
151151
TK_XINCLUDES= @TK_XINCLUDES@
152152

153+
THREAD_SUPPORT= @THREAD_SUPPORT@
153154
THREAD_CPPFLAGS= @THREAD_CPPFLAGS@
154155
THREAD_LIBS= @THREAD_LIBS@
155156

‎src/template/bsdi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ case $host_os in
1010
;;
1111
esac
1212

13-
SUPPORTS_THREADS=yes
13+
THREAD_SUPPORT=yes
1414
NEED_REENTRANT_FUNCS=no# verified 4.3 2003-09-26

‎src/template/freebsd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ case $host_cpu in
44
alpha*) CFLAGS="$CFLAGS -O" ;;
55
esac
66

7-
SUPPORTS_THREADS=yes
8-
NEED_REENTRANT_FUNCS=yes # 4.8, 5.1 2003-09-12
9-
7+
THREAD_SUPPORT=yes
8+
NEED_REENTRANT_FUNCS=yes
109
THREAD_CPPFLAGS="-D_THREAD_SAFE"
1110
case $host_os in
1211
freebsd2*|freebsd3*|freebsd4*)

‎src/template/linux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ CFLAGS=-O2
22
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
33
CPPFLAGS="-D_GNU_SOURCE"
44

5-
SUPPORTS_THREADS=yes
6-
NEED_REENTRANT_FUNCS=yes# verified glibc 2.1 2003-09-03
5+
THREAD_SUPPORT=yes
6+
NEED_REENTRANT_FUNCS=yes
77
THREAD_CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
88
THREAD_LIBS="-lpthread"
99

‎src/template/netbsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
CFLAGS='-O2 -pipe'
22

3-
SUPPORTS_THREADS=yes
3+
THREAD_SUPPORT=yes
44
NEED_REENTRANT_FUNCS=yes# 1.6 2003-09-14

‎src/template/osf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ else
55
CFLAGS='-O4 -Olimit 2000'
66
fi
77

8-
SUPPORTS_THREADS=yes
8+
THREAD_SUPPORT=yes
99
NEED_REENTRANT_FUNCS=no# 4.0 2003-09-13
1010
THREAD_LIBS="-pthread"

‎src/template/solaris

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ else
55
CFLAGS=-v# -v is like gcc -Wall
66
fi
77

8-
SUPPORTS_THREADS=yes
8+
THREAD_SUPPORT=yes
99
NEED_REENTRANT_FUNCS=yes# 5.6 2003-09-13
1010
THREAD_LIBS="-pthread"
1111

‎src/template/unixware

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ else
99
THREAD_CPPFLAGS="-K pthread"
1010
fi
1111

12-
SUPPORTS_THREADS=yes
12+
THREAD_SUPPORT=yes
1313
NEED_REENTRANT_FUNCS=no# verified 7.1.3 2003-09-03
1414
THREAD_CPPFLAGS="$THREAD_CPPFLAGS -D_REENTRANT"

‎src/tools/thread/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
#
55
# Copyright (C) 2003 by PostgreSQL Global Development Team
66
#
7-
# $Header: /cvsroot/pgsql/src/tools/thread/Attic/Makefile,v 1.1 2003/09/2715:32:48 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/tools/thread/Attic/Makefile,v 1.2 2003/09/2716:24:45 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = tools/thread
1212
top_builddir = ../../..
1313
include$(top_builddir)/src/Makefile.global
1414

15+
ifeq ($(THREAD_SUPPORT), no)
16+
$(error Your platform does not support threads)
17+
endif
18+
ifeq ($(THREAD_SUPPORT), )
19+
$(error You have not configured your template/$$port file. See the README)
20+
endif
21+
1522
overrideCFLAGS +=$(THREAD_CPPFLAGS)
1623

1724
LDFLAGS +=$(THREAD_LIBS)

‎src/tools/thread/README

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ new platforms.
44
Run thread_test program to determine if your native libc functions are
55
thread-safe, or if we should use *_r functions or thread locking.
66

7-
Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'
8-
defines to your template/${port} file before compiling this program.
7+
To use this program, you must:
8+
9+
o add "THREAD_SUPPORT=yes" to your template/${port} file
10+
o add any THREAD_CPPFLAGS and THREAD_LIBS defines to your
11+
template/${port} file
12+
o run "configure --enable-thread-safety"
13+
o compile and run this program

‎src/tools/thread/thread_test.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$Header: /cvsroot/pgsql/src/tools/thread/Attic/thread_test.c,v 1.1 2003/09/2715:32:48 momjian Exp $
9+
*$Header: /cvsroot/pgsql/src/tools/thread/Attic/thread_test.c,v 1.2 2003/09/2716:24:45 momjian Exp $
1010
*
1111
*This program tests to see if your standard libc functions use
1212
*pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
5858

5959
printf("\
6060
Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'\n\
61-
defines to your template/${port} file before compiling this program.\n\n"
61+
defines to your template/$port file before compiling this program.\n\n"
6262
);
6363
pthread_create(&thread1,NULL, (void* (*)(void*))func_call_1,NULL);
6464
pthread_create(&thread2,NULL, (void* (*)(void*))func_call_2,NULL);
@@ -82,20 +82,14 @@ defines to your template/${port} file before compiling this program.\n\n"
8282
strerror_p1!=strerror_p2)
8383
{
8484
printf("All your non-*_r functions are thread-safe.\n");
85-
printf("Add this to your template/${port} file:\n\n");
86-
printf("\
87-
SUPPORTS_THREADS=yes\n\
88-
NEED_REENTRANT_FUNCS=no\n"
89-
);
85+
printf("Add this to your template/$port file:\n\n");
86+
printf("NEED_REENTRANT_FUNCS=no\n");
9087
}
9188
else
9289
{
9390
printf("Not all non-*_r functions are thread-safe.\n");
94-
printf("Add this to your template/${port} file:\n\n");
95-
printf("\
96-
SUPPORTS_THREADS=yes\n\
97-
NEED_REENTRANT_FUNCS=yes\n"
98-
);
91+
printf("Add this to your template/$port file:\n\n");
92+
printf("NEED_REENTRANT_FUNCS=yes\n");
9993
}
10094

10195
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp