aboutsummaryrefslogtreecommitdiff
path: root/auto.def
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2016-08-29 09:58:11 +1000
committerSteve Bennett <steveb@workware.net.au>2016-08-29 09:58:32 +1000
commit5dd45e7baf34854b588dd77553f000fd111d0ed0 (patch)
treeb8a501f5b58593170c6aa53d2c8c1bc3ac7232a8 /auto.def
parentd24ed2e51f0476bd4bacc18076a495f28474c29a (diff)
downloadjimtcl-5dd45e7baf34854b588dd77553f000fd111d0ed0.zip
jimtcl-5dd45e7baf34854b588dd77553f000fd111d0ed0.tar.gz
jimtcl-5dd45e7baf34854b588dd77553f000fd111d0ed0.tar.bz2
configure: Use pkg-config to find openssl/libssl
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'auto.def')
-rw-r--r--auto.def26
1 files 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]} {