Sha256: 31ed4c09fb90eca471f5bc1b1773a0efb3ceb43b6f8134dbf61176b9a36e4be1

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

# 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('libxslt.so')

task :default => "libxslt"

SRC = FileList['../ext/libxslt/*.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
    command = "gcc -c -fPIC -O2 -Wall -o #{objfile} -I/usr/local/include -I../../rlibxml/ext #{srcfile} -I#{RUBY_INCLUDE_DIR}"
    sh "sh -c '#{command}'" 
  end
end

file "libxslt" => OBJ do
  command = "libtool --mode=link gcc -shared -o libxslt_ruby.so -L/usr/local/lib -lxml2 -lxslt ../../rlibxml/mingw/libxml_ruby.so #{OBJ} #{RUBY_BIN_DIR}/#{RUBY_SHARED_DLL}" 
  sh "sh -c '#{command}'" 
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libxslt-ruby-0.6.0 mingw/mingw.rake
libxslt-ruby-0.6.0-x86-mswin32-60 mingw/mingw.rake