2013-09-26 17:14:40 +02:00

44 lines
1.3 KiB
Plaintext

$NetBSD: patch-aj,v 1.6 2011/03/14 06:15:23 rumko Exp $
Detect getutent correctly on NetBSD with utmpx.
Include curses header when testing tgetent in order to prevent
crash on 64-bit architectures.
--- configure.in.orig 2003-06-03 07:58:24.000000000 -0400
+++ configure.in 2004-06-16 16:11:55.000000000 -0400
@@ -664,6 +664,8 @@
AC_MSG_ERROR(!!! no tgetent - no screen))))))
AC_TRY_RUN([
+#include <curses.h>
+
main()
{
exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
@@ -815,9 +817,16 @@
AC_TRY_LINK([
#include <time.h> /* to get time_t on SCO */
#include <sys/types.h>
-#if defined(SVR4) && !defined(DGUX)
+#include <sys/param.h>
+#if (defined(SVR4) && !defined(DGUX)) \
+ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \
+ || (defined(__DragonFly__) && (__DragonFly_version >= 200902))
#include <utmpx.h>
#define utmp utmpx
+# if defined(__NetBSD__) || defined(__DragonFly__)
+# define pututline pututxline
+# define getutent getutxent
+# endif
#else
#include <utmp.h>
#endif
@@ -1209,6 +1218,7 @@
AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
AC_HEADER_DIRENT
+AC_CHECK_HEADERS(sys/stropts.h)
AC_MSG_CHECKING(for setenv)
AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),