* ext/extmk.rb (extmake): keep directory names in Makefile as macros.

* lib/mkmf.rb (configuration, create_makefile): ditto.

* lib/mkmf.rb (CXX_EXT): separate C++ extensions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-04-07 14:59:24 +00:00
parent 138b4c427c
commit 9ea857d7ee
3 changed files with 31 additions and 15 deletions

View File

@ -1,3 +1,11 @@
Thu Apr 7 23:58:40 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): keep directory names in Makefile as macros.
* lib/mkmf.rb (configuration, create_makefile): ditto.
* lib/mkmf.rb (CXX_EXT): separate C++ extensions.
Thu Apr 7 17:24:17 2005 Shugo Maeda <shugo@ruby-lang.org>
* eval.c (rb_call0): "return" event hook should be always executed
@ -18,7 +26,7 @@ Thu Apr 7 11:49:53 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_maker_dc.rb (test_rss10_multiple): added a test
for making multiple Dublin Core items.
Wed Apr 6 16:06:30 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/ruby/test_env.rb (test_key): should test ENV.key instead of
@ -57,19 +65,19 @@ Tue Apr 5 15:15:26 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/trackback.rb (RSS::TrackBackUtils.new_with_value_if_need):
moved to RSS::Utils.
* lib/rss/utils.rb (RSS::Utils.new_with_value_if_need):
moved from RSS::TrackBackUtils.
* lib/rss/maker/image.rb: fixed invalid argument of
add_need_initialize_variable bug.
* lib/rss/maker/trackback.rb: ditto.
* lib/rss/rss.rb (Hash#merge): added for ruby 1.6.
* lib/rss/rss.rb (RSS::BaseModel.date_writer): changed to accept nil
for date value.

View File

@ -102,6 +102,8 @@ def extmake(target)
Dir.chdir target
top_srcdir = $top_srcdir
topdir = $topdir
mk_srcdir = CONFIG["srcdir"]
mk_topdir = CONFIG["topdir"]
prefix = "../" * (target.count("/")+1)
$hdrdir = $top_srcdir = relative_from(top_srcdir, prefix)
$topdir = prefix + $topdir
@ -115,6 +117,9 @@ def extmake(target)
unless $ignore
Config::CONFIG["srcdir"] = $srcdir
Config::CONFIG["topdir"] = $topdir
CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)/"+top_srcdir
CONFIG["srcdir"] = "$(hdrdir)/ext/#{$mdir}"
CONFIG["topdir"] = $topdir
begin
if (!(ok &&= extract_makefile(makefile)) ||
!(t = modified?(makefile, MTIMES)) ||
@ -140,14 +145,12 @@ def extmake(target)
rm_f "conftest*"
config = $0
$0 = $PROGRAM_NAME
Config::CONFIG["srcdir"] = $top_srcdir
Config::CONFIG["topdir"] = topdir
end
end
ok = yield(ok) if block_given?
unless ok
open(makefile, "w") do |f|
f.print dummy_makefile($srcdir)
f.print dummy_makefile(CONFIG["srcdir"])
end
return true
end
@ -175,6 +178,10 @@ def extmake(target)
end
ensure
Config::CONFIG["srcdir"] = $top_srcdir
Config::CONFIG["topdir"] = topdir
CONFIG["srcdir"] = mk_srcdir
CONFIG["topdir"] = mk_topdir
CONFIG.delete("hdrdir")
$hdrdir = $top_srcdir = top_srcdir
$topdir = topdir
Dir.chdir dir

View File

@ -8,10 +8,11 @@ require 'shellwords'
CONFIG = Config::MAKEFILE_CONFIG
ORIG_LIBPATH = ENV['LIB']
SRC_EXT = %w[c cc m cxx cpp]
CXX_EXT = %w[cc cxx cpp]
if /mswin|bccwin|mingw|msdosdjgpp|human|os2/ !~ CONFIG['build_os']
SRC_EXT.concat(%w[C])
CXX_EXT.concat(%w[C])
end
SRC_EXT = %w[c m] << CXX_EXT
$static = $config_h = nil
unless defined? $configure_args
@ -847,8 +848,8 @@ SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = #{srcdir}
topdir = #{$topdir}
hdrdir = #{$extmk ? $hdrdir : '$(topdir)'}
topdir = #{$extmk ? CONFIG["topdir"] : $topdir}
hdrdir = #{$extmk ? CONFIG["hdrdir"] : '$(topdir)'}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
}
drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/
@ -938,7 +939,7 @@ def create_makefile(target, srcprefix = nil)
target_prefix = ""
end
srcprefix ||= '$(srcdir)'
srcprefix ||= CONFIG['srcdir']
Config::expand(srcdir = srcprefix.dup)
if not $objs
@ -979,7 +980,7 @@ def create_makefile(target, srcprefix = nil)
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
mfile = open("Makefile", "wb")
mfile.print configuration(srcdir)
mfile.print configuration(srcprefix)
mfile.print %{
libpath = #{$LIBPATH.join(" ")}
LIBPATH = #{libpath}
@ -1058,7 +1059,7 @@ site-install-rb: install-rb
mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
mfile.print "\n"
%w[cc cpp cxx C].each do |ext|
CXX_EXT.each do |ext|
COMPILE_RULES.each do |rule|
mfile.printf(rule, ext, $OBJEXT)
mfile.printf("\n\t%s\n\n", COMPILE_CXX)