summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 12:21:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 12:21:19 +0000
commitd8da0faf236052d7e16c08bcb31c2d32d661a266 (patch)
treeee60105effdf5a9707728296886627deef0b40d6 /ext
parenta0f7f36a5a47098c30125d3ad5c19db71fc34960 (diff)
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
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/extconf.rb15
1 files changed, 3 insertions, 12 deletions
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"