You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Thom May <th...@planetarytramp.net> on 2002/03/07 13:27:15 UTC

Re: Config path brokenness

* Brian Havard (brianh@kheldar.apana.org.au) wrote :
> With the current HEAD (configured using --prefix=/Apps/apache2), I get the
> following in my ap_config_auto.h:
> 
> /* Location of the config file, relative to the Apache root directory */
> #define SERVER_CONFIG_FILE "/Apps/apache2/conf/httpd.conf"
> 
> whereas in, say, 2.0.32 it reads:
> 
> /* Location of the config file, relative to the Apache root directory */
> #define SERVER_CONFIG_FILE "conf/httpd.conf"
> 
> 
> What this means is that I can no longer run the server with an alternate
> server root using the -d switch, something I commonly do to test running in
> the build tree without having to make install. It's also commonly used by
> users of binary builds if they want to install to a directory other than
> what the binary builder specified.
> 
> I know this stuff's been hacked at recently, I just want to let people know
> it's not finished yet :)
> 
use -d /path -f /path/to/conf/file 
Cheers,
-Thom

Re: Config path brokenness

Posted by Aaron Bannert <aa...@clove.org>.
On Fri, Mar 08, 2002 at 09:00:41PM +1000, Brian Havard wrote:
> Works for me. I'll commit shortly if nobody has any objections.

Hold off for a bit, we're working on something a little better.

-aaron

Re: Config path brokenness

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Thu, 7 Mar 2002 17:03:40 +0000, Thom May wrote:

>* Aaron Bannert (aaron@clove.org) wrote :
>> On Thu, Mar 07, 2002 at 03:38:59PM +0000, Thom May wrote:
>> 
>
>> I was thinking something more generic:
>> 
>> dnl APR_UNPREPEND_VAR(var, $to_strip)
>> dnl
>> AC_DEFUN(APR_UNPREPEND_VAR(,[
>> orig=$$1
>> to_strip=$2
>> rel=`echo $orig|sed -e "s#^${to_strip}##"`
>> $1=$rel
>> ])
>> 
>I have something similar now working, but with one exception - instead of
>passing a variable to strip, you just pass the name of the variable.

Works for me. I'll commit shortly if nobody has any objections.



>Index: build/apr_common.m4
>===================================================================
>RCS file: /home/cvspublic/apr/build/apr_common.m4,v
>retrieving revision 1.23
>diff -u -u -3 -r1.23 apr_common.m4
>--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
>+++ build/apr_common.m4	7 Mar 2002 16:55:57 -0000
>@@ -577,3 +577,17 @@
> $1=$cur
> ])
> 
>+dnl removes ${to_strip} from the value of a variable
>+dnl giving a relative path rather than an absolute one.
>+dnl
>+dnl Example:
>+dnl
>+dnl foo=${prefix}/bar
>+dnl APR_UNPREPEND_VAR(baz, $foo, prefix)
>+dnl 	$baz is now "bar"
>+AC_DEFUN(APR_UNPREPEND_VAR,[
>+to_strip="\${$3}"
>+abs=$2
>+rel=`echo $abs|sed -e "s#$to_strip/\(.*\)#\1#" -e "s#^/\(.*\)#\1#"`
>+$1=$rel
>+])
>
>
>
>Index: configure.in
>===================================================================
>RCS file: /home/cvspublic/httpd-2.0/configure.in,v
>retrieving revision 1.207
>diff -u -u -3 -r1.207 configure.in
>--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
>+++ configure.in	7 Mar 2002 16:54:18 -0000
>@@ -443,8 +443,8 @@
> APR_EXPAND_VAR(ap_prefix, $prefix)
> AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
> 	[Root directory of the Apache install area])
>-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
>-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
>+APR_UNPREPEND_VAR(rel_sysconfdir, $sysconfdir, prefix)
>+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
> 	[Location of the config file, relative to the Apache root directory])
> AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
> 	[Location of the source for the current MPM])
>

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: Config path brokenness

Posted by Brian Havard <br...@kheldar.apana.org.au>.
On Thu, 7 Mar 2002 17:03:40 +0000, Thom May wrote:

>* Aaron Bannert (aaron@clove.org) wrote :
>> On Thu, Mar 07, 2002 at 03:38:59PM +0000, Thom May wrote:
>> 
>
>> I was thinking something more generic:
>> 
>> dnl APR_UNPREPEND_VAR(var, $to_strip)
>> dnl
>> AC_DEFUN(APR_UNPREPEND_VAR(,[
>> orig=$$1
>> to_strip=$2
>> rel=`echo $orig|sed -e "s#^${to_strip}##"`
>> $1=$rel
>> ])
>> 
>I have something similar now working, but with one exception - instead of
>passing a variable to strip, you just pass the name of the variable.

Works for me. I'll commit shortly if nobody has any objections.



>Index: build/apr_common.m4
>===================================================================
>RCS file: /home/cvspublic/apr/build/apr_common.m4,v
>retrieving revision 1.23
>diff -u -u -3 -r1.23 apr_common.m4
>--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
>+++ build/apr_common.m4	7 Mar 2002 16:55:57 -0000
>@@ -577,3 +577,17 @@
> $1=$cur
> ])
> 
>+dnl removes ${to_strip} from the value of a variable
>+dnl giving a relative path rather than an absolute one.
>+dnl
>+dnl Example:
>+dnl
>+dnl foo=${prefix}/bar
>+dnl APR_UNPREPEND_VAR(baz, $foo, prefix)
>+dnl 	$baz is now "bar"
>+AC_DEFUN(APR_UNPREPEND_VAR,[
>+to_strip="\${$3}"
>+abs=$2
>+rel=`echo $abs|sed -e "s#$to_strip/\(.*\)#\1#" -e "s#^/\(.*\)#\1#"`
>+$1=$rel
>+])
>
>
>
>Index: configure.in
>===================================================================
>RCS file: /home/cvspublic/httpd-2.0/configure.in,v
>retrieving revision 1.207
>diff -u -u -3 -r1.207 configure.in
>--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
>+++ configure.in	7 Mar 2002 16:54:18 -0000
>@@ -443,8 +443,8 @@
> APR_EXPAND_VAR(ap_prefix, $prefix)
> AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
> 	[Root directory of the Apache install area])
>-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
>-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
>+APR_UNPREPEND_VAR(rel_sysconfdir, $sysconfdir, prefix)
>+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
> 	[Location of the config file, relative to the Apache root directory])
> AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
> 	[Location of the source for the current MPM])
>

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Re: Config path brokenness

Posted by Thom May <th...@planetarytramp.net>.
* Aaron Bannert (aaron@clove.org) wrote :
> On Thu, Mar 07, 2002 at 03:38:59PM +0000, Thom May wrote:
> 

> I was thinking something more generic:
> 
> dnl APR_UNPREPEND_VAR(var, $to_strip)
> dnl
> AC_DEFUN(APR_UNPREPEND_VAR(,[
> orig=$$1
> to_strip=$2
> rel=`echo $orig|sed -e "s#^${to_strip}##"`
> $1=$rel
> ])
> 
I have something similar now working, but with one exception - instead of
passing a variable to strip, you just pass the name of the variable.
-Thom


Index: build/apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_common.m4,v
retrieving revision 1.23
diff -u -u -3 -r1.23 apr_common.m4
--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
+++ build/apr_common.m4	7 Mar 2002 16:55:57 -0000
@@ -577,3 +577,17 @@
 $1=$cur
 ])
 
+dnl removes ${to_strip} from the value of a variable
+dnl giving a relative path rather than an absolute one.
+dnl
+dnl Example:
+dnl
+dnl foo=${prefix}/bar
+dnl APR_UNPREPEND_VAR(baz, $foo, prefix)
+dnl 	$baz is now "bar"
+AC_DEFUN(APR_UNPREPEND_VAR,[
+to_strip="\${$3}"
+abs=$2
+rel=`echo $abs|sed -e "s#$to_strip/\(.*\)#\1#" -e "s#^/\(.*\)#\1#"`
+$1=$rel
+])



