Bug 29740 - --with-apr=/usr is broken
Summary: --with-apr=/usr is broken
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Build (show other bugs)
Version: 2.0.49
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2004-06-22 15:50 UTC by Max Bowsher
Modified: 2005-02-03 15:39 UTC (History)
1 user (show)



Attachments
The same patch as inline, but attached to avoid line-wrapping (902 bytes, patch)
2004-06-22 15:56 UTC, Max Bowsher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Bowsher 2004-06-22 15:50:04 UTC
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
Comment 1 Max Bowsher 2004-06-22 15:56:42 UTC
Created attachment 11910 [details]
The same patch as inline, but attached to avoid line-wrapping
Comment 2 Sergey A. Lipnevich 2004-06-26 15:54:55 UTC
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
Comment 3 Paul Querna 2004-11-04 03:13:28 UTC
most reasonable places have the APR headers installed to /usr/include/apr-{0,1}
don't they?
Comment 4 Max Bowsher 2004-11-04 12:30:07 UTC
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.
Comment 5 Max Bowsher 2004-11-04 12:32:03 UTC
Replying to Sergey A. Lipnevich above:

AFAICS your patches are about an entirely unrelated issue.
Comment 6 Graham Leggett 2004-11-04 12:43:15 UTC
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.
Comment 7 Justin Erenkrantz 2005-02-04 00:39:38 UTC
Applied in r151255.  Thanks!