You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sander Temme <sc...@apache.org> on 2005/09/12 08:26:04 UTC

[semi-PATCH] Allow out-of-tree apr/apu source

Folks,

Trying to scratch a personal itch tonight. I'd like to build my  
checked out tree against a checkout of {apr,apu}, which sit somewhere  
else on my system. As far as I can tell, this is currently not  
possible. I tried to point buildconf to my working copies: it borks.  
The following patch to buildconf (also attached) unborks:

Index: buildconf
===================================================================
--- buildconf    (revision 280240)
+++ buildconf    (working copy)
@@ -128,22 +128,22 @@
cross_compile_warning="warning: AC_TRY_RUN called without default to  
allow cross compiling"
-if [ -d srclib/apr ]; then
+if [ -d ${apr_src_dir} ]; then
      echo rebuilding $apr_configure
-    (cd srclib/apr && ./buildconf) || {
+    (cd ${apr_src_dir} && ./buildconf) || {
          echo "./buildconf failed for apr"
          exit 1
      }
-    rm -f srclib/apr/apr.spec
+    rm -f ${apr_src_dir}/apr.spec
fi
-if [ -d srclib/apr-util ]; then
+if [ -d ${apu_src_dir} ]; then
      echo rebuilding $aprutil_configure
-    (cd srclib/apr-util && ./buildconf) || {
+    (cd ${apu_src_dir} && ./buildconf --with-apr=${apr_src_dir}) || {
          echo "./buildconf failed for apr-util"
          exit 1
      }
-    rm -f srclib/apr-util/apr-util.spec
+    rm -f ${apu_src_dir}/apr-util.spec
fi
echo copying build files

I'm simply removing the hardcoded references to srclib/ap{r,u}.  
However, this is only part of the fix: httpd's configure also needs  
to know where to find apr and apu. Perhaps there's more, deeper down.  
I have to meditate on my m4-fu before I attempt this, but first I'd  
like to run the use cases by the community. Yes, that's you.

Where could APR and APR-Util be?

1) In-tree. This is the case for released tarballs.
    srclib/apr
    srclib/apr-util
    Builder may still want to override.

2) Installed on the system. Httpd should not depend on in-tree APR or
    APR-Util at any level. The buildconf script of httpd should
    gracefully deal with absence of in-tree APR and APR-Util. Httpd's
    ./configure has to point to APR and APR-Util, or find in
    usual location (/usr/local/apr, /usr/local, /usr, ...)

3) Unbuilt source tree in arbitrary directory. These have valid
    ./configure scripts. Httpd's ./configure has to point to APR and
    APR-Util and roll with it.

4) Checked out tree in arbitary directory. Httpd's buildconf script
    should point to APR and APR-Util source trees and run their
    buildconf scripts. Resulting httpd ./configure should inherit APR
    and APR-Util locations.

5) ...

Please comment/embellish.

Thanks,

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


Re: [semi-PATCH] Allow out-of-tree apr/apu source

Posted by Sander Temme <sc...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sep 12, 2005, at 10:10 AM, William A. Rowe, Jr. wrote:

> Patrick Welche wrote:
>> On Mon, Sep 12, 2005 at 10:59:07AM +0100, Joe Orton wrote:
>>> On Sun, Sep 11, 2005 at 11:26:04PM -0700, Sander Temme wrote:
>>>> Trying to scratch a personal itch tonight. I'd like to build my   
>>>> checked out tree against a checkout of {apr,apu}, which sit  
>>>> somewhere  else on my system. As far as I can tell, this is  
>>>> currently not  possible. I tried to point buildconf to my  
>>>> working copies: it borks.  The following patch to buildconf  
>>>> (also attached) unborks:
>>>
>>> You have to buildconf both the apr and apr-util source trees before
>>> doing so in the httpd tree, which is not unreasonable IMO.  I  
>>> think it'd
>>> be surprising behaviour for the httpd buildconf to go and  
>>> regenerate the
>>> configure script in the external directories so -0 on the patch.

Hm... IMHO the buildconf should propagate into APR and APU. Why do  
you run buildconf? Probably because something changed in your M4  
macro collection or you need to suck in alternative auto*;libtool  
foo. I think you need you entire tree at the same level of autofoo:  
updating httpd and leaving apr/apu at a different revision may  
introduce unwanted side effects.


>> I think the problem is that although buildconf claims to look in  
>> srclib/apr
>> and ../apr, configure.in only runs APR_FIND_APR on srclib/apr, so  
>> never
>> looks in ../apr. I have been running with the attached patch instead,
>> but I think the aim is the same.. (There is a problem here..)

If I read your patch correctly, it will configure every APR source  
tree it finds, and ../apr-util twice. I'm thinking more along the  
lines of sucking the apr_src_dir variable used in buildconf into the  
M4 substitution of autoconf, and configuring only that one. That's  
all we need. Now, how to suck that value in? Probably export it in  
buildconf, then use some env-substitute-m4 fu?


> What's significant about ../apr though?  It's outside our build  
> tree, so
> shouldn't be in the list of 'default paths'.

