httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject [PATCH] Barf if using HP-UX non-ANSI cc, Take II
Date Fri, 25 Jul 1997 01:24:18 GMT
This involves a minor change to TestLib and dummy.c...

We could also be more generic and do a overall check if $(CC)
is ANSI for all OSs and not just HP-UX. As mentioned in the
wordy comments, we would use TestLib to check for libc and,
if it fails, assume that it's because the compiler barfed on the
ANSI-ism of dummy.c (and not because libc doesn't exist or some
other weird error)... I'm kinda cold on that idea but I really
don't like having Configure make these kind of assumptions since
that's what I hate about autoconf's in general.

Index: apache/src/Configure
===================================================================
RCS file: /export/home/cvs/apache/src/Configure,v
retrieving revision 1.120
diff -u -r1.120 Configure
--- Configure	1997/07/24 04:35:45	1.120
+++ Configure	1997/07/25 01:19:03
@@ -629,9 +629,24 @@
 	;;
     'HP-UX'|'HP-UX 10')
 	if [ "$TCC" = "cc" ]; then
-	    CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE"
-	    OPTIM=" "
-	    TOPTIM=""
+	    # Check for bogus HP-UX cc compiler... We do this
+	    # by using TestLib to check for the libc library,
+	    # which we know exists, but allowing TestLib to
+	    # print out error messages. We check to see if we
+	    # get the "I'm not ANSI so I don't know what const"
+	    # error message. Of course, we could also simply see
+	    # if TestLib succeeded or not (assuming that libc.a
+	    # really DOES exist) but we'll be paranoid.
+	    if ./helpers/TestLib c | grep "will become a keyword"
+	    then
+	    	echo "** Apache will not compile using HP-UX's 'cc' compiler"
+		echo "** We strongly recommend that you install 'gcc'"
+		exit 1
+	    else
+		CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE"
+		OPTIM=" "
+		TOPTIM=""
+	    fi
 	fi
 	;;
 esac
@@ -709,19 +724,19 @@
 case "$PLAT" in
     *-linux*)
 	# newer systems using glibc 2.x need -lcrypt
-	if ./helpers/TestLib crypt; then
+	if ./helpers/TestLib -s crypt; then
 	    LIBS="$LIBS -lcrypt"
 	fi
 	# many systems have -ldb installed
 	DB_LIB=""
-	if ./helpers/TestLib db; then
+	if ./helpers/TestLib -s db; then
 	    DB_LIB="-ldb"
 	fi;
 	# many systems don't have -ldbm
 	DBM_LIB=""
-	if ./helpers/TestLib dbm; then
+	if ./helpers/TestLib -s dbm; then
 	    DBM_LIB="-ldbm"
-	elif ./helpers/TestLib ndbm; then
+	elif ./helpers/TestLib -s ndbm; then
 	    DBM_LIB="-lndbm"
 	fi
 	;;
Index: apache/src/helpers/TestLib
===================================================================
RCS file: /export/home/cvs/apache/src/helpers/TestLib,v
retrieving revision 1.8
diff -u -r1.8 TestLib
--- TestLib	1997/07/21 20:18:59	1.8
+++ TestLib	1997/07/25 01:19:03
@@ -20,6 +20,13 @@
 #
 # Make sure we have an argument
 #
+if [ "x$1" = "x-s" ]; then
+    shift
+    quiet=""
+else
+    quiet='> /dev/null 2>&1'
+fi
+
 if [ "x$1" = "x" ]; then
   exit
 fi
@@ -42,7 +49,8 @@
 EOF
 
 # Now run that Makefile
-make dummy > /dev/null 2<&1
+eval "make dummy $quiet"
+
 
 # And see if dummy exists, if so, then we assume the 
 # library we are testing for exists
Index: apache/src/helpers/dummy.c
===================================================================
RCS file: /export/home/cvs/apache/src/helpers/dummy.c,v
retrieving revision 1.2
diff -u -r1.2 dummy.c
--- dummy.c	1997/07/21 20:18:59	1.2
+++ dummy.c	1997/07/25 01:19:03
@@ -1,4 +1,10 @@
 /* this file is used by TestLib */
+int foo ( const char *c )
+{
+return 0;
+}
 int main(void) {
+    const char *c = '\0';
+    (void)foo(c);
     return 0;
 }
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Mime
View raw message