summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2022-07-22 09:24:45 +1000
committerDarren Tucker <dtucker@dtucker.net>2022-07-27 16:22:03 +1000
commitf117e372b3f42f2fbdb0a578d063b2609ab58e1f (patch)
treec83a669ffb1291e3c40ec877d593acc92830d963 /configure.ac
parent800c2483e68db38bd1566ff69677124be974aceb (diff)
downloadopenssh-git-f117e372b3f42f2fbdb0a578d063b2609ab58e1f.tar.gz
Do not link scp, sftp and sftp-server w/ zlib.
Some of our binaries (eg sftp, sftp-server, scp) do not interact with the channels code and thus do use libraries such as zlib and libcrypto although they are linked with them. This adds a CHANNELLIBS and starts by moving zlib into it, which means the aformentioned binaries are no longer linked against zlib. ok djm@
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 9 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 922195e1..6fa9bdc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1388,18 +1388,21 @@ AC_ARG_WITH([zlib],
fi ]
)
+# These libraries are needed for anything that links in the channel code.
+CHANNELLIBS=""
AC_MSG_CHECKING([for zlib])
if test "x${zlib}" = "xno"; then
AC_MSG_RESULT([no])
else
- AC_MSG_RESULT([yes])
- AC_DEFINE([WITH_ZLIB], [1], [Enable zlib])
+ saved_LIBS="$LIBS"
+ CHANNELLIBS="$CHANNELLIBS -lz"
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([WITH_ZLIB], [1], [Enable zlib])
AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])])
- AC_CHECK_LIB([z], [deflate], ,
+ AC_CHECK_LIB([z], [deflate], [],
[
saved_CPPFLAGS="$CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
- save_LIBS="$LIBS"
dnl Check default zlib install dir
if test -n "${rpath_opt}"; then
LDFLAGS="-L/usr/local/lib ${rpath_opt}/usr/local/lib ${saved_LDFLAGS}"
@@ -1407,7 +1410,6 @@ else
LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
fi
CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
- LIBS="$LIBS -lz"
AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])],
[
AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
@@ -1464,6 +1466,7 @@ See http://www.gzip.org/zlib/ for details.])
],
[ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
)
+ LIBS="$saved_LIBS"
fi
dnl UnixWare 2.x
@@ -4778,6 +4781,7 @@ AC_ARG_WITH([kerberos5],
)
AC_SUBST([GSSLIBS])
AC_SUBST([K5LIBS])
+AC_SUBST([CHANNELLIBS])
# Looking for programs, paths and files