Skip to content

Commit baee5f7

Browse files
committed
Push responsibility for selecting out-of-line-assembler TAS code out to
the platform template files, instead of doing it directly in configure.in. This seems cleaner, and also opens the door to making the choice be dependent on the compiler being used.
1 parent 9adaf64 commit baee5f7

File tree

4 files changed

+52
-33
lines changed

4 files changed

+52
-33
lines changed

configure

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,22 +1448,11 @@ echo "${ECHO_T}$template" >&6
14481448
PORTNAME=$template
14491449

14501450

1451-
# Pick right test-and-set (TAS) code. Most platforms have inline
1452-
# assembler code in src/include/storage/s_lock.h, so we just use
1453-
# a dummy file here.
1454-
case $host in
1455-
hppa*-*-hpux*) need_tas=yes; tas_file=hpux_hppa.s ;;
1456-
sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
1457-
i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
1458-
*) need_tas=no; tas_file=dummy.s ;;
1459-
esac
1460-
ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
1461-
1462-
1463-
if test "$need_tas" = yes ; then
1464-
TAS=tas.o
1465-
fi
1466-
1451+
# Initialize default assumption that we do not need separate assembly code
1452+
# for TAS (test-and-set). This can be overridden by the template file
1453+
# when it's executed.
1454+
need_tas=no
1455+
tas_file=dummy.s
14671456

14681457

14691458

@@ -2824,6 +2813,21 @@ _ACEOF
28242813

28252814

28262815

2816+
#
2817+
# Set up TAS assembly code if needed; the template file has now had its
2818+
# chance to request this.
2819+
#
2820+
ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
2821+
2822+
2823+
if test "$need_tas" = yes ; then
2824+
TAS=tas.o
2825+
else
2826+
TAS=""
2827+
fi
2828+
2829+
2830+
28272831
#
28282832
# Automatic dependency tracking
28292833
#
@@ -18223,7 +18227,6 @@ s,@host_cpu@,$host_cpu,;t t
1822318227
s,@host_vendor@,$host_vendor,;t t
1822418228
s,@host_os@,$host_os,;t t
1822518229
s,@PORTNAME@,$PORTNAME,;t t
18226-
s,@TAS@,$TAS,;t t
1822718230
s,@docdir@,$docdir,;t t
1822818231
s,@enable_nls@,$enable_nls,;t t
1822918232
s,@WANTED_LANGUAGES@,$WANTED_LANGUAGES,;t t
@@ -18240,6 +18243,7 @@ s,@EXEEXT@,$EXEEXT,;t t
1824018243
s,@OBJEXT@,$OBJEXT,;t t
1824118244
s,@CPP@,$CPP,;t t
1824218245
s,@GCC@,$GCC,;t t
18246+
s,@TAS@,$TAS,;t t
1824318247
s,@autodepend@,$autodepend,;t t
1824418248
s,@INCLUDES@,$INCLUDES,;t t
1824518249
s,@enable_thread_safety@,$enable_thread_safety,;t t

configure.in

Lines changed: 20 additions & 16 deletions
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.308 2003/11/29 19:51:16 pgsql Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.309 2003/12/23 18:40:52 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -97,21 +97,11 @@ AC_MSG_RESULT([$template])
9797
PORTNAME=$template
9898
AC_SUBST(PORTNAME)
9999

100-
# Pick right test-and-set (TAS) code. Most platforms have inline
101-
# assembler code in src/include/storage/s_lock.h, so we just use
102-
# a dummy file here.
103-
case $host in
104-
hppa*-*-hpux*) need_tas=yes; tas_file=hpux_hppa.s ;;
105-
sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
106-
i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
107-
*) need_tas=no; tas_file=dummy.s ;;
108-
esac
109-
AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}])
110-
111-
if test "$need_tas" = yes ; then
112-
TAS=tas.o
113-
fi
114-
AC_SUBST(TAS)
100+
# Initialize default assumption that we do not need separate assembly code
101+
# for TAS (test-and-set). This can be overridden by the template file
102+
# when it's executed.
103+
need_tas=no
104+
tas_file=dummy.s
115105

116106

117107

@@ -302,6 +292,20 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR,
302292
[A string containing the version number, platform, and C compiler])
303293

304294

295+
#
296+
# Set up TAS assembly code if needed; the template file has now had its
297+
# chance to request this.
298+
#
299+
AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}])
300+
301+
if test "$need_tas" = yes ; then
302+
TAS=tas.o
303+
else
304+
TAS=""
305+
fi
306+
AC_SUBST(TAS)
307+
308+
305309
#
306310
# Automatic dependency tracking
307311
#

src/template/hpux

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ if test "$GCC" != yes ; then
44
CC="$CC -Ae"
55
CFLAGS="+O2"
66
fi
7+
8+
# Pick right test-and-set (TAS) code.
9+
case $host in
10+
hppa*-*-hpux*) need_tas=yes; tas_file=hpux_hppa.s ;;
11+
esac

src/template/solaris

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ if test "$GCC" != yes ; then
33
CFLAGS="-O -v" # -v is like gcc -Wall
44
fi
55

6+
# Pick right test-and-set (TAS) code.
7+
case $host in
8+
sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
9+
i?86-*-solaris*) need_tas=yes; tas_file=solaris_i386.s ;;
10+
esac
11+
612
THREAD_SUPPORT=yes
713
NEED_REENTRANT_FUNCS=yes # 5.6 2003-09-13
814
THREAD_LIBS="-pthread"

0 commit comments

Comments
 (0)