summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-11-17 12:49:31 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-11-17 12:49:48 -0800
commit3b066cf94a4f37e0395b2b761cda1862a13fcbd9 (patch)
tree8b03a45feeb7fb51e7a9e843e5193fe00ce914d2 /ext
parentb8e9d7eb55e59d19de33f828c6979a76d9a0fedc (diff)
downloadpsych-3b066cf94a4f37e0395b2b761cda1862a13fcbd9.tar.gz
only embed libyaml if the system does not have it
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/extconf.rb18
-rw-r--r--ext/psych/yaml/api.c (renamed from ext/psych/api.c)0
-rw-r--r--ext/psych/yaml/config.h (renamed from ext/psych/config.h)0
-rw-r--r--ext/psych/yaml/dumper.c (renamed from ext/psych/dumper.c)0
-rw-r--r--ext/psych/yaml/emitter.c (renamed from ext/psych/emitter.c)0
-rw-r--r--ext/psych/yaml/loader.c (renamed from ext/psych/loader.c)0
-rw-r--r--ext/psych/yaml/parser.c (renamed from ext/psych/parser.c)0
-rw-r--r--ext/psych/yaml/reader.c (renamed from ext/psych/reader.c)0
-rw-r--r--ext/psych/yaml/scanner.c (renamed from ext/psych/scanner.c)0
-rw-r--r--ext/psych/yaml/writer.c (renamed from ext/psych/writer.c)0
-rw-r--r--ext/psych/yaml/yaml.h (renamed from ext/psych/yaml.h)0
-rw-r--r--ext/psych/yaml/yaml_private.h (renamed from ext/psych/yaml_private.h)0
12 files changed, 17 insertions, 1 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index 717aa34..acf46f5 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -1,7 +1,10 @@
require 'mkmf'
+require 'fileutils'
# :stopdoc:
+dir_config 'libyaml'
+
have_header 'dlfcn.h'
have_header 'inttypes.h'
have_header 'memory.h'
@@ -12,7 +15,20 @@ have_header 'string.h'
have_header 'sys/stat.h'
have_header 'sys/types.h'
have_header 'unistd.h'
-have_header 'config.h'
+
+unless find_header('yaml.h') && find_library('yaml', 'yaml_get_version')
+ 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
+ }.map { |f| File.expand_path f }
+ end
+
+ FileUtils.cp_r files, srcdir
+
+ find_header 'yaml.h'
+ have_header 'config.h'
+end
case RUBY_PLATFORM
when /mswin/
diff --git a/ext/psych/api.c b/ext/psych/yaml/api.c
index 0c4732e..0c4732e 100644
--- a/ext/psych/api.c
+++ b/ext/psych/yaml/api.c
diff --git a/ext/psych/config.h b/ext/psych/yaml/config.h
index 6d6c25b..6d6c25b 100644
--- a/ext/psych/config.h
+++ b/ext/psych/yaml/config.h
diff --git a/ext/psych/dumper.c b/ext/psych/yaml/dumper.c
index 203c6a7..203c6a7 100644
--- a/ext/psych/dumper.c
+++ b/ext/psych/yaml/dumper.c
diff --git a/ext/psych/emitter.c b/ext/psych/yaml/emitter.c
index c4b56a2..c4b56a2 100644
--- a/ext/psych/emitter.c
+++ b/ext/psych/yaml/emitter.c
diff --git a/ext/psych/loader.c b/ext/psych/yaml/loader.c
index 9d3d912..9d3d912 100644
--- a/ext/psych/loader.c
+++ b/ext/psych/yaml/loader.c
diff --git a/ext/psych/parser.c b/ext/psych/yaml/parser.c
index eb2a2c7..eb2a2c7 100644
--- a/ext/psych/parser.c
+++ b/ext/psych/yaml/parser.c
diff --git a/ext/psych/reader.c b/ext/psych/yaml/reader.c
index 829e32d..829e32d 100644
--- a/ext/psych/reader.c
+++ b/ext/psych/yaml/reader.c
diff --git a/ext/psych/scanner.c b/ext/psych/yaml/scanner.c
index a2e8619..a2e8619 100644
--- a/ext/psych/scanner.c
+++ b/ext/psych/yaml/scanner.c
diff --git a/ext/psych/writer.c b/ext/psych/yaml/writer.c
index b90019f..b90019f 100644
--- a/ext/psych/writer.c
+++ b/ext/psych/yaml/writer.c
diff --git a/ext/psych/yaml.h b/ext/psych/yaml/yaml.h
index 5a04d36..5a04d36 100644
--- a/ext/psych/yaml.h
+++ b/ext/psych/yaml/yaml.h
diff --git a/ext/psych/yaml_private.h b/ext/psych/yaml/yaml_private.h
index ed5ea66..ed5ea66 100644
--- a/ext/psych/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h