diff options
author | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-28 02:54:01 +0000 |
---|---|---|
committer | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-28 02:54:01 +0000 |
commit | d07d846542704baab013f28f13a93d23fae00ebc (patch) | |
tree | 1a4ca9649d64f285578a363774d56cb10a0cce66 /build | |
parent | 86e230324cbe58fb2b680cd7b48dd3b858064e3a (diff) | |
download | libapr-d07d846542704baab013f28f13a93d23fae00ebc.tar.gz |
Add a new m4 function APR_EXPAND_VAR that will iteratively
interpolate the contents of a variable, such as $sysconfdir,
for use in a borne script.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63069 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r-- | build/apr_common.m4 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 99623fd40..363d35797 100644 --- a/build/apr_common.m4 +++ b/build/apr_common.m4 @@ -554,4 +554,26 @@ do done ]) +dnl Iteratively interpolate the contents of the second argument +dnl until interpolation offers no new result. Then assign the +dnl final result to $1. +dnl +dnl Example: +dnl +dnl foo=1 +dnl bar='${foo}/2' +dnl baz='${bar}/3' +dnl APR_EXPAND_VAR(fraz, $baz) +dnl $fraz is now "1/2/3" +dnl +AC_DEFUN(APR_EXPAND_VAR,[ +last= +cur=$2 +while test "x$cur" != "x$last"; +do + last=$cur + cur=`eval "echo $cur"` +done +$1=$cur +]) |