You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

  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. Linux can be misdetected as SVR4 because it has
  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.
  9. It is not documented which exact SVR4 system had the bug that the
  10. workaround was added for, so all I could do is make an educated guess
  11. at the #defines its compiler would be likely to set.
  12. Modified from patch by Maarten ter Huurne.
  13. Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
  14. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
  15. ---
  16. configure.ac | 14 ++++++++++++--
  17. 1 file changed, 12 insertions(+), 2 deletions(-)
  18. diff --git a/src/configure.ac b/src/configure.ac
  19. index bd748d9..ab799d2 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -179,14 +179,24 @@ AC_EGREP_CPP(YES_IS_DEFINED,
  23. #endif
  24. ], LIBS="$LIBS -lsocket -linet";seqptx=1)
  25. +AC_CHECKING(SVR4)
  26. +AC_EGREP_CPP(yes,
  27. +[main () {
  28. +#if defined(SVR4) || defined(__SVR4)
  29. + yes;
  30. +#endif
  31. +], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
  32. +if test -n "$svr4" ; then
  33. oldlibs="$LIBS"
  34. LIBS="$LIBS -lelf"
  35. AC_CHECKING(SVR4)
  36. AC_TRY_LINK([#include <utmpx.h>
  37. ],,
  38. -[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
  39. -[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
  40. +[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
  41. +[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
  42. ,LIBS="$oldlibs")
  43. +fi
  44. +
  45. AC_CHECK_HEADERS([stropts.h string.h strings.h])
  46. AC_CHECKING(for Solaris 2.x)
  47. --
  48. 2.17.1