From 5dd45e7baf34854b588dd77553f000fd111d0ed0 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Mon, 29 Aug 2016 09:58:11 +1000 Subject: [PATCH] configure: Use pkg-config to find openssl/libssl Signed-off-by: Steve Bennett --- auto.def | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/auto.def b/auto.def index e82d5be..d2cccef 100644 --- a/auto.def +++ b/auto.def @@ -191,12 +191,26 @@ if {[opt-bool ipv6 full]} { define JIM_IPV6 } if {[opt-bool ssl full]} { - if {[cc-check-includes openssl/ssl.h] && [cc-check-function-in-lib ERR_error_string crypto] && [cc-check-function-in-lib TLSv1_2_method ssl]} { - msg-result "Enabling SSL" - define JIM_SSL - define-append LDLIBS [get-define lib_ERR_error_string] [get-define lib_TLSv1_2_method] - } elseif {[opt-bool ssl]} { - user-error "SSL support requires OpenSSL" + if {[pkg-config-init 0]} { + foreach pkg {openssl libssl} { + if {[pkg-config $pkg]} { + define JIM_SSL + define-append LDLIBS [pkg-config-get $pkg LIBS] + define-append LDFLAGS [pkg-config-get $pkg LDFLAGS] + define-append CCOPTS [pkg-config-get $pkg CFLAGS] + msg-result "Enabling SSL ($pkg)" + break + } + } + } + if {![is-defined JIM_SSL]} { + if {[cc-check-includes openssl/ssl.h] && [cc-check-function-in-lib ERR_error_string crypto] && [cc-check-function-in-lib TLSv1_2_method ssl]} { + msg-result "Enabling SSL" + define JIM_SSL + define-append LDLIBS [get-define lib_ERR_error_string] [get-define lib_TLSv1_2_method] + } elseif {[opt-bool ssl]} { + user-error "SSL support requires OpenSSL" + } } } if {[opt-bool lineedit full]} { -- 2.11.4.GIT