summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2012-10-19 12:09:37 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-19 14:24:21 +0700
commit670283ee701b1e8b781e8250ccf4911443e683eb (patch)
tree4ec9fd4f763d2c8e579edf8172e33502cd516b86 /bootstrap
parent25b3dda2161d2893c0d642ace0ec13297dfbe835 (diff)
downloadlibtool-670283ee701b1e8b781e8250ccf4911443e683eb.tar.gz
bootstrap: extract *first* ACLOCAL_AMFLAGS -I argument.
* bootstrap (func_require_macro_dir): .* is greedy, so _G_sed_scan as it was will always return the last -I argument, which is wrong. Move to a shell loop to ensure we always get the first -I argument if any. (code from libtoolize.in). Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap13
1 files changed, 9 insertions, 4 deletions
diff --git a/bootstrap b/bootstrap
index cdcdf4ce..3eff6405 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1492,10 +1492,15 @@ func_require_macro_dir ()
test -n "$macro_dir" || {
$require_aclocal_amflags
- _G_sed_scan='s|^.*-I[ ]*\([^ ]*\) .*|\1|'
-
- # Trailing space in echo is required by the sed script.
- macro_dir=`echo "$aclocal_amflags " |$SED "$_G_sed_scan"`
+ # Take the argument following the first '-I', if any.
+ _G_minus_I_seen=false
+ for _G_arg in $aclocal_amflags; do
+ case $_G_minus_I_seen,$_G_arg in
+ :,*) macro_dir=$_G_arg; break ;;
+ *,-I) _G_minus_I_seen=: ;;
+ *,-I*) macro_dir=`expr x$_G_arg : 'x-I\(.*\)$'`; break ;;
+ esac
+ done
}
func_verbose "macro_dir='$macro_dir'"