configure.ng: use pkg-config to find PpenSSL dependencies
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 11 Apr 2019 21:24:36 +0000 (23:24 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 20 Apr 2019 16:50:09 +0000 (18:50 +0200)
OpenSSL can depends on lz or latomic so use pkg-config to find those
dependencies and fallback to existing mechanism.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Closes #256.

configure.ng

index 57ae8bb..899d00f 100644 (file)
@@ -464,8 +464,11 @@ AC_ARG_WITH(openssl,
                                CPPFLAGS="-I$withval/include $CPPFLAGS"
                                LDFLAGS="-L$withval/lib $LDFLAGS"
                        fi
-                       AC_CHECK_LIB(crypto, BIO_s_mem)
-                       AC_CHECK_LIB(ssl, SSL_new)
+                       PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto],
+                               [LIBS="$LIBS $OPENSSL_LIBS" CFLAGS="$CFLAGS $OPENSSL_CFLAGS"],
+                               [AC_CHECK_LIB(crypto, BIO_s_mem)
+                               AC_CHECK_LIB(ssl, SSL_new)]
+                       )
                        AC_CHECK_FUNCS(SSL_new, x_ssl_openssl=yes,
                                AC_MSG_ERROR([Can't enable openssl])
                        )