On Feb 9, 5:03 pm, Charlie Savage <[EMAIL PROTECTED]> wrote: > > So this works for you to compile on Windows? I guess I'm a confused > > b/c you are using Config::CONFIG here. Isn't that what extconf.rb > > uses? But you said that's was why extconf.rb didn't work. > > Sorry, that might have been a bit confusing. I only pick out a few > parts from it: > > ["archdir", "/lib/ruby/1.8/i386-mswin32"], > ["bindir", "/bin"], > ["libdir", "/lib"], > ["LIBRUBY_SO", "msvcrt-ruby18.dll"], > > But look at the rest, which are taken from my 1.8.4 version of Ruby > installed with the one-click installer. The values are for building > with VC++. Notice that for gcc: > > * The compiler (CPP) is wrong > * The CFLAGS are wrong > * The linker command is wrong > * The linker flags (DLDFLAGS) > > Thus you can't use extconf.rb. And this is the big downfall of > extconf.rb - it assumes that you use the same compiler to build > extensions as you use to build Ruby itself. On Windows at least that is > not necessarily so... > > Charlie > > ["CC", "cl -nologo"] > ["CFLAGS", "-MD -Zi -O2b2xg- -G6"], > ["COMMON_HEADERS", "windows.h winsock.h"], > ["COMMON_LIBS", "m"], > ["COMPILE_C", "cl -nologo -MD -Zi -O2b2xg- -G6 -c -Tc$(<:\\=/)"], > ["COMPILE_CXX", "$(CXX) -c -Tp$(<:\\=/)"], > ["CPP", "cl"], > ["CPPFLAGS", ""], > ["CPPOUTFILE", "-P"], > ["DLDFLAGS", > "-link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) > -def:$(DEFFILE) -implib:$(*F:.so=)-i386-mswin32.lib > -pdb:$(*F:.so=)-i386-mswin32.pdb"], > ["LDSHARED", "cl -nologo -LD"], > ["LIBOBJS", " acosh.obj crypt.obj erf.obj win32.obj"], > ["LIBPATHFLAG", " -libpath:\"%s\""], > ["LINK_SO", > "cl -nologo -LD -Fe$(@) $(OBJS) oldnames.lib user32.lib advapi32.lib > wsock32.lib $(LOCAL_LIBS) -link -incremental:no -debug -opt:ref > -opt:icf -dll $(LIBPATH) -def:$(DEFFILE) > -implib:$(*F:.so=)-i386-mswin32.lib -pdb:$(*F:.so=)-i386-mswin32.pdb"], > ["TRY_LINK", > "cl -nologo -Feconftest $(INCFLAGS) -I$(hdrdir) -MD -Zi -O2b2xg- -G6 > $(src) $(LOCAL_LIBS) oldnames.lib user32.lib advapi32.lib wsock32.lib > -link $(LIBPATH) -stack:0x2000000"], > ["XCFLAGS", > "-DRUBY_EXPORT -I. -IC:/develop/win/ruby/stable > -IC:/develop/win/ruby/stable/missing"],
Okay. I see what you mean. It occurs to me that extconf.rb is really nothing special. It is mkmf.rb, which extconf.rb uses, that is special. So then we should be able to simply put a master if-condition in there and do the mkmf.rb thing if on Linux, and generate our own Makefile instead if on Windows. Would that work ok? The reason I suggest that is b/c from what I can tell, RubyGems and setup.rb rely on the extconf.rb way of doing things --and if we would like things to work smoothly on Windows --like they do on Linux, then it seems to be what we'd have to do. T. _______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel