From: David Woodhouse Date: Sun, 25 Sep 2016 19:32:17 +0000 (+0100) Subject: Fix openssl dependency in openssl.pc X-Git-Tag: v7.08~22 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d32953375532531724e305444e722eb70ba4a004;p=users%2Fdwmw2%2Fopenconnect.git Fix openssl dependency in openssl.pc When we discover a native system OpenSSL without pkg-config, don't require openssl in openconnect.pc; instead add $OPENSSL_LIBS to Libs.private. Only when we found it automatically though; when we use --with-openssl=/where/I/built/openssl then we build statically anyway so there's no need. Signed-off-by: David Woodhouse --- diff --git a/configure.ac b/configure.ac index 696f5132..f437c76d 100644 --- a/configure.ac +++ b/configure.ac @@ -303,7 +303,7 @@ if test "$ssl_library" = ""; then if test "$with_gnutls" = "yes" -o "$with_openssl" = "no"; then AC_MSG_ERROR([Suitable GnuTLS required but not found]) elif test "$with_openssl" = "yes" -o "$with_openssl" = ""; then - PKG_CHECK_MODULES(OPENSSL, openssl, [], + PKG_CHECK_MODULES(OPENSSL, openssl, [AC_SUBST(SSL_PC, [openssl])], [oldLIBS="$LIBS" LIBS="$LIBS -lssl -lcrypto" AC_MSG_CHECKING([for OpenSSL without pkg-config]) @@ -316,7 +316,8 @@ if test "$ssl_library" = ""; then OpenSSL_add_all_algorithms();])], [AC_MSG_RESULT(yes) AC_SUBST([OPENSSL_LIBS], ["-lssl -lcrypto"]) - AC_SUBST([OPENSSL_CFLAGS], [])], + AC_SUBST([OPENSSL_CFLAGS], [])] + AC_SUBST([openssl_pc_libs], [$OPENSSL_LIBS]), [AC_MSG_RESULT(no) AC_ERROR([Could not build against OpenSSL])]) LIBS="$oldLIBS"]) @@ -449,7 +450,6 @@ case "$ssl_library" in dtls=yes AC_DEFINE(OPENCONNECT_OPENSSL, 1, [Using OpenSSL]) - AC_SUBST(SSL_PC, [openssl]) AC_SUBST(SSL_LIBS, ['$(OPENSSL_LIBS)']) AC_SUBST(SSL_CFLAGS, ['$(OPENSSL_CFLAGS)']) ;; diff --git a/openconnect.pc.in b/openconnect.pc.in index ef660713..6e750733 100644 --- a/openconnect.pc.in +++ b/openconnect.pc.in @@ -9,5 +9,5 @@ Description: OpenConnect VPN client Version: @VERSION@ Requires.private: @LIBPROXY_PC@ @ZLIB_PC@ @LIBLZ4_PC@ @SSL_PC@ @P11KIT_PC@ @LIBSTOKEN_PC@ @LIBPSKC_PC@ @LIBPCSCLITE_PC@ libxml-2.0 Libs: -L${libdir} -lopenconnect -Libs.private: @INTL_LIBS@ @system_pcsc_libs@ +Libs.private: @INTL_LIBS@ @system_pcsc_libs@ @openssl_pc_libs@ Cflags: -I${includedir}