docker-engine: new package
[buildroot-gz.git] / package / screen / 0005-avoid-identifying-as-SVR4.patch
blob745ef41931dabe0c7d7ae5e3f6ce77efbcedf39e
1 From: Maarten ter Huurne <maarten@treewalker.org>
2 Date: Sun, 14 Sep 2014 11:16:58 +0200
3 Subject: Avoid mis-identifying systems as SVR4
5 My openSUSE 13.1 Linux system was detected as SVR4 because it had
6 libelf installed. This leads to linking with libelf, even though no
7 symbols from that library were actually used, and to a workaround for
8 a buggy getlogin() being enabled.
10 It is not documented which exact SVR4 system had the bug that the
11 workaround was added for, so all I could do is make an educated guess
12 at the #defines its compiler would be likely to set.
14 Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
15 [Ricardo: rebase on top of 4.3.1]
16 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
17 ---
18 configure.ac | 14 ++++++++++++--
19 1 file changed, 12 insertions(+), 2 deletions(-)
21 diff --git a/configure.ac b/configure.ac
22 index 9cf7cee..e09e4cf 100644
23 --- a/configure.ac
24 +++ b/configure.ac
25 @@ -179,14 +179,24 @@ AC_EGREP_CPP(yes,
26 #endif
27 ], LIBS="$LIBS -lsocket -linet";seqptx=1)
29 +AC_CHECKING(SVR4)
30 +AC_EGREP_CPP(yes,
31 +[main () {
32 +#if defined(SVR4) || defined(__SVR4)
33 + yes;
34 +#endif
35 +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
36 +if test -n "$svr4" ; then
37 oldlibs="$LIBS"
38 LIBS="$LIBS -lelf"
39 AC_CHECKING(SVR4)
40 AC_TRY_LINK([#include <utmpx.h>
41 ],,
42 -[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
43 -[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
44 +[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
45 +[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
46 ,LIBS="$oldlibs")
47 +fi
49 AC_CHECK_HEADERS([stropts.h string.h strings.h])
51 AC_CHECKING(for Solaris 2.x)
52 --
53 1.8.4.5