httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thom May <t...@planetarytramp.net>
Subject Re: Config path brokenness
Date Thu, 07 Mar 2002 15:38:59 GMT
* 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])

Mime
View raw message