]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use an installed Expat when available, rather than the builtin one.
authorGreg Stein <gstein@apache.org>
Wed, 3 Oct 2001 12:59:03 +0000 (12:59 +0000)
committerGreg Stein <gstein@apache.org>
Wed, 3 Oct 2001 12:59:03 +0000 (12:59 +0000)
Presuming the installed one is a shared library, then this should resolve
some of the longstanding issues with mod_perl / XML::Parser::Expat.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@91252 13f79535-47bb-0310-9956-ffa450edef68

src/Configure

index e044b841377a1fc80be3c46b0b24a92a5d719187..3e3a0f2798e20c2f7222a7f8ec9949745b4e8bb5 100755 (executable)
@@ -1834,22 +1834,31 @@ fi
 ####################################################################
 ## Add in the Expat library if needed/wanted.
 ##
-if [ -d ./lib/expat-lite/ ]; then
-    if [ "x$RULE_EXPAT" = "xdefault" ]; then
+
+# set the default, based on whether expat-lite is bundled. if it is present,
+# then we can always include expat.
+if [ "x$RULE_EXPAT" = "xdefault" ]; then
+    if [ -d ./lib/expat-lite/ ]; then
         RULE_EXPAT=yes
-    fi
-else
-    if [ "$xRULE_EXPAT" = "xyes" ]; then
-        echo "ERROR: RULE_EXPAT set to \"yes\" but is not available."
-       exit 1
     else
         RULE_EXPAT=no
     fi
 fi
+
 if [ "x$RULE_EXPAT" = "xyes" ]; then
-    EXPATLIB="lib/expat-lite/libexpat.a"
-    APLIBDIRS="expat-lite $APLIBDIRS"
-    CFLAGS="$CFLAGS -DUSE_EXPAT -I\$(SRCDIR)/lib/expat-lite"
+    if ./helpers/TestCompile lib expat; then
+        echo " + using system Expat"
+        LIBS="$LIBS -lexpat"
+    else
+        if [ "$xRULE_EXPAT" = "xyes" ]; then
+            echo "ERROR: RULE_EXPAT set to \"yes\" but is not available."
+           exit 1
+        fi
+        echo " + using builtin Expat"
+        EXPATLIB="lib/expat-lite/libexpat.a"
+        APLIBDIRS="expat-lite $APLIBDIRS"
+        CFLAGS="$CFLAGS -DUSE_EXPAT -I\$(SRCDIR)/lib/expat-lite"
+    fi
 fi
 
 ####################################################################