Permalink
Browse files

only do have_header checks if we are embedding libyaml

  • Loading branch information...
tenderlove committed Nov 17, 2012
1 parent a9d1ae7 commit a38ea94c443e41d404d28926effe056ebc2c5750
Showing with 16 additions and 14 deletions.
  1. +16 −14 ext/psych/extconf.rb
View
@@ -5,21 +5,8 @@
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 @@
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

0 comments on commit a38ea94

Please sign in to comment.