Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve checks for pkg-config and fall back to gpgme-config #168

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ext/gpgme/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@
end

if arg_config('--use-system-libraries', ENV['RUBY_GPGME_USE_SYSTEM_LIBRARIES'])
unless find_executable('pkg-config')
$stderr.puts("pkg-config not found")
if find_executable('pkg-config') && system('pkg-config gpgme --exists')
$CFLAGS += ' ' << `pkg-config --cflags gpgme`.chomp
$libs += ' ' << `pkg-config --libs gpgme`.chomp
elsif find_executable('gpgme-config')
$CFLAGS += ' ' << `gpgme-config --cflags`.chomp
$libs += ' ' << `gpgme-config --libs`.chomp
else
$stderr.puts("pkg-config with gpgme.pc and gpgme-config not found")
exit(1)
end

$CFLAGS += ' ' << `pkg-config --cflags gpgme`.chomp
$libs += ' ' << `pkg-config --libs gpgme`.chomp
else
message <<-'EOS'
************************************************************************
Expand Down