Merge pull request #8361 from jandelgado/add_udptunnel_package
[feed/packages.git] / utils / screen / patches / 060-PATCH-4-4-Avoid-mis-identifying-systems-as-SVR4.patch
1 From ec90292592dd2c9d5c108390841e3df24e377ed5 Mon Sep 17 00:00:00 2001
2 From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3 Date: Sat, 24 Feb 2018 15:22:05 +0100
4 Subject: [PATCH] [PATCH 4/4] Avoid mis-identifying systems as SVR4
5
6 Linux can be misdetected as SVR4 because it has
7 libelf installed. This leads to linking with libelf, even though no
8 symbols from that library were actually used, and to a workaround for
9 a buggy getlogin() being enabled.
10
11 It is not documented which exact SVR4 system had the bug that the
12 workaround was added for, so all I could do is make an educated guess
13 at the #defines its compiler would be likely to set.
14
15 Modified from patch by Maarten ter Huurne.
16
17 Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
18
19 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
20 ---
21 configure.ac | 14 ++++++++++++--
22 1 file changed, 12 insertions(+), 2 deletions(-)
23
24 diff --git a/src/configure.ac b/src/configure.ac
25 index bd748d9..ab799d2 100644
26 --- a/configure.ac
27 +++ b/configure.ac
28 @@ -179,14 +179,24 @@ AC_EGREP_CPP(YES_IS_DEFINED,
29 #endif
30 ], LIBS="$LIBS -lsocket -linet";seqptx=1)
31
32 +AC_CHECKING(SVR4)
33 +AC_EGREP_CPP(yes,
34 +[main () {
35 +#if defined(SVR4) || defined(__SVR4)
36 + yes;
37 +#endif
38 +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
39 +if test -n "$svr4" ; then
40 oldlibs="$LIBS"
41 LIBS="$LIBS -lelf"
42 AC_CHECKING(SVR4)
43 AC_TRY_LINK([#include <utmpx.h>
44 ],,
45 -[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
46 -[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
47 +[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
48 +[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
49 ,LIBS="$oldlibs")
50 +fi
51 +
52 AC_CHECK_HEADERS([stropts.h string.h strings.h])
53
54 AC_CHECKING(for Solaris 2.x)
55 --
56 2.17.1
57