Configuring with --with-apr=/usr usually fails. This is because: The generated exports.c #includes all *.h files found in <apr-prefix>/include If <apr-prefix> == /usr , then this means /usr/include/*.h !!! On most systems, it's quite likely that some of these are C++ headers, or have conflicting definitions, so breaking the build. The solution is to only include apr and apr-util headers from the apr and apr-util include directories. This is easy to do, as apr and apr-util headers follow a consistent naming scheme. Here is a patch, to include only apr.h, apu.h, apr_*.h, and apu_*.h from the apr and apr-util include directories. It is against httpd-2.0.49 (current release), but it applies without conflict to current 2.0-HEAD and 2.1-HEAD. --- httpd-2.0.49/server/Makefile.in.orig 2004-06-21 01:00:42.308012800 +0100 +++ httpd-2.0.49/server/Makefile.in 2004-06-21 01:14:25.131174400 +0100 @@ -31,7 +31,8 @@ util.lo: test_char.h -EXPORT_DIRS = $(top_srcdir)/include $(top_srcdir)/os/$(OS_DIR) $(APR_INCLUDEDIR) $(APU_INCLUDEDIR) $(top_srcdir)/modules/http +EXPORT_DIRS = $(top_srcdir)/include $(top_srcdir)/os/$(OS_DIR) $(top_srcdir)/modules/http +EXPORT_DIRS_APR = $(APR_INCLUDEDIR) $(APU_INCLUDEDIR) # If export_files is a dependency here, but we remove it during this stage, # when exports.c is generated, make will not detect that export_files is no @@ -58,6 +59,10 @@ for dir in $(EXPORT_DIRS); do \ ls $$dir/*.h >> $$tmp; \ done; \ + for dir in $(EXPORT_DIRS_APR); do \ + ls $$dir/ap[ru].h >> $$tmp 2>/dev/null; \ + ls $$dir/ap[ru]_*.h >> $$tmp 2>/dev/null; \ + done; \ sort -u $$tmp > $@; \ rm -f $$tmp
Created attachment 11910 [details] The same patch as inline, but attached to avoid line-wrapping
We have had similar problems trying to build APR, APU, and then HTTPD all by themselves, in Source Mage GNU/Linux. Our patches are here: http://codex.sourcemage.org/test/libs/apr/build.diff http://codex.sourcemage.org/test/libs/apr-util/build.diff
most reasonable places have the APR headers installed to /usr/include/apr-{0,1} don't they?
Replying to Paul Querna above: Installing to <prefix>/include is the default in apr. For httpd to be incompatible with the default build and install of apr seems rather wrong to me. Besides, just because the bug won't affect some environments doesn't mean it shouldn't be fixed, especially when fixing it only requires a tiny patch, which I have already written and attached to the bug.
Replying to Sergey A. Lipnevich above: AFAICS your patches are about an entirely unrelated issue.
APR must be able to find it's headers if they are installed in /usr/include or in /usr/include/apr-{0,1}, which is where APR v1.0 seems to want to put them. Fixing this bug allows httpd v2.1 to be built as an RPM again.
Applied in r151255. Thanks!