xref: /OK3568_Linux_fs/buildroot/package/libtelnet/0001-fix-compilation-without-zlib.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 1670ca128118be1d914fc89223e94c4cff1bbf03 Mon Sep 17 00:00:00 2001
2From: Jan Heylen <jan.heylen@nokia.com>
3Date: Wed, 25 Oct 2017 06:45:49 +0200
4Subject: [PATCH] Fix compilation without zlib
5
6libtelnet source code uses '#if defived(HAVE_ZLIB)' as conditional flag for
7optional compression support. But the configure(.ac) script does not play well
8with this: it will define 'HAVE_ZLIB' to either 1 (zlib present) or 0
9(zlib not present). For the C preprocessor, both cases mean 'defined'.
10
11As a result, compilation will fail when trying to include zlib.h, which is
12missing.
13
14Signed-off-by: Jan Heylen <jan.heylen@nokia.com>
15Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
16---
17 configure.ac | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20Upstream-status: upstream has changed to cmake iso autotools (but not yet
21released) [1] and a pull request exists to fix several issues with that,
22including correct handling of zlib detection [2].
23
24[1] https://github.com/seanmiddleditch/libtelnet/commit/4860d10da44929554895c0ef83274f38de68e958
25[2] https://github.com/seanmiddleditch/libtelnet/pull/54
26
27diff --git a/configure.ac b/configure.ac
28index 021b48f..c4dac8b 100644
29--- a/configure.ac
30+++ b/configure.ac
31@@ -33,7 +33,7 @@ AC_HEADER_STDC
32 PKG_CHECK_MODULES([zlib],
33   [zlib],
34   [AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])],
35-  [AC_DEFINE([HAVE_ZLIB], [0], [Define to 1 if you have zlib.])])
36+  [AC_MSG_NOTICE([not enabling zlib support])])
37
38 # Checks for header files.
39
40--
412.7.4
42
43