Skip to content
Snippets Groups Projects
Commit aaf64926 authored by Lars Kanis's avatar Lars Kanis
Browse files

Add rake task 'gem:windows' which makes use of the new rake-compiler-dock.

This also fixes some build system checks, that should be for the target system.
parent 49ed1e71
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,6 @@ PKG_VERSION = Fox.fxrubyversion
SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig.exe" : "swig"
SWIGFLAGS = "-c++ -ruby -nodefaultdtor -nodefaultctor -w302 -features compactdefaultargs -I../fox-includes"
SWIG_LIB = `#{SWIG} -swiglib`.chomp
SWIG_MODULES = {
"core.i" => "core_wrap.cpp",
"dcmodule.i" => "dc_wrap.cpp",
......@@ -126,6 +125,12 @@ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
end
end
desc "Build the windows binary gems"
task 'gem:windows' => 'gem' do
require 'rake_compiler_dock'
RakeCompilerDock.sh "rake cross native gem RUBYOPT=--disable-rubygems MAKE=\"nice make V=1 -j `nproc`\" "
end
# Set environment variable SWIG_LIB to
# c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22
# before running swig on MinGW.
......
......@@ -7,7 +7,7 @@ def find_installed_fox_version
stddirs = ["/usr/include/fox-1.6",
"/usr/local/include/fox-1.6",
"/sw/include/fox-1.6",
"/opt/local/include/fox-1.6"]
"/opt/local/include/fox-1.6"]
usrdirs = []
ARGV.each do |arg|
if arg =~ /--with-fox-include/
......@@ -109,12 +109,13 @@ def do_rake_compiler_setup
dir_config("installed")
host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
libz_recipe = MiniPortile.new("libz", LIBZ_VERSION).tap do |recipe|
recipe.files = [LIBZ_SOURCE_URI]
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
class << recipe
def configure
Dir.chdir work_path do
......@@ -157,7 +158,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
recipe.configure_options = [
"--host=#{recipe.host}",
"--enable-shared",
......@@ -182,7 +183,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
recipe.configure_options = [
"--host=#{recipe.host}",
"--enable-shared",
......@@ -202,7 +203,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
recipe.configure_options = [
"--host=#{recipe.host}",
"--enable-shared",
......@@ -222,7 +223,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
recipe.configure_options = [
"--host=#{recipe.host}",
"--without-xft",
......@@ -255,7 +256,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
recipe.host = host
recipe.configure_options = [
"--host=#{recipe.host}",
"--enable-shared",
......@@ -282,14 +283,19 @@ def do_rake_compiler_setup
checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
unless File.exist?(checkpoint)
recipe.cook
FileUtils.touch checkpoint
with_env(
'PKG_CONFIG_PATH' => "#{libfox_recipe.path}/lib/pkgconfig"
) do
recipe.cook
FileUtils.touch checkpoint
end
end
recipe.activate
end
$autodetected_fxscintilla = true
dir_config('libfox', "#{libfox_recipe.path}/include", "#{libfox_recipe.path}/lib")
dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include", "#{libfxscintills_recipe.path}/lib")
dir_config('libfox', "#{libfox_recipe.path}/include/fox-1.6", "#{libfox_recipe.path}/lib")
dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include/fxscintilla", "#{libfxscintills_recipe.path}/lib")
shared_dlls = [
"#{libfxscintills_recipe.path}/bin/libfxscintilla-20.dll",
......@@ -312,7 +318,7 @@ def do_rake_compiler_setup
FileUtils.cp `#{cmd}`.chomp, '.', verbose: true
end
CONFIG['CXX'] = "#{RbConfig::CONFIG["host"]}-g++" # CXX setting must be prefixed for cross build
CONFIG['CXX'] = "#{host}-g++" # CXX setting must be prefixed for cross build
CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation
CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
$LDFLAGS += " -s" # remove symbol table informations from shared lib
......@@ -365,15 +371,17 @@ dir_config('fox', '/usr/local/include/fox-1.6', '/usr/local/lib')
dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')
find_installed_fox_version
unless enable_config("win32-cross")
find_installed_fox_version
#
# Check for FXScintilla header files, unless FXScintilla support has
# been explicitly suppressed with the '--without-fxscintilla' flag.
#
#
# Check for FXScintilla header files, unless FXScintilla support has
# been explicitly suppressed with the '--without-fxscintilla' flag.
#
unless fxscintilla_support_suppressed?
find_installed_fxscintilla_version
unless fxscintilla_support_suppressed?
find_installed_fxscintilla_version
end
end
# Platform-specific modifications
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment