Permalink
Browse files

Remove the option to compile MacRuby statically

  • Loading branch information...
1 parent 6d161ad commit bd3420d0eb466be61bc44b1312ed85d7b7ba087b @ferrous26 ferrous26 committed Sep 29, 2012
Showing with 7 additions and 36 deletions.
  1. +2 −11 rakelib/builder.rake
  2. +4 −17 rakelib/builder/options.rb
  3. +1 −1 rakelib/builder/templates.rb
  4. +0 −7 rakelib/install.rake
View
@@ -170,17 +170,8 @@ namespace :macruby do
end
end
- desc "Build static library"
- task :static => :files do
- if ENABLE_STATIC_LIBRARY
- $builder.config = STATIC_CONFIG
- build_objects
- $builder.link_archive("lib#{RUBY_SO_NAME}-static.a", $builder.objs - ['main', 'gc-stub'] + ['plblockimp'])
- end
- end
-
desc "Build MacRuby"
- task :build => [:dylib, :static] do
+ task :build => [:dylib] do
$builder.config = FULL_CONFIG
$builder.link_executable(RUBY_INSTALL_NAME, ['main', 'gc-stub'], "-L. -l#{RUBY_SO_NAME} -lobjc")
end
@@ -191,7 +182,7 @@ EXTOUT = (ENV['EXTOUT'] or ".ext")
INSTALLED_LIST = '.installed.list'
desc "Build extensions"
-task :extensions => [:miniruby, "macruby:static"] do
+task :extensions => [:miniruby] do
Builder::Ext.build
end
View
@@ -41,7 +41,6 @@ def self.option(name, default)
FRAMEWORK_NAME = b.option('framework_name', 'MacRuby')
FRAMEWORK_INSTDIR = b.option('framework_instdir', '/Library/Frameworks')
SYM_INSTDIR = b.option('sym_instdir', '/usr/local')
-ENABLE_STATIC_LIBRARY = b.option('enable_static_library', false) { |x| x == 'true' }
ENABLE_DEBUG_LOGGING = b.option('enable_debug_logging', true) { |x| x == 'true' }
SIMULTANEOUS_JOBS = b.option('jobs', 1) { |x| x.to_i }
COMPILE_STDLIB = b.option('compile_stdlib', true) { |x| x == 'true' }
@@ -138,11 +137,6 @@ def self.option(name, default)
transcode sandbox
}
-# Static MacRuby builds less objects.
-STATIC_OBJS = OBJS - %w{
- bs compiler debugger interpreter MacRubyDebuggerConnector parse
-}
-
# Additional compilation flags for certain objects.
OBJS_CFLAGS = {
'dispatcher' => '-x objective-c++', # compile as Objective-C++.
@@ -165,15 +159,9 @@ def initialize(opt)
@cxxflags = "-I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror #{archflags} #{EXTRA_CFLAGS}"
@ldflags = '-lpthread -ldl -lxml2 -lobjc -licucore -framework Foundation'
@ldflags << " -lauto" if has_libauto
- if opt.delete(:static)
- @cflags << ' -DMACRUBY_STATIC'
- @cxxflags << ' -DMACRUBY_STATIC'
- @cxxflags << " -O#{OPTZ_LEVEL} "
- else
- @cxxflags << ' ' << `#{LLVM_CONFIG} --cxxflags #{LLVM_MODULES}`.sub(/-DNDEBUG/, '').sub(/-fno-exceptions/, '').sub(/-Wcast-qual/, '').sub!(/-O\d/, "-O#{OPTZ_LEVEL}").strip.gsub(/\n/, '')
- @cxxflags << ' -DLLVM_TOT' if ENV['LLVM_TOT']
- @ldflags << ' ' << `#{LLVM_CONFIG} --ldflags --libs #{LLVM_MODULES}`.strip.gsub(/\n/, '')
- end
+ @cxxflags << ' ' << `#{LLVM_CONFIG} --cxxflags #{LLVM_MODULES}`.sub(/-DNDEBUG/, '').sub(/-fno-exceptions/, '').sub(/-Wcast-qual/, '').sub!(/-O\d/, "-O#{OPTZ_LEVEL}").strip.gsub(/\n/, '')
+ @cxxflags << ' -DLLVM_TOT' if ENV['LLVM_TOT']
+ @ldflags << ' ' << `#{LLVM_CONFIG} --ldflags --libs #{LLVM_MODULES}`.strip.gsub(/\n/, '')
unless has_libauto
@cflags << ' -DNO_LIBAUTO'
@cxxflags << ' -DNO_LIBAUTO'
@@ -195,8 +183,7 @@ def initialize(opt)
end
FULL_CONFIG = BuilderConfig.new(:objsdir => '.objs')
-STATIC_CONFIG = BuilderConfig.new(:objsdir => '.static-objs', :static => true, :objs => STATIC_OBJS)
-CONFIGS = [FULL_CONFIG, STATIC_CONFIG]
+CONFIGS = [FULL_CONFIG]
# We monkey-patch the method that Rake uses to display the tasks so we can add
# the build options.
@@ -191,7 +191,7 @@ module RbConfig
CONFIG["SOLIBS"] = ""
CONFIG["DLDLIBS"] = ""
CONFIG["ENABLE_SHARED"] = "yes"
- CONFIG["ENABLE_STATIC"] = "#{ENABLE_STATIC_LIBRARY ? 'yes' : 'no'}"
+ CONFIG["ENABLE_STATIC"] = "no"
CONFIG["MAINLIBS"] = ""
CONFIG["COMMON_LIBS"] = ""
CONFIG["COMMON_MACROS"] = ""
View
@@ -93,10 +93,6 @@ module Installer
"lib#{RUBY_SO_NAME}.#{NEW_RUBY_VERSION}.dylib"
end
- def static
- "lib#{RUBY_SO_NAME}-static.a"
- end
-
def ruby_shebang
"#{FRAMEWORK_USR_BIN}/#{RUBY_INSTALL_NAME}"
end
@@ -158,9 +154,6 @@ namespace :install do
install 'rbconfig.rb', arch_lib_dir, :mode => data_mode
install 'rbconfig.rbo', arch_lib_dir, :mode => data_mode
install dylib, FRAMEWORK_USR_LIB, :mode => prog_mode, :strip => true
- if File.exists?(static)
- install static, FRAMEWORK_USR_LIB, :mode => data_mode, :strip => true
- end
for link in DYLIB_ALIASES.split
ln_sf dylib, "#{FRAMEWORK_USR_LIB}/#{link}"
end

0 comments on commit bd3420d

Please sign in to comment.