It's as arbitrary as ../apr/apr/trunk, which is where my checkout  
sits. I'm kinda mirroring the svn layout for no good reason at all.


> Doesn't
>
> ./buildconf --with-apr=../apr

Currently not, because elsewhere in buildconf it hardcodes srclib/ 
apr, and apu's buildconf needs to be fed the --with-aprparameter. My  
patch fixes this, but it needs additional work on configure.in.

As I said, I'm scratching my own itch here. My particular working  
copy layout is completely arbitrary and I won't (and can't) force any  
particular configuration upon anyone. What I do want to achieve is  
that the --with-apr and --with-apr-util parameters to buildconf work  
as advertised, and propagate down to a buildable configuration.

S.

- --
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFDJdNMnjkrwtLH+RIRAnNwAJ97sPLbuoN4XfgVEr23vBtPsryV5ACfWaqq
Yp3mFXibftvFlixpScN22V4=
=nMCJ
-----END PGP SIGNATURE-----

Re: [semi-PATCH] Allow out-of-tree apr/apu source

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Patrick Welche wrote:
> On Mon, Sep 12, 2005 at 10:59:07AM +0100, Joe Orton wrote:
> 
>>On Sun, Sep 11, 2005 at 11:26:04PM -0700, Sander Temme wrote:
>>
>>>Trying to scratch a personal itch tonight. I'd like to build my  
>>>checked out tree against a checkout of {apr,apu}, which sit somewhere  
>>>else on my system. As far as I can tell, this is currently not  
>>>possible. I tried to point buildconf to my working copies: it borks.  
>>>The following patch to buildconf (also attached) unborks:
>>
>>You have to buildconf both the apr and apr-util source trees before
>>doing so in the httpd tree, which is not unreasonable IMO.  I think it'd
>>be surprising behaviour for the httpd buildconf to go and regenerate the
>>configure script in the external directories so -0 on the patch.
> 
> 
> I think the problem is that although buildconf claims to look in srclib/apr
> and ../apr, configure.in only runs APR_FIND_APR on srclib/apr, so never
> looks in ../apr. I have been running with the attached patch instead,
> but I think the aim is the same.. (There is a problem here..)

What's significant about ../apr though?  It's outside our build tree, so
shouldn't be in the list of 'default paths'.

Doesn't

./buildconf --with-apr=../apr

solve your problems?  We can certainly expand the arg to a full path, if
that's an issue, and also we really should set up ./configure so that
you don't have to re-declare --with-apr all over again after providing
that to buildconf.

I'd offer another comprimize, though, if you want to treat the httpd's
parent directory as 'srclib'.  What about --with-srclib=..   ?

Bill

Re: [semi-PATCH] Allow out-of-tree apr/apu source

Posted by Patrick Welche <pr...@newn.cam.ac.uk>.
On Mon, Sep 12, 2005 at 10:59:07AM +0100, Joe Orton wrote:
> On Sun, Sep 11, 2005 at 11:26:04PM -0700, Sander Temme wrote:
> > Trying to scratch a personal itch tonight. I'd like to build my  
> > checked out tree against a checkout of {apr,apu}, which sit somewhere  
> > else on my system. As far as I can tell, this is currently not  
> > possible. I tried to point buildconf to my working copies: it borks.  
> > The following patch to buildconf (also attached) unborks:
> 
> You have to buildconf both the apr and apr-util source trees before
> doing so in the httpd tree, which is not unreasonable IMO.  I think it'd
> be surprising behaviour for the httpd buildconf to go and regenerate the
> configure script in the external directories so -0 on the patch.

I think the problem is that although buildconf claims to look in srclib/apr
and ../apr, configure.in only runs APR_FIND_APR on srclib/apr, so never
looks in ../apr. I have been running with the attached patch instead,
but I think the aim is the same.. (There is a problem here..)

Cheers,

Patrick

Re: [semi-PATCH] Allow out-of-tree apr/apu source

Posted by Joe Orton <jo...@redhat.com>.
On Sun, Sep 11, 2005 at 11:26:04PM -0700, Sander Temme wrote:
> Trying to scratch a personal itch tonight. I'd like to build my  
> checked out tree against a checkout of {apr,apu}, which sit somewhere  
> else on my system. As far as I can tell, this is currently not  
> possible. I tried to point buildconf to my working copies: it borks.  
> The following patch to buildconf (also attached) unborks:

You have to buildconf both the apr and apr-util source trees before
doing so in the httpd tree, which is not unreasonable IMO.  I think it'd
be surprising behaviour for the httpd buildconf to go and regenerate the
configure script in the external directories so -0 on the patch.

> I'm simply removing the hardcoded references to srclib/ap{r,u}.  
> However, this is only part of the fix: httpd's configure also needs  
> to know where to find apr and apu. Perhaps there's more, deeper down.  
> I have to meditate on my m4-fu before I attempt this, but first I'd  
> like to run the use cases by the community. Yes, that's you.

I can't really see why it is useful to support building httpd against an 
external *unbuilt* apr/apr-util source tree?  Why not just build the 
external packages first and install them and then configure --with-apr 
--with-apr-util as normal?

Regards,

joe