autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ac_configure_args


From: Sam Steingold
Subject: Re: ac_configure_args
Date: Tue, 12 Oct 2010 13:04:20 -0400

Hello Ralf,
thanks for your speedy and informative response.

On Tue, Oct 12, 2010 at 1:29 AM, Ralf Wildenhues <address@hidden> wrote:
> * 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?
>
> but in your case you could just do
>
>  for arg in @module_configure_flags@

thanks.

>>     CFLAGS* ) continue ;;
>
> Why would you strip out CFLAGS* ?

because I think it is already inherited by sub-configures in the environment.
if you think I don't have to strip it, I won't.

>> [[[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"` ;;

thanks.

here is what I have now, and it seems to work:

# <http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/13368>
# strip out -srcdir* & -cache-file*
keep_next=maybe
module_configure_flags=''
for arg in @module_configure_flags@; do
  case $arg in
    *\'*) arg=`$echo "$arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  esac
  case $keep_next in
    yes ) module_configure_flags="$module_configure_flags '$arg'";
      keep_next=maybe; ;;
    no ) keep_next=maybe; ;;
    maybe ) case $arg in
      --cache-file=* | --srcdir=*) continue ;;
      --cache-file | --srcdir ) keep_next=no; ;;
      *=* ) module_configure_flags="$module_configure_flags '$arg'"; ;;
      *) module_configure_flags="$module_configure_flags '$arg'";
        keep_next=yes; ;;
    esac ;;
  esac
done
unset arg
unset keep_next


-- 
Sam Steingold <http://sds.podval.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]