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>
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
25 @@ -179,14 +179,24 @@ AC_EGREP_CPP(yes,
27 ], LIBS="$LIBS -lsocket -linet";seqptx=1)
32 +#if defined(SVR4) || defined(__SVR4)
35 +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
36 +if test -n "$svr4" ; then
40 AC_TRY_LINK([#include <utmpx.h>
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))])]
49 AC_CHECK_HEADERS([stropts.h string.h strings.h])
51 AC_CHECKING(for Solaris 2.x)