$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 + main() { exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); @@ -815,9 +817,16 @@ AC_TRY_LINK([ #include /* to get time_t on SCO */ #include -#if defined(SVR4) && !defined(DGUX) +#include +#if (defined(SVR4) && !defined(DGUX)) \ + || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \ + || (defined(__DragonFly__) && (__DragonFly_version >= 200902)) #include #define utmp utmpx +# if defined(__NetBSD__) || defined(__DragonFly__) +# define pututline pututxline +# define getutent getutxent +# endif #else #include #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),