[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ac_configure_args
From: |
Ralf Wildenhues |
Subject: |
Re: ac_configure_args |
Date: |
Tue, 12 Oct 2010 07:29:16 +0200 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Hello Sam,
* Sam Steingold wrote on Tue, Oct 12, 2010 at 12:20:22AM CEST:
> Ralf Wildenhues wrote:
> >$srcdir/subdir/configure @module_configure_flags@
>
> what is the right way to quote it?
Exactly the way I wrote above. If you don't want to execute a script
with the arguments, you could replace $srcdir/subdir/configure with,
say, set:
set x @module_configure_flags@
shift
but in your case you could just do
for arg in @module_configure_flags@
do
...
done
> # strip out -srcdir* & -cache-file*
> tmp=""
> keep_next=maybe
> for arg in $module_configure_flags; do
> case $arg in
> CFLAGS* ) continue ;;
Why would you strip out CFLAGS* ?
> [[[line 205]]] *\'*) arg="`$echo "$arg" | sed "s/'/'\\\\\\\\''/g"`" ;;
This line is quoted wrongly, nested double-quotes within double-quoted
backticks are not portable. The Autoconf manual has all the details.
The portable variant of that is:
*\'*) arg=`$echo "$arg" | sed "s/'/'\\\\\\\\''/g"` ;;
(of course, assuming an $echo which doesn't interpret backslashes or
leading hyphens). Please don't try to be smarter than the code you're
copying from.
> esac
> case $keep_next in
> yes ) tmp="$tmp '$arg'"; keep_next=maybe; ;;
You don't need ';' before ';;', but I have no idea whether that is
unportable (several instances).
> no ) keep_next=maybe; ;;
> maybe ) case $arg in
> --cache-file=* | --srcdir=*) continue ;;
> --cache-file | --srcdir ) keep_next=no; ;;
> *=* ) tmp="$tmp '$arg'"; ;;
> *) tmp="$tmp '$arg'"; keep_next=yes; ;;
> esac ;;
> esac
> done
> module_configure_flags="$tmp"
Cheers,
Ralf