Skip to content

Commit

Permalink
When not using the builtin zlib, link it before linking libcrypto, as…
Browse files Browse the repository at this point in the history
… libcrypto depends on zlib.

This prevents "undefined symbol" errors which might arise from libcrypto.a if linking openssl statically.
  • Loading branch information
Romain-Geissler-1A authored and tridge committed Apr 8, 2024
1 parent 85c906f commit 2a2116e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -1094,26 +1114,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
Expand Down

0 comments on commit 2a2116e

Please sign in to comment.