httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Problem with header autodetect
Date Thu, 16 Jul 1998 13:14:54 GMT

In article <199807160637.QAA13414@silk.apana.org.au> you wrote:

> The header autodetection in Configure is broken for me under OS/2 because
> Configure calls TestCompile to test for the header before it has finished
> writing makefile.config (which TestCompile uses).

We have a similar problem for the other TestCompile usage points where libs
are tested. But you're right, we have a problem. But it is bigger than just
the header checks. OTOH we can at least fix the problem for the header checks
when we permutate some stuff in Configure. I'll look at this.

> In particular it needs the LDFLAGS specified in the OS/2 section to be used
> so that an EXE is generated (which can then be found by PrintPathOS2).

> There's also another problem. sys/select.h requires sys/types.h to be
> included before it so testing for sys/select.h will fail even though it
> exists.

Both problems have to be addressed differently, IMHO. We need a target in
TestCompile for only running CPP. Please try out the appended patch, it
introduces a testpp target which does it via $(CC) -E although we really had
to test for "cpp", then "$(CC) -E" etc. Or is CC -E really portable?

> And shouldn't it "rm testfunc" before the test as it does "dummy"?
> Actually I need it to delete "testfunc.exe" as well.

That's because the Unix guys who wrote TestCompile never thought about OS/2,
sorry. Someone just has to add testfunc.exe to the trap at the top of
TestCompile.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: helpers/TestCompile
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/helpers/TestCompile,v
retrieving revision 1.12
diff -u -r1.12 TestCompile
--- TestCompile	1998/07/11 10:24:07	1.12
+++ TestCompile	1998/07/16 13:06:04
@@ -1,6 +1,6 @@
 #!/bin/sh
 exstat=1
-trap 'rm -f Makefile dummy testfunc.c testfunc; exit $exstat' 0 1 2 3 15
+trap 'rm -f Makefile dummy testfunc.c testfunc testpp.c testpp; exit $exstat' 0 1 2 3 15
 #
 # Yet another Apache Configure helper script.
 # This script tests certain aspects of the compilation
@@ -107,10 +107,9 @@
 	else
 	    ERRDIR='2>/dev/null'
 	fi
-	TARGET='testfunc'
-	cat <<EOF >testfunc.c
+	TARGET='testpp'
+	cat <<EOF >testpp.c
 #include <$2>
-void main(void) { }
 EOF
 	;;
     *)
@@ -134,6 +133,9 @@
 
 testfunc:
 	cd ..; \$(CC) \$(CFLAGS) \$(INCLUDES) \$(LDFLAGS) helpers/testfunc.c -o helpers/testfunc
$TLIB \$(LIBS)
+
+testpp:
+	cd ..; rm -f helpers/testpp && \$(CC) \$(INCLUDES) -E helpers/testpp.c >helpers/testpp
&& chmod a+rx helpers/testpp
 EOF
 
 # Now run that Makefile

Mime
View raw message