Skip to content
Browse files

Move rbconfig and Info.plist creation to a separate file.

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@3355 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent c6866f6 commit 6db33ad59f93ce5fae05b1858309a3a21892dd94 @alloy alloy committed
Showing with 242 additions and 231 deletions.
  1. +5 −231 rakelib/builder.rake
  2. 0 rakelib/{ → builder}/builder.rb
  3. +237 −0 rakelib/builder/templates.rb
View
236 rakelib/builder.rake
@@ -1,4 +1,4 @@
-require File.expand_path('../builder', __FILE__)
+require File.expand_path('../builder/builder', __FILE__)
require 'rake'
# We monkey-patch the method that Rake uses to display the tasks so we can add
@@ -86,203 +86,8 @@ end
desc "Create config file"
task :rbconfig => :miniruby do
- rbconfig = <<EOS
-# This file was created when MacRuby was built. Any changes made to this file
-# will be lost the next time MacRuby is built.
-
-module RbConfig
- RUBY_VERSION == "#{NEW_RUBY_VERSION}" or
- raise "ruby lib version (#{NEW_RUBY_VERSION}) doesn't match executable version (\#{RUBY_VERSION})"
-
- TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/#{NEW_RUBY_VERSION}/#{NEW_RUBY_PLATFORM}")
- DESTDIR = '' unless defined? DESTDIR
- CONFIG = {}
- CONFIG["DESTDIR"] = DESTDIR
- CONFIG["INSTALL"] = '/usr/bin/install -c'
- CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{FRAMEWORK_USR}")
- CONFIG["EXEEXT"] = ""
- CONFIG["ruby_install_name"] = "#{RUBY_INSTALL_NAME}"
- CONFIG["RUBY_INSTALL_NAME"] = "#{RUBY_INSTALL_NAME}"
- CONFIG["RUBY_SO_NAME"] = "#{RUBY_SO_NAME}"
- CONFIG["SHELL"] = "/bin/sh"
- CONFIG["PATH_SEPARATOR"] = ":"
- CONFIG["PACKAGE_NAME"] = ""
- CONFIG["PACKAGE_TARNAME"] = ""
- CONFIG["PACKAGE_VERSION"] = ""
- CONFIG["PACKAGE_STRING"] = ""
- CONFIG["PACKAGE_BUGREPORT"] = ""
- CONFIG["exec_prefix"] = "$(prefix)"
- CONFIG["bindir"] = "$(exec_prefix)/bin"
- CONFIG["sbindir"] = "$(exec_prefix)/sbin"
- CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
- CONFIG["datarootdir"] = "$(prefix)/share"
- CONFIG["datadir"] = "$(datarootdir)"
- CONFIG["sysconfdir"] = "$(prefix)/etc"
- CONFIG["sharedstatedir"] = "$(prefix)/com"
- CONFIG["localstatedir"] = "$(prefix)/var"
- CONFIG["includedir"] = "$(prefix)/include"
- CONFIG["oldincludedir"] = "/usr/include"
- CONFIG["docdir"] = "$(datarootdir)/doc/$(PACKAGE)"
- CONFIG["infodir"] = "$(datarootdir)/info"
- CONFIG["htmldir"] = "$(docdir)"
- CONFIG["dvidir"] = "$(docdir)"
- CONFIG["pdfdir"] = "$(docdir)"
- CONFIG["psdir"] = "$(docdir)"
- CONFIG["libdir"] = "$(exec_prefix)/lib"
- CONFIG["localedir"] = "$(datarootdir)/locale"
- CONFIG["mandir"] = "$(datarootdir)/man"
- CONFIG["DEFS"] = ""
- CONFIG["ECHO_C"] = "\\\\\\\\c"
- CONFIG["ECHO_N"] = ""
- CONFIG["ECHO_T"] = ""
- CONFIG["LIBS"] = ""
- CONFIG["build_alias"] = ""
- CONFIG["host_alias"] = ""
- CONFIG["target_alias"] = ""
- CONFIG["BASERUBY"] = "ruby"
- CONFIG["MAJOR"], CONFIG["MINOR"], CONFIG["TEENY"] = [#{NEW_RUBY_VERSION.scan(/\d+/).map { |x| "\"" + x + "\"" }.join(', ')}]
- CONFIG["build"] = "i686-apple-darwin9.0.0"
- CONFIG["build_cpu"] = "i686"
- CONFIG["build_vendor"] = "apple"
- CONFIG["build_os"] = "darwin9.0.0"
- CONFIG["host"] = "i686-apple-darwin9.0.0"
- CONFIG["host_cpu"] = "i686"
- CONFIG["host_vendor"] = "apple"
- CONFIG["host_os"] = "darwin9.0.0"
- CONFIG["target"] = "i686-apple-darwin9.0.0"
- CONFIG["target_cpu"] = "i686"
- CONFIG["target_vendor"] = "apple"
- CONFIG["target_os"] = "darwin9.0"
- CONFIG["CC"] = "/usr/bin/gcc"
- CONFIG["CFLAGS"] = "-fexceptions -fno-common -pipe $(cflags)"
- CONFIG["LDFLAGS"] = ""
- CONFIG["CPPFLAGS"] = "$(cppflags)"
- CONFIG["OBJEXT"] = "o"
- CONFIG["CXX"] = "/usr/bin/g++"
- CONFIG["CXXFLAGS"] = ""
- CONFIG["CPP"] = "/usr/bin/gcc -E"
- CONFIG["GREP"] = "/usr/bin/grep"
- CONFIG["EGREP"] = "/usr/bin/grep -E"
- CONFIG["GNU_LD"] = "no"
- CONFIG["CPPOUTFILE"] = "-o conftest.i"
- CONFIG["OUTFLAG"] = "-o "
- CONFIG["COUTFLAG"] = "-o "
- CONFIG["RANLIB"] = "ranlib"
- CONFIG["AR"] = "ar"
- CONFIG["AS"] = "as"
- CONFIG["ASFLAGS"] = ""
- CONFIG["NM"] = ""
- CONFIG["WINDRES"] = ""
- CONFIG["DLLWRAP"] = ""
- CONFIG["OBJDUMP"] = ""
- CONFIG["LN_S"] = "ln -s"
- CONFIG["SET_MAKE"] = ""
- CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
- CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
- CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
- CONFIG["RM"] = "rm -f"
- CONFIG["CP"] = "cp"
- CONFIG["MAKEDIRS"] = "mkdir -p"
- CONFIG["ALLOCA"] = ""
- CONFIG["DLDFLAGS"] = ""
- CONFIG["ARCH_FLAG"] = "#{ARCHFLAGS}"
- CONFIG["STATIC"] = ""
- CONFIG["CCDLFLAGS"] = "-fno-common"
- CONFIG["LDSHARED"] = "$(CC) -dynamic -bundle -undefined suppress -flat_namespace #{ARCHFLAGS}"
- CONFIG["LDSHAREDXX"] = "$(CXX) -dynamic -bundle -undefined suppress -flat_namespace"
- CONFIG["DLEXT"] = "bundle"
- CONFIG["DLEXT2"] = ""
- CONFIG["LIBEXT"] = "a"
- CONFIG["LINK_SO"] = ""
- CONFIG["LIBPATHFLAG"] = " -L%s"
- CONFIG["RPATHFLAG"] = ""
- CONFIG["LIBPATHENV"] = "DYLD_LIBRARY_PATH"
- CONFIG["TRY_LINK"] = ""
- CONFIG["STRIP"] = "strip -A -n"
- CONFIG["EXTSTATIC"] = ""
- CONFIG["setup"] = "Setup"
- CONFIG["PREP"] = "miniruby$(EXEEXT)"
- CONFIG["EXTOUT"] = ".ext"
- CONFIG["ARCHFILE"] = ""
- CONFIG["RDOCTARGET"] = "install-doc"
- CONFIG["cppflags"] = ""
- CONFIG["cflags"] = "$(optflags) $(debugflags) $(warnflags)"
- CONFIG["optflags"] = "-O3"
- CONFIG["debugflags"] = "-g"
- CONFIG["warnflags"] = "-Wall -Wno-parentheses"
- CONFIG["LIBRUBY_LDSHARED"] = "/usr/bin/gcc -dynamiclib -undefined suppress -flat_namespace"
- CONFIG["LIBRUBY_DLDFLAGS"] = "-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)"
- CONFIG["rubyw_install_name"] = ""
- CONFIG["RUBYW_INSTALL_NAME"] = ""
- CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
- CONFIG["LIBRUBY_SO"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib"
- CONFIG["LIBRUBY_ALIASES"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib"
- CONFIG["LIBRUBY"] = "$(LIBRUBY_SO)"
- CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
- CONFIG["LIBRUBYARG_STATIC_REALLY"] = "-l$(RUBY_SO_NAME)-static #{LDFLAGS}"
- CONFIG["LIBRUBYARG_SHARED"] = CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)"
- CONFIG["SOLIBS"] = ""
- CONFIG["DLDLIBS"] = ""
- CONFIG["ENABLE_SHARED"] = "yes"
- CONFIG["ENABLE_STATIC"] = "#{ENABLE_STATIC_LIBRARY}"
- CONFIG["MAINLIBS"] = ""
- CONFIG["COMMON_LIBS"] = ""
- CONFIG["COMMON_MACROS"] = ""
- CONFIG["COMMON_HEADERS"] = ""
- CONFIG["EXPORT_PREFIX"] = ""
- CONFIG["THREAD_MODEL"] = "pthread"
- CONFIG["MAKEFILES"] = "Makefile"
- CONFIG["arch"] = "#{NEW_RUBY_PLATFORM}"
- CONFIG["sitearch"] = "#{NEW_RUBY_PLATFORM}"
- CONFIG["sitedir"] = "$(libdir)/ruby/site_ruby"
- CONFIG["vendordir"] = "$(prefix)/lib/ruby/vendor_ruby"
- CONFIG["configure_args"] = ""
- CONFIG["rubyhdrdir"] = "$(includedir)/ruby-$(MAJOR).$(MINOR).$(TEENY)"
- CONFIG["sitehdrdir"] = "$(rubyhdrdir)/site_ruby"
- CONFIG["vendorhdrdir"] = "$(rubyhdrdir)/vendor_ruby"
- CONFIG["NROFF"] = "/usr/bin/nroff"
- CONFIG["MANTYPE"] = "doc"
- CONFIG["ruby_version"] = "$(MAJOR).$(MINOR).$(TEENY)"
- CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
- CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
- CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
- CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
- CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
- CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
- CONFIG["LLVM_PATH"] = "#{LLVM_PATH}"
- CONFIG["topdir"] = File.dirname(__FILE__)
- MAKEFILE_CONFIG = {}
- CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
- def RbConfig::expand(val, config = CONFIG)
- val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
- var = $&
- if !(v = $1 || $2)
- '$'
- elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
- pat, sub = $1, $2
- config[v] = false
- RbConfig::expand(key, config)
- config[v] = key
- key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
- key
- else
- var
- end
- end
- val
- end
- CONFIG.each_value do |val|
- RbConfig::expand(val)
- end
-end
-Config = RbConfig # compatibility for ruby-1.8.4 and older.
-CROSS_COMPILING = nil
-RUBY_FRAMEWORK = true
-RUBY_FRAMEWORK_VERSION = RbConfig::CONFIG['ruby_version']
-EOS
- if !File.exist?('rbconfig.rb') or File.read('rbconfig.rb') != rbconfig
- File.open('rbconfig.rb', 'w') { |io| io.print rbconfig }
- end
+ require File.expand_path('../builder/templates', __FILE__)
+ Builder.create_rbconfig
end
namespace :macruby do
@@ -396,39 +201,8 @@ task :ext => 'extensions'
namespace :framework do
desc "Create the plist file for the framework"
task :info_plist do
- plist = <<EOS
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>Ruby</string>
- <key>CFBundleName</key>
- <string>Ruby</string>
- <key>CFBundleGetInfoString</key>
- <string>MacRuby Runtime and Library</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.apple.macruby</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>#{MACRUBY_VERSION}</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleShortVersionString</key>
- <string>#{MACRUBY_VERSION}</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>MacRuby-#{MACRUBY_VERSION}</string>
- <key>NSPrincipalClass</key>
- <string></string>
-</dict>
-</plist>
-EOS
- File.open('framework/Info.plist', 'w') { |io| io.print plist }
+ require File.expand_path('../builder/templates', __FILE__)
+ Builder.create_framework_info_plist
end
desc "Install the extensions"
View
0 rakelib/builder.rb → rakelib/builder/builder.rb
File renamed without changes.
View
237 rakelib/builder/templates.rb
@@ -0,0 +1,237 @@
+class Builder
+ def self.create_framework_info_plist
+ plist = <<EOS
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Ruby</string>
+ <key>CFBundleName</key>
+ <string>Ruby</string>
+ <key>CFBundleGetInfoString</key>
+ <string>MacRuby Runtime and Library</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.macruby</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>#{MACRUBY_VERSION}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>#{MACRUBY_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>MacRuby-#{MACRUBY_VERSION}</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
+EOS
+ File.open('framework/Info.plist', 'w') { |io| io.print plist }
+ end
+
+ def self.create_rbconfig
+ rbconfig = <<EOS
+# This file was created when MacRuby was built. Any changes made to this file
+# will be lost the next time MacRuby is built.
+
+module RbConfig
+ RUBY_VERSION == "#{NEW_RUBY_VERSION}" or
+ raise "ruby lib version (#{NEW_RUBY_VERSION}) doesn't match executable version (\#{RUBY_VERSION})"
+
+ TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/#{NEW_RUBY_VERSION}/#{NEW_RUBY_PLATFORM}")
+ DESTDIR = '' unless defined? DESTDIR
+ CONFIG = {}
+ CONFIG["DESTDIR"] = DESTDIR
+ CONFIG["INSTALL"] = '/usr/bin/install -c'
+ CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{FRAMEWORK_USR}")
+ CONFIG["EXEEXT"] = ""
+ CONFIG["ruby_install_name"] = "#{RUBY_INSTALL_NAME}"
+ CONFIG["RUBY_INSTALL_NAME"] = "#{RUBY_INSTALL_NAME}"
+ CONFIG["RUBY_SO_NAME"] = "#{RUBY_SO_NAME}"
+ CONFIG["SHELL"] = "/bin/sh"
+ CONFIG["PATH_SEPARATOR"] = ":"
+ CONFIG["PACKAGE_NAME"] = ""
+ CONFIG["PACKAGE_TARNAME"] = ""
+ CONFIG["PACKAGE_VERSION"] = ""
+ CONFIG["PACKAGE_STRING"] = ""
+ CONFIG["PACKAGE_BUGREPORT"] = ""
+ CONFIG["exec_prefix"] = "$(prefix)"
+ CONFIG["bindir"] = "$(exec_prefix)/bin"
+ CONFIG["sbindir"] = "$(exec_prefix)/sbin"
+ CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
+ CONFIG["datarootdir"] = "$(prefix)/share"
+ CONFIG["datadir"] = "$(datarootdir)"
+ CONFIG["sysconfdir"] = "$(prefix)/etc"
+ CONFIG["sharedstatedir"] = "$(prefix)/com"
+ CONFIG["localstatedir"] = "$(prefix)/var"
+ CONFIG["includedir"] = "$(prefix)/include"
+ CONFIG["oldincludedir"] = "/usr/include"
+ CONFIG["docdir"] = "$(datarootdir)/doc/$(PACKAGE)"
+ CONFIG["infodir"] = "$(datarootdir)/info"
+ CONFIG["htmldir"] = "$(docdir)"
+ CONFIG["dvidir"] = "$(docdir)"
+ CONFIG["pdfdir"] = "$(docdir)"
+ CONFIG["psdir"] = "$(docdir)"
+ CONFIG["libdir"] = "$(exec_prefix)/lib"
+ CONFIG["localedir"] = "$(datarootdir)/locale"
+ CONFIG["mandir"] = "$(datarootdir)/man"
+ CONFIG["DEFS"] = ""
+ CONFIG["ECHO_C"] = "\\\\\\\\c"
+ CONFIG["ECHO_N"] = ""
+ CONFIG["ECHO_T"] = ""
+ CONFIG["LIBS"] = ""
+ CONFIG["build_alias"] = ""
+ CONFIG["host_alias"] = ""
+ CONFIG["target_alias"] = ""
+ CONFIG["BASERUBY"] = "ruby"
+ CONFIG["MAJOR"], CONFIG["MINOR"], CONFIG["TEENY"] = [#{NEW_RUBY_VERSION.scan(/\d+/).map { |x| "\"" + x + "\"" }.join(', ')}]
+ CONFIG["build"] = "i686-apple-darwin9.0.0"
+ CONFIG["build_cpu"] = "i686"
+ CONFIG["build_vendor"] = "apple"
+ CONFIG["build_os"] = "darwin9.0.0"
+ CONFIG["host"] = "i686-apple-darwin9.0.0"
+ CONFIG["host_cpu"] = "i686"
+ CONFIG["host_vendor"] = "apple"
+ CONFIG["host_os"] = "darwin9.0.0"
+ CONFIG["target"] = "i686-apple-darwin9.0.0"
+ CONFIG["target_cpu"] = "i686"
+ CONFIG["target_vendor"] = "apple"
+ CONFIG["target_os"] = "darwin9.0"
+ CONFIG["CC"] = "/usr/bin/gcc"
+ CONFIG["CFLAGS"] = "-fexceptions -fno-common -pipe $(cflags)"
+ CONFIG["LDFLAGS"] = ""
+ CONFIG["CPPFLAGS"] = "$(cppflags)"
+ CONFIG["OBJEXT"] = "o"
+ CONFIG["CXX"] = "/usr/bin/g++"
+ CONFIG["CXXFLAGS"] = ""
+ CONFIG["CPP"] = "/usr/bin/gcc -E"
+ CONFIG["GREP"] = "/usr/bin/grep"
+ CONFIG["EGREP"] = "/usr/bin/grep -E"
+ CONFIG["GNU_LD"] = "no"
+ CONFIG["CPPOUTFILE"] = "-o conftest.i"
+ CONFIG["OUTFLAG"] = "-o "
+ CONFIG["COUTFLAG"] = "-o "
+ CONFIG["RANLIB"] = "ranlib"
+ CONFIG["AR"] = "ar"
+ CONFIG["AS"] = "as"
+ CONFIG["ASFLAGS"] = ""
+ CONFIG["NM"] = ""
+ CONFIG["WINDRES"] = ""
+ CONFIG["DLLWRAP"] = ""
+ CONFIG["OBJDUMP"] = ""
+ CONFIG["LN_S"] = "ln -s"
+ CONFIG["SET_MAKE"] = ""
+ CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
+ CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
+ CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
+ CONFIG["RM"] = "rm -f"
+ CONFIG["CP"] = "cp"
+ CONFIG["MAKEDIRS"] = "mkdir -p"
+ CONFIG["ALLOCA"] = ""
+ CONFIG["DLDFLAGS"] = ""
+ CONFIG["ARCH_FLAG"] = "#{ARCHFLAGS}"
+ CONFIG["STATIC"] = ""
+ CONFIG["CCDLFLAGS"] = "-fno-common"
+ CONFIG["LDSHARED"] = "$(CC) -dynamic -bundle -undefined suppress -flat_namespace #{ARCHFLAGS}"
+ CONFIG["LDSHAREDXX"] = "$(CXX) -dynamic -bundle -undefined suppress -flat_namespace"
+ CONFIG["DLEXT"] = "bundle"
+ CONFIG["DLEXT2"] = ""
+ CONFIG["LIBEXT"] = "a"
+ CONFIG["LINK_SO"] = ""
+ CONFIG["LIBPATHFLAG"] = " -L%s"
+ CONFIG["RPATHFLAG"] = ""
+ CONFIG["LIBPATHENV"] = "DYLD_LIBRARY_PATH"
+ CONFIG["TRY_LINK"] = ""
+ CONFIG["STRIP"] = "strip -A -n"
+ CONFIG["EXTSTATIC"] = ""
+ CONFIG["setup"] = "Setup"
+ CONFIG["PREP"] = "miniruby$(EXEEXT)"
+ CONFIG["EXTOUT"] = ".ext"
+ CONFIG["ARCHFILE"] = ""
+ CONFIG["RDOCTARGET"] = "install-doc"
+ CONFIG["cppflags"] = ""
+ CONFIG["cflags"] = "$(optflags) $(debugflags) $(warnflags)"
+ CONFIG["optflags"] = "-O3"
+ CONFIG["debugflags"] = "-g"
+ CONFIG["warnflags"] = "-Wall -Wno-parentheses"
+ CONFIG["LIBRUBY_LDSHARED"] = "/usr/bin/gcc -dynamiclib -undefined suppress -flat_namespace"
+ CONFIG["LIBRUBY_DLDFLAGS"] = "-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)"
+ CONFIG["rubyw_install_name"] = ""
+ CONFIG["RUBYW_INSTALL_NAME"] = ""
+ CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
+ CONFIG["LIBRUBY_SO"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib"
+ CONFIG["LIBRUBY_ALIASES"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib"
+ CONFIG["LIBRUBY"] = "$(LIBRUBY_SO)"
+ CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
+ CONFIG["LIBRUBYARG_STATIC_REALLY"] = "-l$(RUBY_SO_NAME)-static #{LDFLAGS}"
+ CONFIG["LIBRUBYARG_SHARED"] = CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)"
+ CONFIG["SOLIBS"] = ""
+ CONFIG["DLDLIBS"] = ""
+ CONFIG["ENABLE_SHARED"] = "yes"
+ CONFIG["ENABLE_STATIC"] = "#{ENABLE_STATIC_LIBRARY}"
+ CONFIG["MAINLIBS"] = ""
+ CONFIG["COMMON_LIBS"] = ""
+ CONFIG["COMMON_MACROS"] = ""
+ CONFIG["COMMON_HEADERS"] = ""
+ CONFIG["EXPORT_PREFIX"] = ""
+ CONFIG["THREAD_MODEL"] = "pthread"
+ CONFIG["MAKEFILES"] = "Makefile"
+ CONFIG["arch"] = "#{NEW_RUBY_PLATFORM}"
+ CONFIG["sitearch"] = "#{NEW_RUBY_PLATFORM}"
+ CONFIG["sitedir"] = "$(libdir)/ruby/site_ruby"
+ CONFIG["vendordir"] = "$(prefix)/lib/ruby/vendor_ruby"
+ CONFIG["configure_args"] = ""
+ CONFIG["rubyhdrdir"] = "$(includedir)/ruby-$(MAJOR).$(MINOR).$(TEENY)"
+ CONFIG["sitehdrdir"] = "$(rubyhdrdir)/site_ruby"
+ CONFIG["vendorhdrdir"] = "$(rubyhdrdir)/vendor_ruby"
+ CONFIG["NROFF"] = "/usr/bin/nroff"
+ CONFIG["MANTYPE"] = "doc"
+ CONFIG["ruby_version"] = "$(MAJOR).$(MINOR).$(TEENY)"
+ CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
+ CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+ CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
+ CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
+ CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
+ CONFIG["LLVM_PATH"] = "#{LLVM_PATH}"
+ CONFIG["topdir"] = File.dirname(__FILE__)
+ MAKEFILE_CONFIG = {}
+ CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
+ def RbConfig::expand(val, config = CONFIG)
+ val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
+ var = $&
+ if !(v = $1 || $2)
+ '$'
+ elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
+ pat, sub = $1, $2
+ config[v] = false
+ RbConfig::expand(key, config)
+ config[v] = key
+ key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
+ key
+ else
+ var
+ end
+ end
+ val
+ end
+ CONFIG.each_value do |val|
+ RbConfig::expand(val)
+ end
+end
+Config = RbConfig # compatibility for ruby-1.8.4 and older.
+CROSS_COMPILING = nil
+RUBY_FRAMEWORK = true
+RUBY_FRAMEWORK_VERSION = RbConfig::CONFIG['ruby_version']
+EOS
+ if !File.exist?('rbconfig.rb') or File.read('rbconfig.rb') != rbconfig
+ File.open('rbconfig.rb', 'w') { |io| io.print rbconfig }
+ end
+ end
+end

0 comments on commit 6db33ad

Please sign in to comment.
Something went wrong with that request. Please try again.