PATCH: Fix config-ml.in (take 2)

H. J. Lu hjl@lucon.org
Thu Oct 2 14:48:00 GMT 2003


On Thu, Oct 02, 2003 at 06:37:48AM -0300, Alexandre Oliva wrote:
> On Oct  1, 2003, "H. J. Lu" <hjl@lucon.org> wrote:
> 
> > It turns out that not all configures can take FOO=bar. This patch
> > passes ${ml_config_env} only if ${ml_arguments} has some FOO=bar.
> 
> Note that ml_config_env is already passed down as part of the
> environment:
> > -    if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
>                ^^^^^^^^^^^^^^^^
> 
> This *should* be enough, and roughly equivalent to passing the
> settings as arguments to configure scripts that support them.

It is not enough, depending on configure. configure in libiberty has

for ac_option
do
...
  *=*)
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    # Reject names that are not valid shell variable names.
    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
   { (exit 1); exit 1; }; }
    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
    eval "$ac_envvar='$ac_optarg'"
    export $ac_envvar ;;
...
done

If CC=foo is in $ac_configure_args, it will override the one in
environment.


H.J.



More information about the Binutils mailing list