ship only one libmacruby-repl.dylib file per platform, the one that has been built with the lowest deployment target (4.3 for ios and 10.7 for osx)

This commit is contained in:
Laurent Sansonetti
2013-10-30 23:54:57 +01:00
parent 67ba448ab8
commit edcdf29ed6
3 changed files with 16 additions and 17 deletions

View File

@@ -1236,12 +1236,6 @@ main(int argc, char **argv)
replPath = [replPath stringByAppendingPathComponent:@"ios"];
#else
replPath = [replPath stringByAppendingPathComponent:@"osx"];
#endif
replPath = [replPath stringByAppendingPathComponent:sdk_version];
#if defined(SIMULATOR_IOS)
replPath = [replPath stringByAppendingPathComponent:@"iPhoneSimulator"];
#else
replPath = [replPath stringByAppendingPathComponent:@"MacOSX"];
#endif
replPath = [replPath stringByAppendingPathComponent:@"libmacruby-repl.dylib"];
[appEnvironment setObject:replPath forKey:@"REPL_DYLIB_PATH"];

View File

@@ -11,6 +11,7 @@ task :all => [:vm_files, :bridgesupport_files, :bridgesupport_static_stubs]
task :vm_files do
strip = File.join(PLATFORMS_DIR, '../Toolchains/XcodeDefault.xctoolchain/usr/bin/strip')
first = true
OSX_SDK_VERSIONS.each do |sdk_version|
sdk = File.join('osx', sdk_version, 'MacOSX')
mkdir_p sdk
@@ -19,15 +20,15 @@ task :vm_files do
install path, sdk
end
install File.join(objs, 'libmacruby-static.a'), sdk
objs = "../vm/MacOSX#{sdk_version}-repl.objs"
install File.join(objs, 'libmacruby-repl.dylib'), sdk
# remove debug symbols
if NEED_STRIP
Dir.glob(sdk + '/*.{a,dylib}').each { |x| sh("\"#{strip}\" -S \"#{x}\"") }
if first
objs = "../vm/MacOSX#{sdk_version}-repl.objs"
install File.join(objs, 'libmacruby-repl.dylib'), 'osx'
first = false
end
end
first = true
IOS_SDK_VERSIONS.each do |sdk_version|
ios = File.join('ios', sdk_version, 'iPhoneOS')
mkdir_p ios
@@ -44,14 +45,18 @@ task :vm_files do
install path, sim
end
install File.join(objs, 'libmacruby-static.a'), sim
objs = "../vm/iPhoneSimulator#{sdk_version}-repl.objs"
install File.join(objs, 'libmacruby-repl.dylib'), sim
# remove debug symbols
if NEED_STRIP
[ios, sim].map { |x| Dir.glob(x + '/*.{a,dylib}') }.flatten.each { |x| sh("\"#{strip}\" -S \"#{x}\"") }
if first
objs = "../vm/iPhoneSimulator#{sdk_version}-repl.objs"
install File.join(objs, 'libmacruby-repl.dylib'), 'ios'
first = false
end
end
# remove debug symbols
if NEED_STRIP
Dir.glob('{osx,ios}/**/*.{a,dylib}').each { |x| sh("\"#{strip}\" -S \"#{x}\"") }
end
end
def apply_bridgesupport_fixes(bs)

View File

@@ -456,7 +456,7 @@ EOS
# Optional support for #eval (OSX-only).
if config.respond_to?(:eval_support) and config.eval_support
repl_dylib_path = File.join(datadir, platform, 'libmacruby-repl.dylib')
repl_dylib_path = File.join(datadir, '..', 'libmacruby-repl.dylib')
dest_path = File.join(app_resources_dir, File.basename(repl_dylib_path))
copy_resource(repl_dylib_path, dest_path)
preserve_resources << File.basename(repl_dylib_path)