From: djberg96@... (Daniel Berger) Date: 2004-06-25T21:38:11+09:00 Subject: Re: Problem with mkmf and spaces in directory names? nobu.nokada@softhome.net wrote in message news:<200406250254.i5P2sJtK003642@sharui.nakada.niregi.kanuma.tochigi.jp>... > Hi, > > At Fri, 25 Jun 2004 10:28:06 +0900, > Daniel Berger wrote in [ruby-talk:104505]: > > However, everything works fine if I install expat in c:\expat. So, it > > looks like the space in the directory name is causing a problem. Is > > this a problem with mkmf.rb or is it a bug in the Windows linker? > > It's a known restriction, but... it may be nasty. Can you try > this patch? > > > * lib/mkmf.rb (libpathflag, dir_config): quote directory names if > necessary. [ruby-talk:104505] > > > Index: lib/mkmf.rb > =================================================================== > RCS file: /pub/cvs/ruby/src/ruby/lib/mkmf.rb,v > retrieving revision 1.162.2.13 > diff -U2 -p -d -r1.162.2.13 mkmf.rb > --- lib/mkmf.rb 20 May 2004 08:02:11 -0000 1.162.2.13 > +++ lib/mkmf.rb 25 Jun 2004 02:30:25 -0000 > @@ -251,5 +251,5 @@ end > def libpathflag(libpath=$LIBPATH) > libpath.map{|x| > - (x == "$(topdir)" ? LIBPATHFLAG : LIBPATHFLAG+RPATHFLAG) % x > + (x == "$(topdir)" ? LIBPATHFLAG : LIBPATHFLAG+RPATHFLAG) % x.quote > }.join > end > @@ -662,5 +662,5 @@ def dir_config(target, idefault=nil, lde > idirs -= Shellwords.shellwords($CPPFLAGS) > unless idirs.empty? > - $CPPFLAGS = (idirs << $CPPFLAGS).join(" ") > + $CPPFLAGS = (idirs << $CPPFLAGS).quote.join(" ") > end > end No luck. The libpathflag method is never actually reached because the Quixml extconf.rb file doesn't call create_makefile unless the expat lib is found. As for the change to $CPPFLAGS, it didn't seem to make any difference. As far as I can tell, using debug prints, the $CPPFLAGS are escaped properly. LIBPATHFLAG entered have_library: checking for main() in libexpat.lib... -------------------- no LIBPATHFLAG entered "cl -nologo -Feconftest -IC:/ruby/lib/ruby/1.8/i386-mswin32 -IC:/ruby/lib/ruby/1 ..8/i386-mswin32 "-Ic:\program files\expat\source\lib" "-I. -I./.. -I./../missing " -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib libexpat.lib oldna mes.lib user32.lib advapi32.lib wsock32.lib -link -libpath:C:/ruby/lib -lib path:"c:\program files\expat\libs" -stack:0x2000000" conftest.c LINK : fatal error LNK1181: cannot open input file "files\expat\libs.obj" checked program was: /* begin */ /*top*/ int main() { return 0; } int t() { main(); return 0; } /* end */ "cl -nologo -Feconftest -IC:/ruby/lib/ruby/1.8/i386-mswin32 -IC:/ruby/lib/ruby/1 ..8/i386-mswin32 "-Ic:\program files\expat\source\lib" "-I. -I./.. -I./../missing " -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib libexpat.lib oldna mes.lib user32.lib advapi32.lib wsock32.lib -link -libpath:C:/ruby/lib -lib path:"c:\program files\expat\libs" -stack:0x2000000" conftest.c LINK : fatal error LNK1181: cannot open input file "files\expat\libs.obj" checked program was: /* begin */ #include #include /*top*/ int main() { return 0; } int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; } /* end */ -------------------- Any other ideas? Thanks. Dan