From 0243b2c15900f836358e186bb5e29a7d91aa28b4 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 21 Oct 2002 14:17:44 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mkconfig.rb | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'mkconfig.rb') diff --git a/mkconfig.rb b/mkconfig.rb index b23e6b03c..0109f0973 100644 --- a/mkconfig.rb +++ b/mkconfig.rb @@ -3,7 +3,7 @@ require File.dirname($0)+"/lib/ftools" rbconfig_rb = ARGV[0] || 'rbconfig.rb' -srcdir = $srcdir if $srcdir +srcdir = $srcdir || '.' File.makedirs(File.dirname(rbconfig_rb), true) version = RUBY_VERSION @@ -23,10 +23,8 @@ module Config # made to this file will be lost the next time ruby is built. ] -print " DESTDIR = '' if not defined? DESTDIR\n CONFIG = {}\n" v_fast = [] v_others = [] -has_srcdir = false has_version = false File.foreach "config.status" do |line| next if /^#/ =~ line @@ -49,19 +47,33 @@ File.foreach "config.status" do |line| end has_version = true if name == "MAJOR" elsif /^(?:ac_given_)?srcdir=(.*)/ =~ line - v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path($1) + "\"\n" - has_srcdir = true + srcdir = $1 elsif /^ac_given_INSTALL=(.*)/ =~ line v_fast << " CONFIG[\"INSTALL\"] = " + $1 + "\n" end # break if /^CEOF/ end -if not has_srcdir - v_fast << " CONFIG[\"srcdir\"] = \"" + File.expand_path(srcdir || '.') + "\"\n" +srcdir = File.expand_path(srcdir) +v_fast.unshift(" CONFIG[\"srcdir\"] = \"" + srcdir + "\"\n") + +v_fast.collect! do |x| + if /"prefix"/ === x + x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)') + else + x + end end -if not has_version +drive = File::PATH_SEPARATOR == ';' + +prefix = Regexp.quote('/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM) +print " TOPDIR = File.dirname(__FILE__).sub!(%r'#{prefix}\\Z', '')\n" +print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" +print " CONFIG = {}\n" +print " CONFIG[\"DESTDIR\"] = DESTDIR\n" + +unless has_version RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) { print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n" print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n" @@ -69,11 +81,10 @@ if not has_version } end -v_fast.collect! do |x| - if /"prefix"/ === x - prefix = Regexp.quote('/lib/ruby/' + RUBY_VERSION.sub(/\.\d+$/, '') + '/' + RUBY_PLATFORM) - puts " TOPDIR = File.dirname(__FILE__).sub!(%r'#{prefix}\\Z', '')" - x.sub(/= (.*)/, '= (TOPDIR || DESTDIR + \1)') +dest = drive ? /= \"(?!\$[\(\{])(?:[a-z]:)?/i : /= \"(?!\$[\(\{])/ +v_others.collect! do |x| + if /^\s*CONFIG\["(?!abs_|old)[a-z]+(?:_prefix|dir)"]/ === x + x.sub(dest, '= "$(DESTDIR)') else x end @@ -97,10 +108,14 @@ print <