The following reply was made to PR config/3240; it has been noted by GNATS.
From: "Ralf S. Engelschall" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: config/3240: Mishandling of -DSERVER_SUBVERSION="PHP/3.0.3
AuthMySQL/2.20" in src/Configure
Date: Tue, 27 Oct 1998 12:39:24 +0100
In article <[EMAIL PROTECTED]> you wrote:
>[...]
>>Synopsis: Mishandling of -DSERVER_SUBVERSION="PHP/3.0.3
>>AuthMySQL/2.20" in src/Configure
>[...]
> o php3_module uses ConfigStart/End
> o auth_mysql_module uses ConfigStart/End
> gcc: AuthMySQL/2.20": No such file or directory
> helpers/dummy.c:0: unterminated string or character constant
> helpers/dummy.c:0: possible real start of unterminated constant
> make: *** [dummy] Error 1
> + doing sanity check on compiler and options
> ** A test compilation with your Makefile configuration
> ** failed. This is most likely because your C compiler
> ** is not ANSI. Apache requires an ANSI C Compiler, such
> ** as gcc. The above error message from your compiler
> ** will also provide a clue.
> Aborting!
>[...]
I've investigated some time and figured out that it's a lot more complicated
than it looks. Nevertheless I hope I've now a patch available which fixes all
problems. I append you the patch below. Please try it out yourself and give me
feedback whether it works or works not for you, too.
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com
Index: src/CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.1125
diff -u -r1.1125 CHANGES
--- CHANGES 1998/10/27 10:20:00 1.1125
+++ CHANGES 1998/10/27 11:37:24
@@ -1,5 +1,9 @@
Changes with Apache 1.3.4
+ *) Fix CFLAGS parsing for ap_config_auto.h: Whitespaces in the value of -D
+ options let the configuration mechanism completely fall down.
+ [Ralf S. Engelschall] PR#3240
+
*) Add APACI --permute-module=foo:bar option which can be used to
on-the-fly/batch permute the order of two modules (mod_foo and mod_bar)
in the Configuration[.apaci] file. Two special and important variants are
Index: src/Configure
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/Configure,v
retrieving revision 1.303
diff -u -r1.303 Configure
--- Configure 1998/10/27 10:37:46 1.303
+++ Configure 1998/10/27 11:33:55
@@ -1697,7 +1697,7 @@
##
if [ "x$SUBVERSION" != "x" ] ; then
SUBVERSION=`echo $SUBVERSION | sed 's/^ +//'`
- CFLAGS="$CFLAGS -DSERVER_SUBVERSION=\\\"$SUBVERSION\\\""
+ CFLAGS="$CFLAGS \"-DSERVER_SUBVERSION=\\\"$SUBVERSION\\\"\""
fi
####################################################################
@@ -1770,16 +1770,29 @@
## ap_config_auto.h so they are available to external modules needing to
## include Apache header files.
##
-for cflag in $CFLAGS; do
- echo $cflag | sed 's/\\\"/\"/g' >>$tmpconfig ;
+TEXTRA_CFLAGS=`egrep '^EXTRA_CFLAGS=' Makefile.config | tail -1 |\
+ sed -e 's;^EXTRA_CFLAGS=;;' -e 's;\`.*\`;;'`
+tmpstr=`echo $CFLAGS $TEXTRA_CFLAGS |\
+ sed -e 's;[ ]-;!-;g' -e 's/\\\"/\"/g' -e 's/\([^\\]\)"/\1/g'`
+OIFS="$IFS" IFS='!'
+for cflag in $tmpstr; do
+ echo "$cflag" >>$tmpconfig
done
+IFS="$OIFS"
awk >>$AP_CONFIG_AUTO_H <$tmpconfig '
- /^-D.*/ {
- define = substr($1, 3, length($1)-2)
- split(define, parts, "=")
- printf ("\n/* build flag: %s */\n", $0)
- printf ("#ifndef %s\n#define %s %s\n#endif\n",
parts[1],parts[1],parts[2])
- }
+ /^-D.*/ {
+ i = index($0, "=")
+ if (i > 0) {
+ define = substr($0, 3, i-3)
+ value = substr($0, i+1, length($0)-i)
+ }
+ else {
+ define = substr($0, 3, length($0)-2)
+ value = "1";
+ }
+ printf ("\n/* build flag: %s */\n", $0)
+ printf ("#ifndef %s\n#define %s %s\n#endif\n", define, define, value)
+ }
'
# finish header file