Bug 43345 - --with-expat=xml/expat broken in configure
Summary: --with-expat=xml/expat broken in configure
Status: RESOLVED WONTFIX
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.2.11
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-09-10 11:48 UTC by Rainer Jung
Modified: 2007-10-10 08:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2007-09-10 11:48:41 UTC
The apr-util bundled with Apache httpd 2.2.6 changed behaviour for the
--with-expat switch of configure. Previously it was allowed to use
--with-expat=xml/expat to compile the bundled expat, now only
--with-expat=builtin does this.

The change was done in r493791 as a fix to BZ
http://issues.apache.org/bugzilla/show_bug.cgi?id=28205.

Strictly speaking it is nowhere documented, that a value of xml/expat should be
used for building with the internal version, but it worked like this for a long
time, and still is the most logical interpretation of this value.

Problem analysis: in file apr-util/build/apu-conf.m4 there is now:

    125 AC_DEFUN([APU_FIND_EXPAT], [
    126
    127 apu_has_expat=0
    128
    129 # Default: will use either external or bundled expat.
    130 apu_try_external_expat=1
    131 apu_try_builtin_expat=1

OK, we allow building with builtin expat

    132
    133 AC_ARG_WITH([expat],
    134 [  --with-expat=DIR        specify Expat location, or 'builtin'], [
    135   if test "$withval" = "yes"; then
    136     AC_MSG_ERROR([a directory must be specified for --with-expat])
    137   elif test "$withval" = "no"; then
    138     AC_MSG_ERROR([Expat cannot be disabled (at this time)])
    139   elif test "$withval" = "builtin"; then
    140     apu_try_external_expat=0
    141   else

if we gave a path to configure, like xml/expat, we get into this part

    142     # Add given path to standard search paths if appropriate:
    143     if test "$withval" != "/usr"; then
    144       APR_ADDTO(LDFLAGS, [-L$withval/lib])
    145       APR_ADDTO(CPPFLAGS, [-I$withval/include])
    146       APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
    147     fi
    148     # ...and refuse to fall back on the builtin expat.
    149     apu_try_builtin_expat=0

and we disable use of the builtin variant.

    150   fi
    151 ])
    152

I think, apu_try_builtin_expat should only be set to "0", if withval is !=
"xml/expat". Possible patch would be:

--- build/apu-conf.m4.orig      2007-09-10 13:00:21.000000000 +0200
+++ build/apu-conf.m4   2007-09-10 20:36:46.000000000 +0200
@@ -146,7 +146,11 @@
       APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include])
     fi
     # ...and refuse to fall back on the builtin expat.
-    apu_try_builtin_expat=0
+    if test "$withval" != "xml/expat"; then
+      apu_try_builtin_expat=0
+    else
+      apu_try_external_expat=0
+    fi
   fi
 ])
Comment 1 Rainer Jung 2007-09-11 02:48:44 UTC
This problem actually occured with the most recently tagged version (bundled
with httpd 2.2.6), which is not yet available in the bugzilla version list.
Comment 2 Joe Orton 2007-10-10 08:53:12 UTC
Sorry, but this was intentional.  Passing paths to unbuilt expat versions is
undocumented, as you say, and is unsupportable in general - there is no way to
work out what version/type of the bundled expat.