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>
16 configure.in | 14 ++++++++++++--
17 1 file changed, 12 insertions(+), 2 deletions(-)
19 diff --git a/configure.in b/configure.in
20 index f78f81f..181b7f9 100644
23 @@ -178,14 +178,24 @@ AC_EGREP_CPP(yes,
25 ], LIBS="$LIBS -lsocket -linet";seqptx=1)
30 +#if defined(SVR4) || defined(__SVR4)
33 +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
34 +if test -n "$svr4" ; then
38 AC_TRY_LINK([#include <utmpx.h>
40 -[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
41 -[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
42 +[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
43 +[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
47 AC_CHECK_HEADERS([stropts.h string.h strings.h])
49 AC_CHECKING(for Solaris 2.x)