Skip to content
Permalink
Browse files

only embed libyaml if the system does not have it

  • Loading branch information...
tenderlove committed Nov 17, 2012
1 parent b8e9d7e commit 3b066cf94a4f37e0395b2b761cda1862a13fcbd9
@@ -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 '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/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3b066cf

Please sign in to comment.
You can’t perform that action at this time.