s4-librpc: try a 2nd logon for more error cases
[bbaumbach/samba-autobuild/.git] / source3 / configure.in
index e6a13102d50a01649b0f7bdf20ee85a27490e6d6..fb00feeb8c72127a25e1b73ac86235901b3073af 100644 (file)
@@ -1219,6 +1219,7 @@ fi
 AC_CHECK_LIB(resolv, dn_expand)
 AC_CHECK_LIB(resolv, _dn_expand)
 AC_CHECK_LIB(resolv, __dn_expand)
+AC_CHECK_LIB(inet, dn_expand)
 
 #
 # Check for the functions putprpwnam, set_auth_parameters,
@@ -1362,7 +1363,6 @@ DSO_EXPORTS=""
                                SONAMEFLAG="-Wl,-h,"
                        fi
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
                        BLDSHARED="true"
@@ -1370,7 +1370,6 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-h,"
                        PICFLAG="-KPIC"   # Is this correct for SunOS
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512)
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *netbsd* | *freebsd* | *dragonfly* )
                        BLDSHARED="true"
@@ -1379,7 +1378,6 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-fPIC -DPIC"
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
                *openbsd*)  BLDSHARED="true"
                        LDSHFLAGS="-shared"
@@ -1387,14 +1385,8 @@ DSO_EXPORTS=""
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-fPIC"
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        ;;
-               *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
-                       case "$host_os" in
-                       *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
-                       ;;
-                       esac
-                       BLDSHARED="true"
+               *irix*) BLDSHARED="true"
                        LDSHFLAGS="-Wl,-set_version,sgi1.0 -shared"
                        SONAMEFLAG="-Wl,-soname,"
                        if test "${GCC}" = "yes"; then
@@ -1473,7 +1465,6 @@ DSO_EXPORTS=""
                                PICFLAG="-fPIC"
                        fi
                        AC_DEFINE(STAT_ST_BLOCKSIZE,512)
-                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
                        for flags in "-expect_unresolved '*'" "-Wl,-expect_unresolved,'*'" ; do
                                saved_ldflags="$LDFLAGS"
                                AC_MSG_CHECKING([if $flags works])
@@ -1486,11 +1477,9 @@ DSO_EXPORTS=""
                                test x"$LDSHFLAGS_Z_NODEFS" != x && break
                        done
                        ;;
-               *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
-                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
+               *sco*) AC_DEFINE(STAT_ST_BLOCKSIZE,512)
                        ;;
-               *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
-                       BLDSHARED="true"
+               *unixware*) BLDSHARED="true"
                        LDSHFLAGS="-shared"
                        SONAMEFLAG="-Wl,-soname,"
                        PICFLAG="-KPIC"
@@ -2229,25 +2218,6 @@ if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
     AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit])
 fi
 
-dnl Look for the IPv6 varient by preference. Many systems have both.
-AC_CACHE_CHECK([for ut_addr_v6 in utmp],samba_cv_HAVE_UT_UT_ADDR_V6,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <utmp.h>],
-[struct utmp ut;  ut.ut_addr_v6[0] = 0;],
-samba_cv_HAVE_UT_UT_ADDR_V6=yes,samba_cv_HAVE_UT_UT_ADDR_V6=no,samba_cv_HAVE_UT_UT_ADDR_V6=cross)])
-if test x"$samba_cv_HAVE_UT_UT_ADDR_V6" = x"yes"; then
-    AC_DEFINE(HAVE_UT_UT_ADDR_V6,1,[Whether the utmp struct has a property ut_addr_v6])
-fi
-
-AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <utmp.h>],
-[struct utmp ut;  ut.ut_addr = 0;],
-samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
-if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
-    AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr])
-fi
-
 if test x$ac_cv_func_pututline = xyes ; then
   AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
   AC_TRY_COMPILE([#include <sys/types.h>
@@ -2268,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
 
@@ -4550,7 +4533,6 @@ case "$host_os" in
        *linux*)
            samba_cv_SYSQUOTA_FOUND=yes
            AC_DEFINE(HAVE_QUOTACTL_LINUX,1,[Whether Linux quota support is available])
-           samba_cv_sysquotas_file="lib/sysquotas_linux.c"
            AC_MSG_CHECKING(whether to use the lib/sysquotas_linux.c builtin support)
            AC_MSG_RESULT(yes)
 
@@ -4629,12 +4611,11 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4A 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
     samba_cv_SYSQUOTA_FOUND=yes;
     AC_DEFINE(HAVE_QUOTACTL_4A,1,[Whether long quotactl(int cmd, char *special, qid_t id, caddr_t addr) is available])
-    samba_cv_sysquotas_file="lib/sysquotas_4A.c"
 fi
 fi
 
@@ -4644,15 +4625,14 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4B 1
 #define AUTOCONF_TEST 1
 #include "confdefs.h"
-#include "${srcdir-.}/../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include "${srcdir-.}/../../tests/sysquotas.c"],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
            samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
 if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
     samba_cv_SYSQUOTA_FOUND=yes;
     AC_DEFINE(HAVE_QUOTACTL_4B,1,[Whether int quotactl(const char *path, int cmd, int id, char *addr) is available])
-    samba_cv_sysquotas_file="lib/sysquotas_4B.c"
     AC_CHECK_MEMBERS([struct dqblk.dqb_curbytes], # Darwin bytecount style
        [ AC_DEFINE([HAVE_STRUCT_DQBLK_DQB_CURBYTES],[1],[darwin style quota bytecount])],,
-       [#include <sys/typeѕ.h>
+       [#include <sys/types.h>
        #include <sys/quota.h>])
 
 fi
@@ -4736,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
@@ -5230,11 +5215,6 @@ else
                AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
                default_static_modules="$default_static_modules vfs_hpuxacl"
                ;;
-       *irix*)
-               AC_MSG_NOTICE(Using IRIX ACLs)
-               AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
-               default_static_modules="$default_static_modules vfs_irixacl"
-               ;;
        *aix*)
                AC_MSG_NOTICE(Using AIX ACLs)
                AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
@@ -5443,16 +5423,23 @@ fi
 #################################################
 # check for sendfile support
 
-with_sendfile_support=yes
-AC_MSG_CHECKING(whether to check to support sendfile)
+AC_MSG_CHECKING(whether sendfile support should be built in)
 AC_ARG_WITH(sendfile-support,
-[AS_HELP_STRING([--with-sendfile-support], [Check for sendfile support (default=yes)])],
+[AS_HELP_STRING([--with-sendfile-support], [Whether sendfile support should be built in (default=auto)])],
 [ case "$withval" in
-  yes)
-
-       AC_MSG_RESULT(yes);
+  yes|no)
+       AC_MSG_RESULT($withval);
+       with_sendfile_support=$withval
+       ;;
+  *)
+       AC_MSG_RESULT(yes)
+       with_sendfile_support=auto
+       ;;
+  esac ],
+)
 
-       case "$host_os" in
+if test x$with_sendfile_support != xno ; then
+    case "$host_os" in
        *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
                AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
                AC_TRY_LINK([#include <sys/sendfile.h>],
@@ -5629,14 +5616,12 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
        ;;
        *)
        ;;
-        esac
-        ;;
-  *)
-    AC_MSG_RESULT(no)
-    ;;
-  esac ],
-  AC_MSG_RESULT(yes)
-)
+    esac
+fi
+
+if test x$with_sendfile_support = xyes -a x"$samba_cv_HAVE_SENDFILE" != xyes ; then
+       AC_MSG_ERROR(sendfile support requested but sendfile not available )
+fi
 
 ############################################
 # See if we have the Linux readahead syscall.
@@ -6400,7 +6385,6 @@ SMB_MODULE(vfs_posixacl, \$(VFS_POSIXACL_OBJ), "bin/posixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aixacl, \$(VFS_AIXACL_OBJ), "bin/aixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aixacl2, \$(VFS_AIXACL2_OBJ), "bin/aixacl2.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_solarisacl, \$(VFS_SOLARISACL_OBJ), "bin/solarisacl.$SHLIBEXT", VFS)
-SMB_MODULE(vfs_irixacl, \$(VFS_IRIXACL_OBJ), "bin/irixacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_hpuxacl, \$(VFS_HPUXACL_OBJ), "bin/hpuxacl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_tru64acl, \$(VFS_TRU64ACL_OBJ), "bin/tru64acl.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_catia, \$(VFS_CATIA_OBJ), "bin/catia.$SHLIBEXT", VFS)