ruby-changes:25877
From: nobu <ko1@a...>
Date: Wed, 28 Nov 2012 21:21:29 +0900 (JST)
Subject: [ruby-changes:25877] nobu:r37934 (trunk): extconf.rb: VPATH
nobu 2012-11-28 21:21:19 +0900 (Wed, 28 Nov 2012) New Revision: 37934 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37934 Log: extconf.rb: VPATH * ext/psych/extconf.rb: compile sources in the source directory without copying by using VPATH. Modified files: trunk/ChangeLog trunk/ext/psych/extconf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 37933) +++ ChangeLog (revision 37934) @@ -1,3 +1,8 @@ +Wed Nov 28 21:21:16 2012 Nobuyoshi Nakada <nobu@r...> + + * ext/psych/extconf.rb: compile sources in the source directory + without copying by using VPATH. + Wed Nov 28 21:18:57 2012 Nobuyoshi Nakada <nobu@r...> * lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(*VPATH*) for Index: ext/psych/extconf.rb =================================================================== --- ext/psych/extconf.rb (revision 37933) +++ ext/psych/extconf.rb (revision 37934) @@ -8,20 +8,11 @@ unless find_header('yaml.h') && find_library('yaml', 'yaml_get_version') # Embed libyaml since we could not find it. - srcdir = File.expand_path File.dirname __FILE__ - files = Dir.chdir File.join(srcdir, 'yaml') do - Dir.entries(Dir.pwd).find_all { |f| - File.file?(f) && /^\.[hc]/ =~ File.extname(f) - }.map { |f| File.expand_path f } - end + $VPATH << "$(srcdir)/yaml" + $INCFLAGS << " -I$(srcdir)/yaml" - dstdir = Dir.pwd - FileUtils.cp_r files, dstdir + $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)} - $objs = (Dir.glob(File.join(File.dirname(__FILE__), '*.c')) + Dir.glob('*.c')).map{|f| - File.basename(f, '.c') + ".#{$OBJEXT}" - } - if $mswin $CFLAGS += " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H" end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/