autoconf
[Top][All Lists]
Advanced

[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 20:27:45 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Sam,

* Sam Steingold wrote on Tue, Oct 12, 2010 at 07:04:20PM CEST:
> On Tue, Oct 12, 2010 at 1:29 AM, Ralf Wildenhues wrote:
> > * Sam Steingold wrote on Tue, Oct 12, 2010 at 12:20:22AM CEST:
> >> Ralf Wildenhues wrote:
> >>     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.

If I use
  ./configure CFLAGS=-foo

(which is the recommended way to do it) then it won't be added to the
environment.

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

This looks better to me.

> # <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; ;;

If you want to get the keep_next logic right, I'm afraid you'll have to
do it the way it is done in autoconf/general.m4:_AC_INIT_PREPARE.  I
don't think there is another place where all possible non-separated args
are enumerated.  Sorry for not seeing this earlier.

>     esac ;;
>   esac
> done
> unset arg
> unset keep_next

Cheers,
Ralf



reply via email to

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