2000-08-03 05:50:41 -04:00
|
|
|
#!./miniruby -s
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2003-07-27 08:55:35 -04:00
|
|
|
# avoid warnings with -d.
|
|
|
|
$install_name ||= nil
|
|
|
|
$so_name ||= nil
|
|
|
|
|
2009-05-24 22:47:07 -04:00
|
|
|
srcdir = File.expand_path('../..', __FILE__)
|
2007-12-27 09:56:04 -05:00
|
|
|
$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
|
|
|
|
$:.unshift(".")
|
2004-12-04 10:56:34 -05:00
|
|
|
|
|
|
|
require "fileutils"
|
2002-10-26 22:09:23 -04:00
|
|
|
mkconfig = File.basename($0)
|
1998-01-16 07:19:09 -05:00
|
|
|
|
|
|
|
rbconfig_rb = ARGV[0] || 'rbconfig.rb'
|
2004-02-14 09:59:19 -05:00
|
|
|
unless File.directory?(dir = File.dirname(rbconfig_rb))
|
2004-02-14 10:12:40 -05:00
|
|
|
FileUtils.makedirs(dir, :verbose => true)
|
2004-02-14 09:59:19 -05:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2001-05-31 00:40:37 -04:00
|
|
|
version = RUBY_VERSION
|
2008-07-16 21:55:58 -04:00
|
|
|
config = ""
|
|
|
|
def config.write(arg)
|
2005-11-10 18:22:03 -05:00
|
|
|
concat(arg.to_s)
|
|
|
|
end
|
|
|
|
$stdout = config
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2000-08-03 05:50:41 -04:00
|
|
|
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
|
1998-01-16 07:19:09 -05:00
|
|
|
print %[
|
2002-10-26 22:09:23 -04:00
|
|
|
# This file was created by #{mkconfig} when ruby was built. Any
|
|
|
|
# changes made to this file will be lost the next time ruby is built.
|
|
|
|
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
module RbConfig
|
2015-02-25 01:35:47 -05:00
|
|
|
RUBY_VERSION.start_with?("#{version}"[/^[0-9]+[.][0-9]+[.]/]) or
|
2001-05-31 00:40:37 -04:00
|
|
|
raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
|
2002-10-26 22:16:55 -04:00
|
|
|
|
1998-01-16 07:19:09 -05:00
|
|
|
]
|
|
|
|
|
2009-03-24 18:45:13 -04:00
|
|
|
arch = RUBY_PLATFORM
|
2010-09-21 09:20:07 -04:00
|
|
|
win32 = /mswin/ =~ arch
|
2010-12-16 07:46:44 -05:00
|
|
|
universal = /universal.*darwin/ =~ arch
|
1998-01-16 07:19:09 -05:00
|
|
|
v_fast = []
|
|
|
|
v_others = []
|
2006-05-24 12:52:00 -04:00
|
|
|
vars = {}
|
2007-01-29 22:06:02 -05:00
|
|
|
continued_name = nil
|
|
|
|
continued_line = nil
|
2013-12-27 00:46:06 -05:00
|
|
|
install_name = nil
|
|
|
|
so_name = nil
|
2000-12-28 00:00:47 -05:00
|
|
|
File.foreach "config.status" do |line|
|
|
|
|
next if /^#/ =~ line
|
2007-01-29 22:06:02 -05:00
|
|
|
name = nil
|
|
|
|
case line
|
|
|
|
when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
|
2006-06-25 10:03:10 -04:00
|
|
|
name = $2
|
|
|
|
val = $3.gsub(/\\(?=,)/, '')
|
2007-01-29 22:06:02 -05:00
|
|
|
when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
|
|
|
|
name = $1
|
|
|
|
val = $2
|
|
|
|
if $3
|
2010-09-16 13:28:42 -04:00
|
|
|
continued_line = [val]
|
2007-01-29 22:06:02 -05:00
|
|
|
continued_name = name
|
|
|
|
next
|
|
|
|
end
|
2008-12-08 13:21:47 -05:00
|
|
|
when /^"(.*)"\s*(\\)?$/
|
2010-09-16 13:28:42 -04:00
|
|
|
next if !continued_line
|
|
|
|
continued_line << $1
|
|
|
|
next if $2
|
2012-12-09 23:18:11 -05:00
|
|
|
continued_line.each {|s| s.sub!(/\\n\z/, "\n")}
|
2010-09-16 13:28:42 -04:00
|
|
|
val = continued_line.join
|
|
|
|
name = continued_name
|
|
|
|
continued_line = nil
|
2007-01-29 22:06:02 -05:00
|
|
|
when /^(?:ac_given_)?INSTALL=(.*)/
|
|
|
|
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
|
|
|
|
end
|
|
|
|
|
|
|
|
if name
|
2009-04-03 18:38:54 -04:00
|
|
|
case name
|
|
|
|
when /^(?:ac_.*|configure_input|(?:top_)?srcdir|\w+OBJS)$/; next
|
2015-03-06 21:06:06 -05:00
|
|
|
when /^(?:X|(?:MINI|RUN|(?:HAVE_)?BASE|BOOTSTRAP|BTEST)RUBY(?:_COMMAND)?$)/; next
|
2015-02-28 21:17:13 -05:00
|
|
|
when /^INSTALLDOC|TARGET$/; next
|
|
|
|
when /^DTRACE/; next
|
2013-12-31 01:34:35 -05:00
|
|
|
when /^(?:MAJOR|MINOR|TEENY)$/; vars[name] = val; next
|
2013-02-18 22:49:37 -05:00
|
|
|
when /^LIBRUBY_D?LD/; next
|
2013-12-27 00:46:06 -05:00
|
|
|
when /^RUBY_INSTALL_NAME$/; next vars[name] = (install_name = val).dup if $install_name
|
|
|
|
when /^RUBY_SO_NAME$/; next vars[name] = (so_name = val).dup if $so_name
|
2009-04-03 18:38:54 -04:00
|
|
|
when /^arch$/; if val.empty? then val = arch else arch = val end
|
2013-02-06 02:47:45 -05:00
|
|
|
when /^sitearch$/; val = '$(arch)' if val.empty?
|
2015-02-25 04:17:33 -05:00
|
|
|
when /^DESTDIR$/; next
|
2009-04-03 18:38:54 -04:00
|
|
|
end
|
|
|
|
case val
|
|
|
|
when /^\$\(ac_\w+\)$/; next
|
|
|
|
when /^\$\{ac_\w+\}$/; next
|
|
|
|
when /^\$ac_\w+$/; next
|
|
|
|
end
|
2009-04-09 14:01:26 -04:00
|
|
|
if /^program_transform_name$/ =~ name
|
2009-08-26 04:00:37 -04:00
|
|
|
val.sub!(/\As(\\?\W)(?:\^|\${1,2})\1\1(;|\z)/, '')
|
2009-04-09 14:01:26 -04:00
|
|
|
if val.empty?
|
|
|
|
$install_name ||= "ruby"
|
|
|
|
next
|
|
|
|
end
|
|
|
|
unless $install_name
|
|
|
|
$install_name = "ruby"
|
|
|
|
val.gsub!(/\$\$/, '$')
|
2009-08-26 06:56:55 -04:00
|
|
|
val.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\\?\W)((?:(?!\3)(?:\\.|.))*)\3((?:(?!\3)(?:\\.|.))*)\3([gi]*)]) do
|
2009-04-09 14:01:26 -04:00
|
|
|
|addr, cmd, sep, pat, rep, opt|
|
|
|
|
if addr
|
|
|
|
Regexp.new(addr[/\A\/(.*)\/\z/, 1]) =~ $install_name or next
|
|
|
|
end
|
|
|
|
case cmd
|
|
|
|
when 's'
|
|
|
|
pat = Regexp.new(pat, opt.include?('i'))
|
|
|
|
if opt.include?('g')
|
|
|
|
$install_name.gsub!(pat, rep)
|
|
|
|
else
|
|
|
|
$install_name.sub!(pat, rep)
|
|
|
|
end
|
|
|
|
when 'y'
|
|
|
|
$install_name.tr!(Regexp.quote(pat), rep)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2006-06-25 10:03:10 -04:00
|
|
|
end
|
2013-02-07 02:21:30 -05:00
|
|
|
eq = win32 && vars[name] ? '<< "\n"' : '='
|
2013-02-06 03:32:53 -05:00
|
|
|
vars[name] = val
|
2010-02-18 08:33:25 -05:00
|
|
|
if name == "configure_args"
|
|
|
|
val.gsub!(/--with-out-ext/, "--without-ext")
|
|
|
|
end
|
2006-06-25 10:03:10 -04:00
|
|
|
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
|
2010-12-16 07:46:44 -05:00
|
|
|
case name
|
|
|
|
when /^prefix$/
|
2006-06-25 10:03:10 -04:00
|
|
|
val = "(TOPDIR || DESTDIR + #{val})"
|
2010-12-16 07:46:44 -05:00
|
|
|
when /^ARCH_FLAG$/
|
|
|
|
val = "arch_flag || #{val}" if universal
|
|
|
|
when /^UNIVERSAL_ARCHNAMES$/
|
|
|
|
universal, val = val, 'universal' if universal
|
|
|
|
when /^arch$/
|
|
|
|
if universal
|
|
|
|
val.sub!(/universal/, %q[#{arch && universal[/(?:\A|\s)#{Regexp.quote(arch)}=(\S+)/, 1] || '\&'}])
|
|
|
|
end
|
2015-02-10 03:30:16 -05:00
|
|
|
when /^includedir$/
|
|
|
|
val = '"$(SDKROOT)"'+val if /darwin/ =~ arch
|
2006-06-25 10:03:10 -04:00
|
|
|
end
|
2013-02-07 02:21:30 -05:00
|
|
|
v = " CONFIG[\"#{name}\"] #{eq} #{val}\n"
|
1998-01-16 07:19:09 -05:00
|
|
|
if fast[name]
|
|
|
|
v_fast << v
|
|
|
|
else
|
|
|
|
v_others << v
|
|
|
|
end
|
2009-02-02 17:01:26 -05:00
|
|
|
case name
|
2009-02-05 00:26:22 -05:00
|
|
|
when "ruby_version"
|
|
|
|
version = val[/\A"(.*)"\z/, 1]
|
2009-02-02 17:01:26 -05:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
# break if /^CEOF/
|
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
drive = File::PATH_SEPARATOR == ';'
|
|
|
|
|
2013-02-06 03:32:53 -05:00
|
|
|
def vars.expand(val, config = self)
|
|
|
|
newval = val.gsub(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) {
|
|
|
|
var = $&
|
|
|
|
if !(v = $1 || $2)
|
|
|
|
'$'
|
|
|
|
elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]]
|
|
|
|
pat, sub = $1, $2
|
|
|
|
config[v] = false
|
|
|
|
config[v] = expand(key, config)
|
|
|
|
key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat
|
|
|
|
key
|
|
|
|
else
|
|
|
|
var
|
|
|
|
end
|
|
|
|
}
|
|
|
|
val.replace(newval) unless newval == val
|
|
|
|
val
|
|
|
|
end
|
2014-06-27 18:52:46 -04:00
|
|
|
prefix = vars.expand(vars["prefix"] ||= "")
|
|
|
|
rubyarchdir = vars.expand(vars["rubyarchdir"] ||= "")
|
2014-06-27 11:35:15 -04:00
|
|
|
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
|
|
|
|
print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
2010-12-16 07:46:44 -05:00
|
|
|
print <<'ARCH' if universal
|
|
|
|
arch_flag = ENV['ARCHFLAGS'] || ((e = ENV['RC_ARCHS']) && e.split.uniq.map {|a| "-arch #{a}"}.join(' '))
|
|
|
|
arch = arch_flag && arch_flag[/\A\s*-arch\s+(\S+)\s*\z/, 1]
|
|
|
|
ARCH
|
2010-12-17 04:35:42 -05:00
|
|
|
print " universal = #{universal}\n" if universal
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
print " CONFIG = {}\n"
|
|
|
|
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
|
|
|
|
2009-03-24 18:44:17 -04:00
|
|
|
versions = {}
|
|
|
|
IO.foreach(File.join(srcdir, "version.h")) do |l|
|
2010-08-23 17:08:19 -04:00
|
|
|
m = /^\s*#\s*define\s+RUBY_(PATCHLEVEL)\s+(-?\d+)/.match(l)
|
2009-03-24 18:44:17 -04:00
|
|
|
if m
|
2010-08-23 17:08:19 -04:00
|
|
|
versions[m[1]] = m[2]
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
IO.foreach(File.join(srcdir, "include/ruby/version.h")) do |l|
|
|
|
|
m = /^\s*#\s*define\s+RUBY_API_VERSION_(MAJOR|MINOR|TEENY)\s+(-?\d+)/.match(l)
|
|
|
|
if m
|
|
|
|
versions[m[1]] = m[2]
|
2009-03-24 18:44:17 -04:00
|
|
|
break if versions.size == 4
|
|
|
|
end
|
2009-02-02 17:01:26 -05:00
|
|
|
end
|
2009-03-24 18:44:17 -04:00
|
|
|
%w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|
|
|
|
|
print " CONFIG[#{v.dump}] = #{versions[v].dump}\n"
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2011-08-13 09:17:30 -04:00
|
|
|
dest = drive ? %r'= "(?!\$[\(\{])(?i:[a-z]:)' : %r'= "(?!\$[\(\{])'
|
|
|
|
v_disabled = {}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
v_others.collect! do |x|
|
2011-08-13 09:17:30 -04:00
|
|
|
if /^\s*CONFIG\["((?!abs_|old)[a-z]+(?:_prefix|dir))"\]/ === x
|
|
|
|
name = $1
|
|
|
|
if /= "no"$/ =~ x
|
|
|
|
v_disabled[name] = true
|
|
|
|
v_others.delete(name)
|
|
|
|
next
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
x.sub(dest, '= "$(DESTDIR)')
|
2000-06-18 23:37:55 -04:00
|
|
|
else
|
|
|
|
x
|
|
|
|
end
|
|
|
|
end
|
2011-08-13 09:17:30 -04:00
|
|
|
v_others.compact!
|
2000-06-18 23:37:55 -04:00
|
|
|
|
2000-08-03 05:50:41 -04:00
|
|
|
if $install_name
|
2013-12-27 00:46:06 -05:00
|
|
|
if install_name and vars.expand("$(RUBY_INSTALL_NAME)") == $install_name
|
|
|
|
$install_name = install_name
|
|
|
|
end
|
2000-08-03 05:50:41 -04:00
|
|
|
v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
|
|
|
|
v_fast << " CONFIG[\"RUBY_INSTALL_NAME\"] = \"" + $install_name + "\"\n"
|
|
|
|
end
|
|
|
|
if $so_name
|
2013-12-27 00:46:06 -05:00
|
|
|
if so_name and vars.expand("$(RUBY_SO_NAME)") == $so_name
|
|
|
|
$so_name = so_name
|
|
|
|
end
|
2000-08-03 05:50:41 -04:00
|
|
|
v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
|
|
|
|
end
|
|
|
|
|
2006-09-08 15:48:22 -04:00
|
|
|
print(*v_fast)
|
|
|
|
print(*v_others)
|
2015-02-10 03:30:16 -05:00
|
|
|
print <<EOS if /darwin/ =~ arch
|
|
|
|
CONFIG["SDKROOT"] = ENV["SDKROOT"] || "" # don't run xcrun everytime, usually useless.
|
|
|
|
EOS
|
1999-08-13 01:45:20 -04:00
|
|
|
print <<EOS
|
2013-02-06 03:32:53 -05:00
|
|
|
CONFIG["archdir"] = "$(rubyarchdir)"
|
2004-03-18 04:50:14 -05:00
|
|
|
CONFIG["topdir"] = File.dirname(__FILE__)
|
2000-07-31 05:43:14 -04:00
|
|
|
MAKEFILE_CONFIG = {}
|
|
|
|
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
def RbConfig::expand(val, config = CONFIG)
|
2009-06-30 03:55:36 -04:00
|
|
|
newval = val.gsub(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) {
|
2008-02-12 01:28:23 -05:00
|
|
|
var = $&
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
if !(v = $1 || $2)
|
|
|
|
'$'
|
2005-11-10 18:22:03 -05:00
|
|
|
elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
|
|
|
|
pat, sub = $1, $2
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:17:44 -04:00
|
|
|
config[v] = false
|
2009-06-30 03:55:36 -04:00
|
|
|
config[v] = RbConfig::expand(key, config)
|
2008-02-13 02:26:52 -05:00
|
|
|
key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
|
2005-11-10 18:22:03 -05:00
|
|
|
key
|
2000-07-31 05:43:14 -04:00
|
|
|
else
|
|
|
|
var
|
|
|
|
end
|
2009-06-30 03:55:36 -04:00
|
|
|
}
|
|
|
|
val.replace(newval) unless newval == val
|
2000-07-31 05:43:14 -04:00
|
|
|
val
|
|
|
|
end
|
|
|
|
CONFIG.each_value do |val|
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
RbConfig::expand(val)
|
2000-07-31 05:43:14 -04:00
|
|
|
end
|
2009-12-31 10:00:04 -05:00
|
|
|
|
|
|
|
# returns the absolute pathname of the ruby command.
|
|
|
|
def RbConfig.ruby
|
|
|
|
File.join(
|
|
|
|
RbConfig::CONFIG["bindir"],
|
|
|
|
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
|
|
|
|
)
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2002-12-31 07:31:12 -05:00
|
|
|
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
|
1999-08-13 01:45:20 -04:00
|
|
|
EOS
|
2005-11-10 18:22:03 -05:00
|
|
|
|
|
|
|
$stdout = STDOUT
|
|
|
|
mode = IO::RDWR|IO::CREAT
|
|
|
|
mode |= IO::BINARY if defined?(IO::BINARY)
|
|
|
|
open(rbconfig_rb, mode) do |f|
|
|
|
|
if $timestamp and f.stat.size == config.size and f.read == config
|
|
|
|
puts "#{rbconfig_rb} unchanged"
|
|
|
|
else
|
|
|
|
puts "#{rbconfig_rb} updated"
|
|
|
|
f.rewind
|
|
|
|
f.truncate(0)
|
|
|
|
f.print(config)
|
|
|
|
end
|
2004-03-21 18:21:31 -05:00
|
|
|
end
|
|
|
|
if String === $timestamp
|
|
|
|
FileUtils.touch($timestamp)
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
|
1998-01-16 07:19:09 -05:00
|
|
|
# vi:set sw=2:
|