2000-08-03 13:50:41 +04:00
|
|
|
#!./miniruby -s
|
1998-01-16 15:19:09 +03:00
|
|
|
|
2003-07-27 16:55:35 +04:00
|
|
|
# avoid warnings with -d.
|
|
|
|
$install_name ||= nil
|
|
|
|
$so_name ||= nil
|
|
|
|
|
2004-12-04 18:56:34 +03:00
|
|
|
srcdir = File.dirname(__FILE__)
|
|
|
|
$:.replace [srcdir+"/lib", "."]
|
|
|
|
|
|
|
|
require "fileutils"
|
2002-10-27 05:09:23 +03:00
|
|
|
mkconfig = File.basename($0)
|
1998-01-16 15:19:09 +03:00
|
|
|
|
|
|
|
rbconfig_rb = ARGV[0] || 'rbconfig.rb'
|
2004-02-14 17:59:19 +03:00
|
|
|
unless File.directory?(dir = File.dirname(rbconfig_rb))
|
2004-02-14 18:12:40 +03:00
|
|
|
FileUtils.makedirs(dir, :verbose => true)
|
2004-02-14 17:59:19 +03:00
|
|
|
end
|
1998-01-16 15:19:09 +03:00
|
|
|
|
2001-05-31 08:40:37 +04:00
|
|
|
version = RUBY_VERSION
|
2005-11-11 02:22:03 +03:00
|
|
|
def (config = "").write(arg)
|
|
|
|
concat(arg.to_s)
|
|
|
|
end
|
|
|
|
$stdout = config
|
1998-01-16 15:19:09 +03:00
|
|
|
|
2000-08-03 13:50:41 +04:00
|
|
|
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
|
1998-01-16 15:19:09 +03:00
|
|
|
print %[
|
2002-10-27 05:09:23 +03: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 11:34:53 +03:00
|
|
|
module RbConfig
|
2001-05-31 08:40:37 +04:00
|
|
|
RUBY_VERSION == "#{version}" or
|
|
|
|
raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
|
2002-10-27 05:16:55 +03:00
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
v_fast = []
|
|
|
|
v_others = []
|
2006-05-24 20:52:00 +04:00
|
|
|
vars = {}
|
1999-08-13 09:45:20 +04:00
|
|
|
has_version = false
|
2007-01-30 06:06:02 +03:00
|
|
|
continued_name = nil
|
|
|
|
continued_line = nil
|
2000-12-28 08:00:47 +03:00
|
|
|
File.foreach "config.status" do |line|
|
|
|
|
next if /^#/ =~ line
|
2007-01-30 06:06:02 +03:00
|
|
|
name = nil
|
|
|
|
case line
|
|
|
|
when /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/
|
2006-06-25 18:03:10 +04:00
|
|
|
name = $2
|
|
|
|
val = $3.gsub(/\\(?=,)/, '')
|
2007-01-30 06:06:02 +03:00
|
|
|
when /^S\["(\w+)"\]\s*=\s*"(.*)"\s*(\\)?$/
|
|
|
|
name = $1
|
|
|
|
val = $2
|
|
|
|
if $3
|
|
|
|
continued_line = []
|
|
|
|
continued_line << val
|
|
|
|
continued_name = name
|
|
|
|
next
|
|
|
|
end
|
|
|
|
when /^"(.+)"\s*(\\)?$/
|
|
|
|
if continued_line
|
|
|
|
continued_line << $1
|
|
|
|
unless $2
|
|
|
|
val = continued_line.join("")
|
|
|
|
name = continued_name
|
|
|
|
continued_line = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
when /^(?:ac_given_)?INSTALL=(.*)/
|
|
|
|
v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n"
|
|
|
|
end
|
|
|
|
|
|
|
|
if name
|
2007-10-13 23:08:37 +04:00
|
|
|
next if /^(?:ac_.*|configure_input|(?:top_)?srcdir|\w+OBJS)$/ =~ name
|
2005-04-16 10:27:43 +04:00
|
|
|
next if /^\$\(ac_\w+\)$/ =~ val
|
|
|
|
next if /^\$\{ac_\w+\}$/ =~ val
|
|
|
|
next if /^\$ac_\w+$/ =~ val
|
2000-12-28 08:00:47 +03:00
|
|
|
next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
|
|
|
|
next if $so_name and /^RUBY_SO_NAME$/ =~ name
|
2006-06-25 18:03:10 +04:00
|
|
|
if /^program_transform_name$/ =~ name and /^s(\\?.)(.*)\1$/ =~ val
|
|
|
|
next if $install_name
|
|
|
|
sep = %r"#{Regexp.quote($1)}"
|
|
|
|
ptn = $2.sub(/\$\$/, '$').split(sep, 2)
|
|
|
|
name = "ruby_install_name"
|
|
|
|
val = "ruby".sub(/#{ptn[0]}/, ptn[1])
|
|
|
|
end
|
2005-10-18 05:18:05 +04:00
|
|
|
val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
|
2006-06-25 18:03:10 +04:00
|
|
|
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
|
|
|
|
if /^prefix$/ =~ name
|
|
|
|
val = "(TOPDIR || DESTDIR + #{val})"
|
|
|
|
end
|
|
|
|
v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
|
2006-05-24 20:52:00 +04:00
|
|
|
vars[name] = true
|
1998-01-16 15:19:09 +03:00
|
|
|
if fast[name]
|
|
|
|
v_fast << v
|
|
|
|
else
|
|
|
|
v_others << v
|
|
|
|
end
|
1999-08-13 09:45:20 +04:00
|
|
|
has_version = true if name == "MAJOR"
|
1998-01-16 15:19:09 +03: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 18:17:44 +04:00
|
|
|
drive = File::PATH_SEPARATOR == ';'
|
|
|
|
|
2005-04-16 10:27:43 +04:00
|
|
|
prefix = '/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM
|
|
|
|
print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.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 18:17:44 +04:00
|
|
|
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
|
|
|
print " CONFIG = {}\n"
|
|
|
|
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
|
|
|
|
|
|
|
unless has_version
|
2001-05-31 08:40:37 +04:00
|
|
|
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
|
1999-08-13 09:45:20 +04:00
|
|
|
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
|
|
|
|
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
|
|
|
|
print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
|
|
|
|
}
|
2007-02-28 20:05:18 +03:00
|
|
|
patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l|
|
|
|
|
m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(\d+)/.match(l) and break m[1]
|
|
|
|
}
|
|
|
|
print " CONFIG[\"PATCHLEVEL\"] = \"#{patchlevel}\"\n"
|
1999-08-13 09:45:20 +04:00
|
|
|
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 18:17:44 +04:00
|
|
|
dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/
|
|
|
|
v_others.collect! do |x|
|
2003-04-09 19:45:28 +04:00
|
|
|
if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"\]/ === x
|
* 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 18:17:44 +04:00
|
|
|
x.sub(dest, '= "$(DESTDIR)')
|
2000-06-19 07:37:55 +04:00
|
|
|
else
|
|
|
|
x
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2000-08-03 13:50:41 +04:00
|
|
|
if $install_name
|
|
|
|
v_fast << " CONFIG[\"ruby_install_name\"] = \"" + $install_name + "\"\n"
|
|
|
|
v_fast << " CONFIG[\"RUBY_INSTALL_NAME\"] = \"" + $install_name + "\"\n"
|
|
|
|
end
|
|
|
|
if $so_name
|
|
|
|
v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
|
|
|
|
end
|
|
|
|
|
2006-09-08 23:48:22 +04:00
|
|
|
print(*v_fast)
|
|
|
|
print(*v_others)
|
1999-08-13 09:45:20 +04:00
|
|
|
print <<EOS
|
2001-05-07 13:26:29 +04:00
|
|
|
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
|
|
|
|
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
|
|
|
|
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
|
|
|
|
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
|
2002-08-23 12:18:19 +04:00
|
|
|
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
|
2007-11-03 14:35:59 +03:00
|
|
|
CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
|
|
|
|
CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
|
2004-03-18 12:50:14 +03:00
|
|
|
CONFIG["topdir"] = File.dirname(__FILE__)
|
2000-07-31 13: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 11:34:53 +03:00
|
|
|
def RbConfig::expand(val, config = CONFIG)
|
* 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 18:17:44 +04:00
|
|
|
val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var|
|
|
|
|
if !(v = $1 || $2)
|
|
|
|
'$'
|
2005-11-11 02:22:03 +03: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 18:17:44 +04:00
|
|
|
config[v] = false
|
* 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 11:34:53 +03:00
|
|
|
RbConfig::expand(key, config)
|
* 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 18:17:44 +04:00
|
|
|
config[v] = key
|
2005-11-11 02:22:03 +03:00
|
|
|
key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
|
|
|
|
key
|
2000-07-31 13:43:14 +04:00
|
|
|
else
|
|
|
|
var
|
|
|
|
end
|
|
|
|
end
|
|
|
|
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 11:34:53 +03:00
|
|
|
RbConfig::expand(val)
|
2000-07-31 13:43:14 +04:00
|
|
|
end
|
1999-08-13 09:45:20 +04:00
|
|
|
end
|
2006-02-21 13:24:18 +03:00
|
|
|
Config = RbConfig # compatibility for ruby-1.8.4 and older.
|
2002-12-31 15:31:12 +03:00
|
|
|
CROSS_COMPILING = nil unless defined? CROSS_COMPILING
|
1999-08-13 09:45:20 +04:00
|
|
|
EOS
|
2005-11-11 02:22:03 +03: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-22 02:21:31 +03:00
|
|
|
end
|
|
|
|
if String === $timestamp
|
|
|
|
FileUtils.touch($timestamp)
|
|
|
|
end
|
1999-08-13 09:45:20 +04:00
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
# vi:set sw=2:
|