Skip to content

Commit b1aa465

Browse files
authored
Merge pull request libarchive#1723 from Biswa96/win32-static-openssl
autotools: Fix static linking when openssl is enabled in windows
2 parents 042956b + a83f3d3 commit b1aa465

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

build/pkgconfig/libarchive.pc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Cflags: -I${includedir}
1010
Cflags.private: -DLIBARCHIVE_STATIC
1111
Libs: -L${libdir} -larchive
1212
Libs.private: @LIBS@
13+
Requires.private: @LIBSREQUIRED@

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ if test "x$with_iconv" != "xno"; then
378378
AC_CHECK_HEADERS([localcharset.h])
379379
am_save_LIBS="$LIBS"
380380
LIBS="${LIBS} ${LIBICONV}"
381+
LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
381382
AC_CHECK_FUNCS([locale_charset])
382383
LIBS="${am_save_LIBS}"
383384
if test "x$ac_cv_func_locale_charset" != "xyes"; then
@@ -1209,6 +1210,7 @@ fi
12091210
if test "x$with_openssl" != "xno"; then
12101211
AC_CHECK_HEADERS([openssl/evp.h])
12111212
saved_LIBS=$LIBS
1213+
LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto"
12121214
AC_CHECK_LIB(crypto,OPENSSL_config)
12131215
CRYPTO_CHECK(MD5, OPENSSL, md5)
12141216
CRYPTO_CHECK(RMD160, OPENSSL, rmd160)
@@ -1219,6 +1221,8 @@ if test "x$with_openssl" != "xno"; then
12191221
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
12201222
fi
12211223

1224+
AC_SUBST(LIBSREQUIRED)
1225+
12221226
# Probe libmd AFTER OpenSSL/libcrypto.
12231227
# The two are incompatible and OpenSSL is more complete.
12241228
AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h])

0 commit comments

Comments
 (0)