]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
autotools: Fix static linking when openssl is enabled in windows 1723/head
authorBiswapriyo Nath <nathbappai@gmail.com>
Wed, 13 Apr 2022 04:18:44 +0000 (09:48 +0530)
committerBiswapriyo Nath <nathbappai@gmail.com>
Wed, 13 Apr 2022 04:18:44 +0000 (09:48 +0530)
This adds Requires.private field in pkgconfig file. Using that field,
pkgconfig pulls all the private cflags or libs while static linking.
OpenSSL static libraries require some windows system libraies. Otherwise
static liking fails with libarchive.

build/pkgconfig/libarchive.pc.in
configure.ac

index 4b631e635ccf1ecbf5712b62e8cbbf0d13591a07..1f51e77f16798977a00c09b5591fc2eb7eabc14b 100644 (file)
@@ -10,3 +10,4 @@ Cflags: -I${includedir}
 Cflags.private: -DLIBARCHIVE_STATIC
 Libs: -L${libdir} -larchive
 Libs.private: @LIBS@
+Requires.private: @LIBSREQUIRED@
index 2f53fae3947417092e429b10dd19164232a001f3..b30430d21cc51b9b29b1634907bfe72752b0fcda 100644 (file)
@@ -378,6 +378,7 @@ if test "x$with_iconv" != "xno"; then
     AC_CHECK_HEADERS([localcharset.h])
     am_save_LIBS="$LIBS"
     LIBS="${LIBS} ${LIBICONV}"
+    LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
     AC_CHECK_FUNCS([locale_charset])
     LIBS="${am_save_LIBS}"
     if test "x$ac_cv_func_locale_charset" != "xyes"; then
@@ -1209,6 +1210,7 @@ fi
 if test "x$with_openssl" != "xno"; then
     AC_CHECK_HEADERS([openssl/evp.h])
     saved_LIBS=$LIBS
+    LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto"
     AC_CHECK_LIB(crypto,OPENSSL_config)
     CRYPTO_CHECK(MD5, OPENSSL, md5)
     CRYPTO_CHECK(RMD160, OPENSSL, rmd160)
@@ -1219,6 +1221,8 @@ if test "x$with_openssl" != "xno"; then
     AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
 fi
 
+AC_SUBST(LIBSREQUIRED)
+
 # Probe libmd AFTER OpenSSL/libcrypto.
 # The two are incompatible and OpenSSL is more complete.
 AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h])