This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix quoting of program-transform-name in toplevel configure


Geoffrey Keating <geoffk@apple.com> writes:

> On Wednesday, August 20, 2003, at 11:53  PM, Phil Edwards wrote:
>
>> On Thu, Aug 21, 2003 at 06:44:49AM +0200, Andreas Tobler wrote:
>>> Geoffrey Keating wrote:
>>> +# Export original configure arguments for use by sub-configures.
>>> These
>>> +# will be expanded once by make, and once by the shell, so they need
>>> to
>>> +# have '$' quoted for make, and then each argument quoted for the
>>> shell.
>>> +# What's more, the 'echo' below might expand backslashes.
>>> +cat <<\EOF_SED > conftestsed
>>> +s,\\,\\\\,g; s,\$,$$,g
>>> +EOF_SED
>>> +tmp="'$progname'"
>>> +for ac_arg ; do    <--------------------------------
>>>
>>> Solaris native complains about unexpected ; at line 805.
>>
>> Yep.  If the "no list given so assume the program args" form of 'for'
>> is to be used, it has to be
>>
>>     for ac_arg
>>     do
>>
>> i.e., semicolon and newline aren't equivalent.

Actually the POSIX sh grammer does not allow a semicolon here, only a
newline, thus this should be just "for arc_arg do ...".

for_clause : For name linebreak do_group
           | For name linebreak in sequential_sep do_group
           | For name linebreak in wordlist sequential_sep do_group
           ;

linebreak : newline_list
          | /* empty */
          ;

sequential_sep : ';' linebreak
               | newline_list
               ;

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]