summaryrefslogtreecommitdiff
path: root/ext/psych
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych')
-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"