Skip to content

Commit

Permalink
[ruby/psych] Abandon when libyaml is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Oct 12, 2022
1 parent 0360fca commit ed01bac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions ext/psych/extconf.rb
Expand Up @@ -7,14 +7,6 @@
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("/")
Expand Down Expand Up @@ -44,6 +36,11 @@
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 "libyaml not found"
end

create_makefile 'psych' do |mk|
Expand Down

0 comments on commit ed01bac

Please sign in to comment.