From d8da0faf236052d7e16c08bcb31c2d32d661a266 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 28 Nov 2012 12:21:19 +0000 Subject: extconf.rb: VPATH * ext/psych/extconf.rb: compile sources in the source directory without copying by using VPATH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/psych/extconf.rb | 15 +++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 082993361e..f859ca0462 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 28 21:21:16 2012 Nobuyoshi Nakada + + * ext/psych/extconf.rb: compile sources in the source directory + without copying by using VPATH. + Wed Nov 28 21:18:57 2012 Nobuyoshi Nakada * lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(*VPATH*) for diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index 58fa359347..c545a9de77 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -8,19 +8,10 @@ dir_config 'libyaml' 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 - - dstdir = Dir.pwd - FileUtils.cp_r files, dstdir + $VPATH << "$(srcdir)/yaml" + $INCFLAGS << " -I$(srcdir)/yaml" - $objs = (Dir.glob(File.join(File.dirname(__FILE__), '*.c')) + Dir.glob('*.c')).map{|f| - File.basename(f, '.c') + ".#{$OBJEXT}" - } + $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)} if $mswin $CFLAGS += " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H" -- cgit v1.2.3