Re: UnixWare UP3 compiler detection patch

Lists: pgsql-patches
From: Larry Rosenman <ler(at)lerctr(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: UnixWare UP3 compiler detection patch
Date: 2003-10-31 15:38:25
Message-ID: 37600000.1067614705@lerlaptop-red.iadfw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

I put the following patch to detect the 7.1.3 UP3 compiler. If there
are no SERIOUS objections, please apply:

Index: src/template/unixware
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/template/unixware,v
retrieving revision 1.27
diff -u -r1.27 unixware
--- src/template/unixware 25 Oct 2003 15:32:11 -0000 1.27
+++ src/template/unixware 31 Oct 2003 15:37:23 -0000
@@ -1,13 +1,28 @@
if test "$GCC" = yes; then
THREAD_CPPFLAGS="-pthread"
else
-# the -Kno_host is temporary for a bug in the compiler. See -hackers
+# the -Kno_host is for a bug in the compiler. See -hackers
# discussion on 7-8/Aug/2003.
-# when the 7.1.3UP3 or later compiler is out, we can do a version check.
- CFLAGS="-O -Kinline,no_host"
+# version check for the 7.1.3UP3 compiler (version 401200310):
+cat >testcompver.c <<__EOF__
+#include <stdio.h>
+#include <stdlib.h>
+int main(int argc, char **argv)
+{
+ if (__SCO_VERSION__ >= 401200310) exit(1);
+ else exit(0);
+}
+__EOF__
+ cc -O -o testcompver testcompver.c
+ ./testcompver
+ if test $? = 1; then
+ CFLAGS="-O -Kinline"
+ else
+ CFLAGS="-O -Kinline,no_host"
+ fi
+ rm testcompver testcompver.c
THREAD_CPPFLAGS="-K pthread"
fi
-
THREAD_SUPPORT=yes
NEED_REENTRANT_FUNCS=no # verified 7.1.3 2003-09-03
THREAD_CPPFLAGS="$THREAD_CPPFLAGS -D_REENTRANT"

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Attachment Content-Type Size
unixware.up3.patch application/octet-stream 1.2 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: UnixWare UP3 compiler detection patch
Date: 2003-10-31 23:17:46
Message-ID: Pine.LNX.4.44.0311010015270.1528-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Larry Rosenman writes:

> I put the following patch to detect the 7.1.3 UP3 compiler. If there
> are no SERIOUS objections, please apply:

This patch breaks about all the rules for robust autoconf tests:

1. Compile things using the compiler and the flags that the user chose,
not hardcoded ones.

2. Make sure you can clean up after yourself even if your code doesn't run
all the way through.

3. Don't execute programs you just compiled.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Larry Rosenman <ler(at)lerctr(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: UnixWare UP3 compiler detection patch
Date: 2003-10-31 23:22:33
Message-ID: 469380000.1067642553@lerlaptop-red.iadfw.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

--On Saturday, November 01, 2003 00:17:46 +0100 Peter Eisentraut
<peter_e(at)gmx(dot)net> wrote:

> Larry Rosenman writes:
>
>> I put the following patch to detect the 7.1.3 UP3 compiler. If there
>> are no SERIOUS objections, please apply:
>
> This patch breaks about all the rules for robust autoconf tests:
>
> 1. Compile things using the compiler and the flags that the user chose,
> not hardcoded ones.
We are just checking a preprocessor define that we know will exist in
the SCO cc case, and this preprocessor define does NOT change based
on flags.
>
> 2. Make sure you can clean up after yourself even if your code doesn't run
> all the way through.
I can, and I've tested it, because I blew the test a couple of times.
>
> 3. Don't execute programs you just compiled.
Why not?

It's only on the ONE platform, and how would you prefer the test be done?

>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749