Index: configure.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/configure.in,v
retrieving revision 1.207
diff -u -u -3 -r1.207 configure.in
--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
+++ configure.in	7 Mar 2002 16:54:18 -0000
@@ -443,8 +443,8 @@
 APR_EXPAND_VAR(ap_prefix, $prefix)
 AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
 	[Root directory of the Apache install area])
-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
+APR_UNPREPEND_VAR(rel_sysconfdir, $sysconfdir, prefix)
+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
 	[Location of the config file, relative to the Apache root directory])
 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
 	[Location of the source for the current MPM])

Re: Config path brokenness

Posted by Thom May <th...@planetarytramp.net>.
* Aaron Bannert (aaron@clove.org) wrote :
> On Thu, Mar 07, 2002 at 03:38:59PM +0000, Thom May wrote:
> 

> I was thinking something more generic:
> 
> dnl APR_UNPREPEND_VAR(var, $to_strip)
> dnl
> AC_DEFUN(APR_UNPREPEND_VAR(,[
> orig=$$1
> to_strip=$2
> rel=`echo $orig|sed -e "s#^${to_strip}##"`
> $1=$rel
> ])
> 
I have something similar now working, but with one exception - instead of
passing a variable to strip, you just pass the name of the variable.
-Thom


Index: build/apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_common.m4,v
retrieving revision 1.23
diff -u -u -3 -r1.23 apr_common.m4
--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
+++ build/apr_common.m4	7 Mar 2002 16:55:57 -0000
@@ -577,3 +577,17 @@
 $1=$cur
 ])
 
+dnl removes ${to_strip} from the value of a variable
+dnl giving a relative path rather than an absolute one.
+dnl
+dnl Example:
+dnl
+dnl foo=${prefix}/bar
+dnl APR_UNPREPEND_VAR(baz, $foo, prefix)
+dnl 	$baz is now "bar"
+AC_DEFUN(APR_UNPREPEND_VAR,[
+to_strip="\${$3}"
+abs=$2
+rel=`echo $abs|sed -e "s#$to_strip/\(.*\)#\1#" -e "s#^/\(.*\)#\1#"`
+$1=$rel
+])



Index: configure.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/configure.in,v
retrieving revision 1.207
diff -u -u -3 -r1.207 configure.in
--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
+++ configure.in	7 Mar 2002 16:54:18 -0000
@@ -443,8 +443,8 @@
 APR_EXPAND_VAR(ap_prefix, $prefix)
 AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
 	[Root directory of the Apache install area])
-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
+APR_UNPREPEND_VAR(rel_sysconfdir, $sysconfdir, prefix)
+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
 	[Location of the config file, relative to the Apache root directory])
 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
 	[Location of the source for the current MPM])

Re: Config path brokenness

Posted by Aaron Bannert <aa...@clove.org>.
On Thu, Mar 07, 2002 at 03:38:59PM +0000, Thom May wrote:
> By way of replying to myself, here's the patches.
> It creates a new macro in ac_common.m4 in apr, APR_STRIP_PREFIX, and uses
> that to generate a relative path.
> 
> This is integrated into confgure.in to give a relative path for
> sysconfigdir.
> 
> Cheers,
> -Thom
> 
> 
> Index: build/apr_common.m4
> ===================================================================
> RCS file: /home/cvspublic/apr/build/apr_common.m4,v
> retrieving revision 1.23
> diff -u -u -3 -r1.23 apr_common.m4
> --- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
> +++ build/apr_common.m4	7 Mar 2002 15:34:27 -0000
> @@ -577,3 +577,16 @@
>  $1=$cur
>  ])
>  
> +dnl removes ${prefix} from the valuable of a variable
> +dnl giving a relative path rather than an absolute one.
> +dnl
> +dnl Example:
> +dnl
> +dnl foo=${prefix}/bar
> +dnl APR_STRIP_PREFIX(baz, $foo)
> +dnl 	$baz is now "bar"
> +AC_DEFUN(APR_STRIP_PREFIX,[
> +abs=$2
> +rel=`echo $abs|sed -e 's#${prefix}/\(.*\)#\1#' -e 's#^/\(.*\)#\1#'`
> +$1=$rel
> +])

I was thinking something more generic:

dnl APR_UNPREPEND_VAR(var, $to_strip)
dnl
AC_DEFUN(APR_UNPREPEND_VAR(,[
orig=$$1
to_strip=$2
rel=`echo $orig|sed -e "s#^${to_strip}##"`
$1=$rel
])

(I have no idea if that would work, or if you can do orig=$$1)

-aaron

Re: Config path brokenness

Posted by Thom May <th...@planetarytramp.net>.
* Thom May (thom@planetarytramp.net) wrote :
> * Ryan Bloom (rbb@covalent.net) wrote :
> > > * Brian Havard (brianh@kheldar.apana.org.au) wrote :
> > > > it's not finished yet :)
> > > >
> > > use -d /path -f /path/to/conf/file
> > 
> > That's not good enough Thom.  The -d must be able to work on its own.
> > That's why we allow relative paths for just about everything.
> > 
> I agree completely. What my message should have said was "this gets you what
> you need for the time being, while I work on a real fix."
> My apologies for this. I am working on getting a real fix in.
> Hopefully I should have it nailled down in the next hour or so.
> Cheers,
> -Thom
> 
By way of replying to myself, here's the patches.
It creates a new macro in ac_common.m4 in apr, APR_STRIP_PREFIX, and uses
that to generate a relative path.

This is integrated into confgure.in to give a relative path for
sysconfigdir.

Cheers,
-Thom


Index: build/apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_common.m4,v
retrieving revision 1.23
diff -u -u -3 -r1.23 apr_common.m4
--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
+++ build/apr_common.m4	7 Mar 2002 15:34:27 -0000
@@ -577,3 +577,16 @@
 $1=$cur
 ])
 
+dnl removes ${prefix} from the valuable of a variable
+dnl giving a relative path rather than an absolute one.
+dnl
+dnl Example:
+dnl
+dnl foo=${prefix}/bar
+dnl APR_STRIP_PREFIX(baz, $foo)
+dnl 	$baz is now "bar"
+AC_DEFUN(APR_STRIP_PREFIX,[
+abs=$2
+rel=`echo $abs|sed -e 's#${prefix}/\(.*\)#\1#' -e 's#^/\(.*\)#\1#'`
+$1=$rel
+])

--

Index: configure.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/configure.in,v
retrieving revision 1.207
diff -u -u -3 -r1.207 configure.in
--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
+++ configure.in	7 Mar 2002 15:33:43 -0000
@@ -443,8 +443,8 @@
 APR_EXPAND_VAR(ap_prefix, $prefix)
 AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
 	[Root directory of the Apache install area])
-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
+APR_STRIP_PREFIX(rel_sysconfdir, $sysconfdir)
+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
 	[Location of the config file, relative to the Apache root directory])
 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
 	[Location of the source for the current MPM])

Re: Config path brokenness

Posted by Thom May <th...@planetarytramp.net>.
* Thom May (thom@planetarytramp.net) wrote :
> * Ryan Bloom (rbb@covalent.net) wrote :
> > > * Brian Havard (brianh@kheldar.apana.org.au) wrote :
> > > > it's not finished yet :)
> > > >
> > > use -d /path -f /path/to/conf/file
> > 
> > That's not good enough Thom.  The -d must be able to work on its own.
> > That's why we allow relative paths for just about everything.
> > 
> I agree completely. What my message should have said was "this gets you what
> you need for the time being, while I work on a real fix."
> My apologies for this. I am working on getting a real fix in.
> Hopefully I should have it nailled down in the next hour or so.
> Cheers,
> -Thom
> 
By way of replying to myself, here's the patches.
It creates a new macro in ac_common.m4 in apr, APR_STRIP_PREFIX, and uses
that to generate a relative path.

This is integrated into confgure.in to give a relative path for
sysconfigdir.

Cheers,
-Thom


Index: build/apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_common.m4,v
retrieving revision 1.23
diff -u -u -3 -r1.23 apr_common.m4
--- build/apr_common.m4	28 Feb 2002 02:54:01 -0000	1.23
+++ build/apr_common.m4	7 Mar 2002 15:34:27 -0000
@@ -577,3 +577,16 @@
 $1=$cur
 ])
 
+dnl removes ${prefix} from the valuable of a variable
+dnl giving a relative path rather than an absolute one.
+dnl
+dnl Example:
+dnl
+dnl foo=${prefix}/bar
+dnl APR_STRIP_PREFIX(baz, $foo)
+dnl 	$baz is now "bar"
+AC_DEFUN(APR_STRIP_PREFIX,[
+abs=$2
+rel=`echo $abs|sed -e 's#${prefix}/\(.*\)#\1#' -e 's#^/\(.*\)#\1#'`
+$1=$rel
+])

--

Index: configure.in
===================================================================
RCS file: /home/cvspublic/httpd-2.0/configure.in,v
retrieving revision 1.207
diff -u -u -3 -r1.207 configure.in
--- configure.in	7 Mar 2002 00:23:30 -0000	1.207
+++ configure.in	7 Mar 2002 15:33:43 -0000
@@ -443,8 +443,8 @@
 APR_EXPAND_VAR(ap_prefix, $prefix)
 AC_DEFINE_UNQUOTED(HTTPD_ROOT, "${ap_prefix}",
 	[Root directory of the Apache install area])
-APR_EXPAND_VAR(ap_sysconfdir, $sysconfdir)
-AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${ap_sysconfdir}/${progname}.conf",
+APR_STRIP_PREFIX(rel_sysconfdir, $sysconfdir)
+AC_DEFINE_UNQUOTED(SERVER_CONFIG_FILE, "${rel_sysconfdir}/${progname}.conf",
 	[Location of the config file, relative to the Apache root directory])
 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
 	[Location of the source for the current MPM])

Re: Config path brokenness

Posted by Thom May <th...@planetarytramp.net>.
* Ryan Bloom (rbb@covalent.net) wrote :
> > * Brian Havard (brianh@kheldar.apana.org.au) wrote :
> > > it's not finished yet :)
> > >
> > use -d /path -f /path/to/conf/file
> 
> That's not good enough Thom.  The -d must be able to work on its own.
> That's why we allow relative paths for just about everything.
> 
I agree completely. What my message should have said was "this gets you what
you need for the time being, while I work on a real fix."
My apologies for this. I am working on getting a real fix in.
Hopefully I should have it nailled down in the next hour or so.
Cheers,
-Thom

RE: Config path brokenness

Posted by Ryan Bloom <rb...@covalent.net>.
> * Brian Havard (brianh@kheldar.apana.org.au) wrote :
> > With the current HEAD (configured using --prefix=/Apps/apache2), I
get
> the
> > following in my ap_config_auto.h:
> >
> > /* Location of the config file, relative to the Apache root
directory */
> > #define SERVER_CONFIG_FILE "/Apps/apache2/conf/httpd.conf"
> >
> > whereas in, say, 2.0.32 it reads:
> >
> > /* Location of the config file, relative to the Apache root
directory */
> > #define SERVER_CONFIG_FILE "conf/httpd.conf"
> >
> >
> > What this means is that I can no longer run the server with an
alternate
> > server root using the -d switch, something I commonly do to test
running
> in
> > the build tree without having to make install. It's also commonly
used
> by
> > users of binary builds if they want to install to a directory other
than
> > what the binary builder specified.
> >
> > I know this stuff's been hacked at recently, I just want to let
people
> know
> > it's not finished yet :)
> >
> use -d /path -f /path/to/conf/file

That's not good enough Thom.  The -d must be able to work on its own.
That's why we allow relative paths for just about everything.

Ryan