Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 23282 invoked by uid 6000); 15 Apr 1999 10:54:00 -0000 Received: (qmail 23273 invoked from network); 15 Apr 1999 10:53:59 -0000 Received: from kurgan.lyra.org (root@208.192.43.9) by taz.hyperreal.org with SMTP; 15 Apr 1999 10:53:59 -0000 Received: from kurgan.lyra.org (IDENT:gstein@localhost [127.0.0.1]) by kurgan.lyra.org (8.9.2/8.9.2) with SMTP id DAA25376 for ; Thu, 15 Apr 1999 03:53:51 -0700 (PDT) Message-ID: <3715C53C.5B14E0FC@lyra.org> Date: Thu, 15 Apr 1999 03:53:48 -0700 From: Greg Stein X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.28 i586) MIME-Version: 1.0 To: new-httpd@apache.org Subject: [PATCH] add Expat as an option Content-Type: multipart/mixed; boundary="------------3694A8DC1325FC9B4B9AE33F" Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org This is a multi-part message in MIME format. --------------3694A8DC1325FC9B4B9AE33F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Attached is a patch (to apache-1.3) to add Expat into the core server, for use by modules (mod_dav and mod_php have already signed up to use this if made available). The patch adds a new RULE_EXPAT to control the addition of Expat to the server. The rule is forced to "no" if the src/expat/ directory is not present (this allows a distribution to easily remove [the MPL'd] Expat if required). It also solves the problem noted earlier (Expat was not being pulled into httpd, making it unavailable for DSOs) by adding a stub function into http_main. For the Expat inclusion to work, it is also presumed that Expat's "xmlparse.h" header is dropped into src/include/. => Q: should Configure also ensure that the xmlparse.h header exists? I say "no" with the expectation that the person add/removing Expat to/from the distribution should know better. Note: this patch uses the same style of Makefile symbols and stuff as the HSREGEX stuff. (the header in src/include/ and the $(REGLIB) stuff. It may be interesting in the future to provide a more extensible way to do this, so we don't end up with a bazillion *LIB things in the link lines. => Q: what should we do if a module says RULE_EXPAT=yes, but the directory doesn't exist? This test would be at line 1552 (of the patched Configure); what is the "approved" way to punt from Configure with an error? Presuming this goes in, then I'll follow up with an appropriate src/expat/ subdirectory patch. That's a bit different decision: do we do nothing in the core for Expat, do we add a framework but not ship Expat itself, or do we add the framework and Expat? Cheers, -g -- Greg Stein, http://www.lyra.org/ --------------3694A8DC1325FC9B4B9AE33F Content-Type: text/plain; charset=us-ascii; name="expat.patch" Content-Disposition: inline; filename="expat.patch" Content-Transfer-Encoding: 7bit Index: Configuration.tmpl =================================================================== RCS file: /home/cvs/apache-1.3/src/Configuration.tmpl,v retrieving revision 1.112 diff -u -u -r1.112 Configuration.tmpl --- Configuration.tmpl 1998/12/01 23:59:53 1.112 +++ Configuration.tmpl 1999/04/15 09:59:57 @@ -160,12 +160,19 @@ # is performing this function. If PARANOID is set to yes, it will # actually print-out the code that the modules execute # +# EXPAT: +# Include James Clark's Expat package into Apache, for use by the +# modules. The "default" is to include it if the ./expat/ directory +# is present. This rule will always be interpreted as "no" if the +# directory is not present. +# Rule SOCKS4=no Rule SOCKS5=no Rule IRIXNIS=no Rule IRIXN32=yes Rule PARANOID=no +Rule EXPAT=default # The following rules should be set automatically by Configure. However, if # they are not set by Configure (because we don't know the correct value for Index: Configure =================================================================== RCS file: /home/cvs/apache-1.3/src/Configure,v retrieving revision 1.337 diff -u -u -r1.337 Configure --- Configure 1999/03/30 08:58:33 1.337 +++ Configure 1999/04/15 09:59:57 @@ -76,7 +76,7 @@ tmpfile3=$tmpfile.3 awkfile=$tmpfile.4 tmpconfig=$tmpfile.5 -SUBDIRS="ap main modules" +SUBDIRS="ap main" #################################################################### ## Now handle any arguments, which, for now, is -file @@ -222,6 +222,7 @@ RULE_IRIXNIS=`./helpers/CutRule IRIXNIS $file` RULE_IRIXN32=`./helpers/CutRule IRIXN32 $file` RULE_PARANOID=`./helpers/CutRule PARANOID $file` +RULE_EXPAT=`./helpers/CutRule EXPAT $file` RULE_SHARED_CORE=`./helpers/CutRule SHARED_CORE $file` RULE_SHARED_CHAIN=`./helpers/CutRule SHARED_CHAIN $file` @@ -1541,6 +1542,22 @@ fi #################################################################### +## Add in the Expat library if needed/wanted. +## +if [ -d ./expat/ ]; then + if [ "$RULE_EXPAT" = "default" ]; then + RULE_EXPAT=yes + fi +else + RULE_EXPAT=no +fi +if [ "$RULE_EXPAT" = "yes" ]; then + EXPATLIB="expat/libexpat.a" + SUBDIRS="expat $SUBDIRS" + CFLAGS="$CFLAGS -DUSE_EXPAT" +fi + +#################################################################### ## Now the SHARED_CHAIN stuff ## LIBS_SHLIB='' @@ -1752,7 +1769,7 @@ #################################################################### ## Now add the target for the main Makefile ## -echo "SUBDIRS=$SUBDIRS" >> Makefile +echo "SUBDIRS=$SUBDIRS modules" >> Makefile echo "SUBTARGET=$SUBTARGET" >> Makefile echo "SHLIB_SUFFIX_NAME=$SHLIB_SUFFIX_NAME" >> Makefile echo "SHLIB_SUFFIX_LIST=$SHLIB_SUFFIX_LIST" >> Makefile @@ -1780,6 +1797,7 @@ echo "LDFLAGS1=$LDFLAGS" >>Makefile.config echo "MFLAGS_STATIC=$MFLAGS_STATIC" >>Makefile.config echo "REGLIB=$REGLIB" >>Makefile.config +echo "EXPATLIB=$EXPATLIB" >>Makefile.config echo "RANLIB=$RANLIB" >>Makefile.config #################################################################### @@ -1895,7 +1913,7 @@ sed -e "s#@@Configuration@@#$file#" "Makefile.tmpl" >>Makefile # xxx/Makefile -MAKEDIRS="support main ap regex $OSDIR" +MAKEDIRS="support $SUBDIRS" for dir in $MAKEDIRS ; do echo Creating Makefile in $dir ./helpers/mfhead $dir $file > $dir/Makefile Index: Makefile.tmpl =================================================================== RCS file: /home/cvs/apache-1.3/src/Makefile.tmpl,v retrieving revision 1.110 diff -u -u -r1.110 Makefile.tmpl --- Makefile.tmpl 1999/03/16 21:37:02 1.110 +++ Makefile.tmpl 1999/04/15 09:59:57 @@ -28,7 +28,7 @@ target_static: subdirs modules.o $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \ - -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(LIBS) + -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(EXPATLIB) $(LIBS) target_compile_only: subdirs modules.o $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c @@ -45,7 +45,7 @@ lib$(TARGET).$(SHLIB_SUFFIX_NAME): subdirs modules.o $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o lib$(TARGET).$(SHLIB_SUFFIX_NAME) buildmark.o $(OBJS) $(REGLIB) + $(LD_SHLIB) $(LDFLAGS_SHLIB) -o lib$(TARGET).$(SHLIB_SUFFIX_NAME) buildmark.o $(OBJS) $(REGLIB) $(EXPATLIB) @if [ ".$(SHLIB_SUFFIX_LIST)" != . ]; then \ rm -f lib$(TARGET).$(SHLIB_SUFFIX_NAME).*; \ for suffix in $(SHLIB_SUFFIX_LIST) ""; do \ Index: main/http_main.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.429 diff -u -u -r1.429 http_main.c --- http_main.c 1999/04/08 21:04:43 1.429 +++ http_main.c 1999/04/15 09:59:58 @@ -6297,4 +6297,12 @@ #endif /* ndef SHARED_CORE_BOOTSTRAP */ +/* force Expat to be linked into the server executable */ +#ifdef USE_EXPAT +#include "xmlparse.h" +const XML_LChar * suck_in_expat(void) +{ + return XML_ErrorString(XML_ERROR_NONE); +} +#endif /* USE_EXPAT */ --------------3694A8DC1325FC9B4B9AE33F--