This is the mail archive of the cygwin mailing list for the Cygwin 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: GCC / make escaping differences


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


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