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
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.
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.
15 Modified from patch by Maarten ter Huurne.
17 Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
19 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
21 configure.ac | 14 ++++++++++++--
22 1 file changed, 12 insertions(+), 2 deletions(-)
24 diff --git a/src/configure.ac b/src/configure.ac
25 index bd748d9..ab799d2 100644
28 @@ -179,14 +179,24 @@ AC_EGREP_CPP(YES_IS_DEFINED,
30 ], LIBS="$LIBS -lsocket -linet";seqptx=1)
35 +#if defined(SVR4) || defined(__SVR4)
38 +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
39 +if test -n "$svr4" ; then
43 AC_TRY_LINK([#include <utmpx.h>
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))])]
52 AC_CHECK_HEADERS([stropts.h string.h strings.h])
54 AC_CHECKING(for Solaris 2.x)