]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
contrib/libunbound.pc.in: Embed the correct crypto dependencies 155/head
authorRobert Edmonds <edmonds@mycre.ws>
Mon, 27 Jan 2020 03:23:53 +0000 (22:23 -0500)
committerRobert Edmonds <edmonds@mycre.ws>
Mon, 27 Jan 2020 03:30:31 +0000 (22:30 -0500)
This commit removes the hardcoded dependency in the libunbound
pkg-config .pc file on the libcrypto and libssl modules and instead
populates the .pc file based on which crypto library was selected at
configure time.

Note that the .pc file specifies pkg-config module names for the
"Requires" line and this can vary from the library filename (e.g. "nss"
is the pkg-config module name vs. "nss3" being the library name).

configure.ac
contrib/libunbound.pc.in

index 0104554dc731b5fc48ab6f6e43f801466bb837c7..99c662792c534f589fd42c6d70c3f946761ea7ae 100644 (file)
@@ -761,6 +761,8 @@ AC_ARG_WITH([nss], AC_HELP_STRING([--with-nss=path],
        fi
         LIBS="$LIBS -lnss3 -lnspr4"
        SSLLIB=""
+       PC_CRYPTO_DEPENDENCY="nss nspr"
+       AC_SUBST(PC_CRYPTO_DEPENDENCY)
        ]
 )
 
@@ -781,6 +783,8 @@ AC_ARG_WITH([nettle], AC_HELP_STRING([--with-nettle=path],
        fi
         LIBS="$LIBS -lhogweed -lnettle -lgmp"
        SSLLIB=""
+       PC_CRYPTO_DEPENDENCY="hogweed nettle"
+       AC_SUBST(PC_CRYPTO_DEPENDENCY)
        ]
 )
 
@@ -790,6 +794,9 @@ ACX_WITH_SSL
 ACX_LIB_SSL
 SSLLIB="-lssl"
 
+PC_CRYPTO_DEPENDENCY="libcrypto libssl"
+AC_SUBST(PC_CRYPTO_DEPENDENCY)
+
 # check if -lcrypt32 is needed because CAPIENG needs that. (on windows)
 BAKLIBS="$LIBS"
 LIBS="-lssl $LIBS"
index 74dfdb6fcdb42557c5101ae2ee3f490fa06c733f..f7cd1e07413307aebb48e17f3ab233866d4e43bd 100644 (file)
@@ -7,7 +7,7 @@ Name: unbound
 Description: Library with validating, recursive, and caching DNS resolver
 URL: http://www.unbound.net
 Version: @PACKAGE_VERSION@
-Requires: libcrypto libssl @PC_LIBEVENT_DEPENDENCY@
+Requires: @PC_CRYPTO_DEPENDENCY@ @PC_LIBEVENT_DEPENDENCY@
 Requires.private: @PC_PY_DEPENDENCY@
 Libs: -L${libdir} -lunbound
 Libs.private: @SSLLIB@ @LIBS@