This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: GCC / make escaping differences
- From: Csaba Raduly <rcsaba at gmail dot com>
- To: cygwin list <cygwin at cygwin dot com>
- Cc: Achim Gratz <Stromeko at nexgo dot de>
- Date: Sun, 15 Mar 2015 11:08:51 +0100
- Subject: Re: GCC / make escaping differences
- Authentication-results: sourceware.org; auth=none
- References: <DB3PR05MB0763302D3CA95D5946191175A2070 at DB3PR05MB0763 dot eurprd05 dot prod dot outlook dot com> <loom dot 20150313T105904-476 at post dot gmane dot org> <DB3PR05MB0763BDE3650C3BC4F4C97A65A2070 at DB3PR05MB0763 dot eurprd05 dot prod dot outlook dot com>
Hi Denis,
On Fri, Mar 13, 2015 at 12:20 PM, Denis Washington wrote:
> Achim Gratz writes:
>> Denis Washington <denis <at> denisw.de> writes:
>> > I suspected that this had something to do with the gcc command defined in
>> the Makefile, which includes
>> > backslashes to escape quotes in -D values like this:
>> >
>> > -DNOKOGIRI_LIBXML2_PATH\=\"/home/.../2.9.2\"
>> -----------------------------^
>>
>> I'd rather suspect the problem here.
>
> Maybe, but in my eyes that wouldn't explain why this is a GCC compilation error at the line where NOKOGIRI_LIBXML2_PATH is expanded, rather than an shell syntax error. Also, \= seems to cause no problem when passed to bash, as explained.
>
> FYI, my understanding from looking at Nokogiri's extconf.rb (which generates the Makefile) is that the escaping is the result of calling Ruby's Shellwords#shellescape method [1] on the string '-DNOKOGIRI="/home/.../2.9.2"', so I guess one can assume that the result is valid bourne shell syntax.
>
> Regards,
> Denis
>
> [1] http://ruby-doc.org/stdlib-1.9.3/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellescape
>
If you are really curious, you can add the -save-temps switch to the
gcc command line. Then you can look at the nokogiri.i and see exactly
what the compiler saw.
Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple