2008/2/8 Charlie Savage <[EMAIL PROTECTED]>: > You need to call the correct make program (make vs nmake), link to the > right libraries, set up the correct include paths, etc. Also, what > about the depedency on libxml? How would that work in a cross-compiled > environment? > > > Yea, I'm not sure. I haven't really tested it. I simply read of others > > doing it and their examples. Basically it requires re-compiling ruby > > itself with mingw, and from there supposedly one can make it work. > > So...I think it could be quite hard getting this working in a > cross-compiler environment, but I've never tried so don't know. > > To show how we do it with ruby-prof, I've included below the rakefile we > use. The requirements are having Ruby installed, MinGW and msys. > > ruby-prof also includes a VC++ 2005 project file, which also works fine. > The reason we don't use it to distribute the ruby-prof.dll though is > to avoid the dependency on the VC++ 2005 runtime files. And that raises > another interesting question - libxml for Windows is compiled with the > Windows XP DDK (http://www.zlatkovic.com/libxml.en.html) - and I'm not > sure what VC++ version that is. > > > Charlie > > > # We can't use Ruby's standard build procedures > # on Windows because the Ruby executable is > # built with VC++ while here we want to build > # with MingW. So just roll our own... > > require 'rake/clean' > require 'rbconfig' > > RUBY_INCLUDE_DIR = Config::CONFIG["archdir"] > RUBY_BIN_DIR = Config::CONFIG["bindir"] > RUBY_LIB_DIR = Config::CONFIG["libdir"] > RUBY_SHARED_LIB = Config::CONFIG["LIBRUBY"] > RUBY_SHARED_DLL = RUBY_SHARED_LIB.gsub(/lib$/, 'dll') > > CLEAN.include('*.o') > CLOBBER.include('ruby_prof.so') > > task :default => "ruby_prof" > > SRC = FileList['../ext/*.c'] > OBJ = SRC.collect do |file_name| > File.basename(file_name).ext('o') > end > > SRC.each do |srcfile| > objfile = File.basename(srcfile).ext('o') > file objfile => srcfile do > sh "gcc -c -fPIC -O2 -Wall -o #{objfile} #{srcfile} > -I#{RUBY_INCLUDE_DIR}" > end > end > > file "ruby_prof" => OBJ do > sh "gcc -shared -o ruby_prof.so #{OBJ} > #{RUBY_BIN_DIR}/#{RUBY_SHARED_DLL}" > end
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. T. _______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel