httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Important: TestCompile and c89 argument order
Date Wed, 15 Dec 1999 18:25:12 GMT
In a recent note, Martin Kraemer said:

> Date: Wed, 15 Dec 1999 18:50:38 +0100
> As you can see, the former argument order
>   c89 helpers/testfunc.c -o helpers/testfunc $TLIB \$(LIBS)
> was changed to
>   c89 -o helpers/testfunc $TLIB \$(LIBS) helpers/testfunc.c
> While I don't have problems with the "-o outname" appearing *before*
> the input source file, my compiler DOES care about the library names
> (-L/lib -lblah) appearing before, not after, the source name. My
> compiler is a c89 (but made by Siemens, not by IBM), and it insists on
> treating its source, object and library arguments left-to-right, which
> makes sense IMHO.
> I don't know if Unix98 requires that a c89 handle $(LIBS) before the
> sources, but at least I know that few people use c89 (most use cc, and
> cc is NOT required to accept this).
I think this is a POSIX thing.  POSIX deprecates "cc", so Ovies and
independently I both gravitated to c89.  Further POSIX generally
requires that options precede the operand list.  I don't know that
OS/390's "cc" is any different from "c89" in this regard.

> So IMO....
> a)  this change should be reverted BEFORE 1.3.10 (lest we intend to
>     fail on cc-only machines)
>     and
> b)  IBMers should write a wrapper around their c89 to reorder the
>     arguments (I have written one for our compiler as well ;-)
I hesitated to make so profound a change as Ovies; instead I
used a back-door environment variable that IBM provides to restore
the traditional syntax:

diff -bru orig/apache_1.3.9/src/Configure apache_1.3.9/src/Configure
--- orig/apache_1.3.9/src/Configure     Sun Aug 15 18:49:08 1999
+++ apache_1.3.9/src/Configure  Mon Nov 22 15:22:20 1999
@@ -616,6 +616,17 @@
+    *-*-os390*)
+       OS='OS390'
+       OSDIR='os/unix'
+       CC="_C89_CCMODE=1 c89"
+       DBM_LIB=""
+       ;;

However, in order to accommodate the "CC" variable containing
whitespace, I needed to make other changes in Configure:

@@ -848,7 +859,7 @@
 # If $TCC is null, then no such line exists in Configuration
-TCC=`egrep '^CC=' Makefile.config | tail -1 | awk -F= '{print $2}'`
+TCC=`egrep '^CC=' Makefile.config | tail -1 | sed -e 's!^[^=]*=!!'`
 if [ "x$TCC" = "x" ]; then
     if [ "x$CC" = "x" ]; then
        # At this point, CC is not set in Configuration or above, so we

I believe this has been superseded by another recent change to
Configure, much discussed on this list, which provides equivalent

-- gil

View raw message