This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [toplevel] Fix argument quoting for subconfigures
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gcc-patches at gcc dot gnu dot org, binutils at sources dot redhat dot com,gdb-patches at sources dot redhat dot com, geoffk at geoffk dot org
- Date: Sun, 14 Sep 2003 21:44:50 -0400
- Subject: Re: [toplevel] Fix argument quoting for subconfigures
- References: <20030914145716.GA18402@nevyn.them.org>
On Sun, Sep 14, 2003 at 10:57:17AM -0400, Daniel Jacobowitz wrote:
> This patch is for GCC PR driver/12201.
>
> A couple problems in recent changes to the quoting. Backslashes were being
> doubled, which is wrong as far as I can see - I believe that change was
> based on a similar autoconf-generated fragment for program_transform_name,
> which _does_ actually need backslashes doubled. Also, a single apostrophe
> was being added to each argument.
>
> I've also switched to the idiom suggested by Andreas: don't pass configure
> arguments to echo in case echo expands backslashes. Use cat and a here-doc
> instead. Unfortunately, if your echo does expand backslashes this won't fix
> the problem. Despite their own advice in the autoconf manual, autoconf
> generates code that passes user-supplied strings to echo. That's a problem
> for another day.
>
> So, using bash, this allows me to pass a program-transform-name containing
> both dollar signs and backslashes to configure and get the right arguments
> in subdir makefiles. It also fixes up the extra apostrophes in gcc -v
> output. OK?
Curses. Geoff pointed out that TOPLEVEL_CONFIGURE_ARGUMENTS is
expanded inside of double quotes; this causes the quoting to get
confused. This patch doesn't fix that. I believe everything was also
wrong before; we doubled backslashes, but that didn't do anything to
stop dollar signs from being interpreted. So I'm not withdrawing this
patch; we can fix that separately.
I wish that the top level required GNU make. But I think putting an
"export" directive into it would confuse non-GNU make.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer