summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in18
-rw-r--r--source3/wscript8
2 files changed, 26 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 70632bc3cb..fb00feeb8c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2238,6 +2238,19 @@ if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen])
fi
+AC_CACHE_CHECK([whether sizeof ut_line in utmp is ok],samba_cv_HAVE_UX_UT_LINE,[
+AC_TRY_RUN([#include <stdio.h>
+#include <sys/types.h>
+#include <utmp.h>
+int main(void) {
+ if (sizeof(((struct utmp *)NULL)->ut_line) < 15) {
+ return 1;
+ }
+ return 0;
+}
+],
+samba_cv_HAVE_UX_UT_LINE=yes,samba_cv_HAVE_UX_UT_LINE=no,samba_cv_HAVE_UX_UT_LINE=cross)])
+
fi
# end utmp details
@@ -4703,6 +4716,11 @@ if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then
WITH_UTMP=no
fi
+if test x"$WITH_UTMP" = x"yes" -a x"$samba_cv_HAVE_UX_UT_LINE" != x"yes"; then
+ utmp_no_reason=", sizeof ut_line not ok"
+ WITH_UTMP=no
+fi
+
# Display test results
if test x"$WITH_UTMP" = x"yes"; then
diff --git a/source3/wscript b/source3/wscript
index 56ab760750..92575c8264 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -660,8 +660,16 @@ msg.msg_acctrightslen = sizeof(fd);
conf.CHECK_CODE('struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);',
'PUTUTLINE_RETURNS_UTMP', headers='utmp.h',
msg="Checking whether pututline returns pointer")
+ conf.CHECK_SIZEOF(['((struct utmp *)NULL)->ut_line'], headers='utmp.h',
+ define='SIZEOF_UTMP_UT_LINE')
+ if not conf.CONFIG_SET('SIZEOF_UTMP_UT_LINE'):
+ conf.env.with_utmp = False
+ elif int(conf.env.SIZEOF_UTMP_UT_LINE) < 15:
+ conf.env.with_utmp = False
if conf.env.with_utmp:
conf.DEFINE('WITH_UTMP', 1)
+ else:
+ Logs.warn("--with-utmp but utmp support not sufficient")
if Options.options.with_avahi:
conf.env.with_avahi = True