From 1fbea3bef7065455a760e512a5a908a21022536a Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 5 Jan 2003 08:50:21 +0000 Subject: [PATCH] * ext/extmk.rb (extmake): set $0 temporarily while loading extconf.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/extmk.rb | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45f836873f..3123bf8c7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 5 17:44:37 2003 Nobuyoshi Nakada + + * ext/extmk.rb (extmake): set $0 temporarily while loading + extconf.rb. + Sun Jan 5 14:46:46 2003 WATANABE Hirofumi * instruby.rb: need paren in regexp(make -n install). diff --git a/ext/extmk.rb b/ext/extmk.rb index 1280daf118..f8e983ebf6 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -66,14 +66,21 @@ def extmake(target) $defs = [] Logging::logfile 'mkmf.log' Config::CONFIG["srcdir"] = $srcdir - if File.exist?("#{$srcdir}/makefile.rb") - load "#{$srcdir}/makefile.rb" - elsif File.exist?("#{$srcdir}/extconf.rb") - load "#{$srcdir}/extconf.rb" - else - create_makefile(target) + begin + if File.exist?($0 = "#{$srcdir}/makefile.rb") + load $0 + elsif File.exist?($0 = "#{$srcdir}/extconf.rb") + load $0 + else + create_makefile(target) + end + rescue SystemExit + # ignore + ensure + rm_f "conftest*" + $0 = __FILE__ + Config::CONFIG["srcdir"] = $top_srcdir end - Config::CONFIG["srcdir"] = $top_srcdir end end if File.exist?("./Makefile") @@ -96,10 +103,7 @@ def extmake(target) $extlibs += " " + $libs unless $libs == "" $extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == "" end - rescue SystemExit - # ignore ensure - rm_f "conftest*" Dir.chdir dir end true