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