diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-11-17 12:53:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-11-17 12:53:53 -0800 |
commit | a38ea94c443e41d404d28926effe056ebc2c5750 (patch) | |
tree | ec9625ca0cd36f8b06bc706c0430c18e18ba5144 /ext | |
parent | a9d1ae74a557ea2e92b79e023870854054b664d2 (diff) | |
download | psych-a38ea94c443e41d404d28926effe056ebc2c5750.zip |
only do have_header checks if we are embedding libyaml
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/extconf.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index 5bef73d..dc4b3f6 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -5,21 +5,8 @@ require 'fileutils' dir_config 'libyaml' -have_header 'dlfcn.h' -have_header 'inttypes.h' -have_header 'memory.h' -have_header 'stdint.h' -have_header 'stdlib.h' -have_header 'strings.h' -have_header 'string.h' -have_header 'sys/stat.h' -have_header 'sys/types.h' -have_header 'unistd.h' - unless find_header('yaml.h') && find_library('yaml', 'yaml_get_version') - if $mswin - $CFLAGS += " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H" - end + # Embed libyaml since we could not find it. srcdir = File.expand_path File.dirname __FILE__ files = Dir.chdir File.join(srcdir, 'yaml') do @@ -30,6 +17,21 @@ unless find_header('yaml.h') && find_library('yaml', 'yaml_get_version') FileUtils.cp_r files, srcdir + if $mswin + $CFLAGS += " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H" + end + + have_header 'dlfcn.h' + have_header 'inttypes.h' + have_header 'memory.h' + have_header 'stdint.h' + have_header 'stdlib.h' + have_header 'strings.h' + have_header 'string.h' + have_header 'sys/stat.h' + have_header 'sys/types.h' + have_header 'unistd.h' + find_header 'yaml.h' have_header 'config.h' end |