summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-12 20:24:22 +0900
committerGitHub <noreply@github.com>2022-10-12 20:24:22 +0900
commit348c74a3cf6f74ea197ad9581dfa8038f6ce8340 (patch)
treeb4a219fb25ef871146c2bf522097d000d653b739
parented5ce03abfaa5f4702a49cfcab88be2bfd1a19ab (diff)
parentde2b98c7b738af7d277c302e6f64b5dd0f9fad9e (diff)
downloadpsych-348c74a3cf6f74ea197ad9581dfa8038f6ce8340.tar.gz
Merge pull request #592 from nobu/yaml-notfound
Abandon when libyaml is not found
-rw-r--r--ext/psych/extconf.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index 2417356..41daf8c 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -7,14 +7,6 @@ if $mswin or $mingw or $cygwin
end
yaml_source = with_config("libyaml-source-dir")
-unless yaml_source # default to pre-installed libyaml
- pkg_config('yaml-0.1')
- dir_config('libyaml')
- unless find_header('yaml.h') && find_library('yaml', 'yaml_get_version')
- yaml_source = true # fallback to the bundled source if exists
- end
-end
-
if yaml_source
yaml_source = yaml_source.gsub(/\$\((\w+)\)|\$\{(\w+)\}/) {ENV[$1||$2]}
yaml_source = yaml_source.chomp("/")
@@ -44,6 +36,11 @@ if yaml_source
libyaml = "libyaml.#$LIBEXT"
$cleanfiles << libyaml
$LOCAL_LIBS.prepend("$(LIBYAML) ")
+else # default to pre-installed libyaml
+ pkg_config('yaml-0.1')
+ dir_config('libyaml')
+ find_header('yaml.h') or abort "yaml.h not found"
+ find_library('yaml', 'yaml_get_version') or abort "libyaml not found"
end
create_makefile 'psych' do |mk|