From: Romain Geissler Date: Sun, 10 Mar 2024 22:41:43 +0000 (+0000) Subject: When not using the builtin zlib, link it before linking libcrypto, as libcrypto depen... X-Git-Tag: v3.4.0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f10f125778c87a494509f5612fc43869791d469;p=thirdparty%2Frsync.git When not using the builtin zlib, link it before linking libcrypto, as libcrypto depends on zlib. This prevents "undefined symbol" errors which might arise from libcrypto.a if linking openssl statically. --- diff --git a/configure.ac b/configure.ac index 390c5961..d2bcb471 100644 --- a/configure.ac +++ b/configure.ac @@ -424,6 +424,26 @@ case $host_os in * ) AC_MSG_RESULT(no);; esac +# We default to using our zlib unless --with-included-zlib=no is given. +if test x"$with_included_zlib" != x"no"; then + with_included_zlib=yes +elif test x"$ac_cv_header_zlib_h" != x"yes"; then + with_included_zlib=yes +fi +if test x"$with_included_zlib" != x"yes"; then + AC_CHECK_LIB(z, deflateParams, , [with_included_zlib=yes]) +fi + +AC_MSG_CHECKING([whether to use included zlib]) +if test x"$with_included_zlib" = x"yes"; then + AC_MSG_RESULT($srcdir/zlib) + BUILD_ZLIB='$(zlib_OBJS)' + CFLAGS="-I$srcdir/zlib $CFLAGS" +else + AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib]) + AC_MSG_RESULT(no) +fi + AC_MSG_CHECKING([whether to enable use of openssl crypto library]) AC_ARG_ENABLE([openssl], AS_HELP_STRING([--disable-openssl],[disable to omit openssl crypto library])) @@ -1096,26 +1116,6 @@ else AC_MSG_RESULT(no) fi -# We default to using our zlib unless --with-included-zlib=no is given. -if test x"$with_included_zlib" != x"no"; then - with_included_zlib=yes -elif test x"$ac_cv_header_zlib_h" != x"yes"; then - with_included_zlib=yes -fi -if test x"$with_included_zlib" != x"yes"; then - AC_CHECK_LIB(z, deflateParams, , [with_included_zlib=yes]) -fi - -AC_MSG_CHECKING([whether to use included zlib]) -if test x"$with_included_zlib" = x"yes"; then - AC_MSG_RESULT($srcdir/zlib) - BUILD_ZLIB='$(zlib_OBJS)' - CFLAGS="-I$srcdir/zlib $CFLAGS" -else - AC_DEFINE(EXTERNAL_ZLIB, 1, [Define to 1 if using external zlib]) - AC_MSG_RESULT(no) -fi - AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = (signed char *)""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])]) if test x"$rsync_cv_SIGNED_CHAR_OK" = x"yes"; then