2012-11-28 07:22:47 -05:00
|
|
|
# -*- coding: us-ascii -*-
|
2017-07-14 02:15:58 -04:00
|
|
|
# frozen_string_literal: true
|
2010-03-28 17:49:37 -04:00
|
|
|
require 'mkmf'
|
2012-11-27 23:34:41 -05:00
|
|
|
require 'fileutils'
|
2010-03-28 17:49:37 -04:00
|
|
|
|
|
|
|
# :stopdoc:
|
|
|
|
|
2010-03-29 19:57:43 -04:00
|
|
|
dir_config 'libyaml'
|
2010-03-28 17:49:37 -04:00
|
|
|
|
2012-11-29 01:54:53 -05:00
|
|
|
if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version'))
|
2012-11-27 23:34:41 -05:00
|
|
|
# Embed libyaml since we could not find it.
|
|
|
|
|
2012-11-28 07:21:19 -05:00
|
|
|
$VPATH << "$(srcdir)/yaml"
|
|
|
|
$INCFLAGS << " -I$(srcdir)/yaml"
|
2012-11-28 00:52:11 -05:00
|
|
|
|
2019-06-02 00:00:27 -04:00
|
|
|
$srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)}.sort
|
2010-03-28 17:49:37 -04:00
|
|
|
|
2019-11-28 21:09:08 -05:00
|
|
|
header = 'yaml/yaml.h'
|
2019-12-05 03:57:05 -05:00
|
|
|
header = "{$(VPATH)}#{header}" if $nmake
|
2012-11-28 07:22:47 -05:00
|
|
|
if have_macro("_WIN32")
|
|
|
|
$CPPFLAGS << " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H"
|
2012-11-27 23:34:41 -05:00
|
|
|
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
|
2010-03-28 17:49:37 -04:00
|
|
|
|
2019-11-28 20:16:33 -05:00
|
|
|
create_makefile 'psych' do |mk|
|
2019-11-28 21:09:08 -05:00
|
|
|
mk << "YAML_H = #{header}".strip << "\n"
|
2019-11-28 20:16:33 -05:00
|
|
|
end
|
2010-03-28 17:49:37 -04:00
|
|
|
|
|
|
|
# :startdoc:
|