httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: Problem with header autodetect
Date Fri, 17 Jul 1998 04:21:07 GMT
On Thu, 16 Jul 1998 15:14:54 +0200, Ralf S. Engelschall 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?

The patch doesn't work for me because "chmod a+rx" doesn't have the desired 
effect in OS/2. For PrintPathOS2 to find it it has to have a .exe extension.

Shouldn't it be possible to check the return value of the $(CC) -E ?
Or simply test for the existence of the output file which doesn't exist if 
there's an error and you use -o rather that redirection.

I think this should probably go in a separate helper script. The following 
works for me but is only as portable as $(CC) -E and I can only guess at that.

----- TestHeader CUT HERE -----
trap 'rm -f Makefile testpp.c testpp; exit $exstat' 0 1 2 3 15
# Yet another Apache Configure helper script.
# This script tests for the existence of a header file
# ./helpers/TestHeader <headername>
#    Which checks to see if <headername> exists on this system
# It does these by creating a small mini-makefile, based on
# ../Makefile.config which trys to run the C preprocessor on
# a generated source file. If the preprocessor succeeds, we assume the
# header exists.
# This must be run as './helpers/TestHeader' from
# the ./src directory (same directory that Configure is
# located) if you want to test it out. Configure must
# also call it as './helpers/TestHeader'

cd ./helpers

# Handle "verbose" and "silent" flags
case "$1" in

# Generate the test source file

if [ "x$1" = "x" ]; then

if [ "$VERBOSE" = "yes" ]; then

cat <<EOF >testpp.c
#include <$1>

# Get makefile settings and build a basic Makefile
cat ../Makefile.config > Makefile
cat <<EOF >> Makefile

	cd ..; rm -f helpers/testpp && \$(CC) \$(INCLUDES) -E helpers/testpp.c -o helpers/testpp

# Now run that Makefile
eval "make $TARGET >/dev/null $ERRDIR"

# And see if testpp exists, if so, then we
# assume the condition we are testing for is good

if [ -e testpp ]; then
    if [ "$VERBOSE" = "yes" ]; then
        echo "Header $1 found"
----- CUT HERE -----

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message