1# -*- coding: us-ascii -*- 2require 'mkmf' 3require 'fileutils' 4 5# :stopdoc: 6 7dir_config 'libyaml' 8 9if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version')) 10 # Embed libyaml since we could not find it. 11 12 $VPATH << "$(srcdir)/yaml" 13 $INCFLAGS << " -I$(srcdir)/yaml" 14 15 $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)} 16 17 if have_macro("_WIN32") 18 $CPPFLAGS << " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H" 19 end 20 21 have_header 'dlfcn.h' 22 have_header 'inttypes.h' 23 have_header 'memory.h' 24 have_header 'stdint.h' 25 have_header 'stdlib.h' 26 have_header 'strings.h' 27 have_header 'string.h' 28 have_header 'sys/stat.h' 29 have_header 'sys/types.h' 30 have_header 'unistd.h' 31 32 find_header 'yaml.h' 33 have_header 'config.h' 34end 35 36create_makefile 'psych' 37 38# :startdoc: 39