summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-18 09:50:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-18 09:50:14 +0000
commit18bf9e5fd914180b77c42e566b3114cdfd8b5f77 (patch)
tree532e04965de3bfc286188da5da53dae2aeb3bbe2 /lib
parent96b433faf3e5c0debea12487d0929c6a3dde2089 (diff)
downloadruby-18bf9e5fd914180b77c42e566b3114cdfd8b5f77.tar.gz
ruby-18bf9e5fd914180b77c42e566b3114cdfd8b5f77.tar.xz
ruby-18bf9e5fd914180b77c42e566b3114cdfd8b5f77.zip
* mkconfig.rb: no longer embed srcdir and compile_dir into
rbconfig.rb. * ext/extmk.rb, lib/mkmf.rb: obtain top_srcdir and topdir from library paths. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 39da5dfeb..7561edaad 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -38,7 +38,6 @@ unless defined? $configure_args
end
end
-$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]
$rubylibdir = CONFIG["rubylibdir"]
$archdir = CONFIG["archdir"]
@@ -77,12 +76,13 @@ def map_dir(dir, map = nil)
map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)}
end
-if not $extmk and File.exist?(Config::CONFIG["archdir"] + "/ruby.h")
+libdir = File.dirname(__FILE__)
+if libdir == Config::CONFIG["rubylibdir"] and
+ File.exist?(Config::CONFIG["archdir"] + "/ruby.h")
$topdir = $hdrdir = $archdir
-elsif File.exist?($srcdir + "/ruby.h") and
- File.exist?((compile_dir = Config::CONFIG['compile_dir']) + "/config.h")
- $hdrdir = $srcdir
- $topdir = compile_dir
+elsif File.exist?(($top_srcdir ||= File.dirname(libdir)) + "/ruby.h") and
+ File.exist?(($topdir ||= Config::CONFIG["topdir"]) + "/config.h")
+ $hdrdir = $top_srcdir
else
abort "can't find header files for ruby."
end
@@ -728,7 +728,7 @@ end
def configuration(srcdir)
mk = []
vpath = %w[$(srcdir) $(topdir) $(hdrdir)]
- if $mingw && CONFIG['build_os'] == 'cygwin'
+ if !CROSS_COMPILING && CONFIG['build_os'] == 'cygwin' && CONFIG['target_os'] != 'cygwin'
vpath.each {|p| p.sub!(/.*/, '$(shell cygpath -u \&)')}
end
mk << %{
@@ -739,7 +739,7 @@ SHELL = /bin/sh
srcdir = #{srcdir}
topdir = #{$topdir}
hdrdir = #{$hdrdir}
-VPATH = #{vpath.join(File::PATH_SEPARATOR)}
+VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/
if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty?