TODO: s3:configure.in: fix rfc1321 md5 detection
[metze/samba/wip.git] / source3 / configure.in
index 9b49c96c60109c7b0a309b35e63a5b065b9db464..244a2dc7bd61a7386e2797469fb896d505693d1f 100644 (file)
@@ -751,6 +751,40 @@ AC_CHECK_HEADERS(xfs/libxfs.h)
 AC_CHECK_HEADERS(netgroup.h)
 AC_CHECK_HEADERS(linux/falloc.h)
 
+dnl check for OS implementation of md5 conformant to rfc1321
+samba_cv_md5lib=none
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])
+fi
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(md, MD5Update, [samba_cv_md5lib=md])
+fi
+
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5])
+fi
+
+if test x"$samba_cv_md5lib" != x"none" ; then
+       AC_CHECK_HEADERS(md5.h)
+fi
+
+if test x"$ac_cv_header_md5_h" = x"yes" -a \
+        x"$samba_cv_md5lib" = x"none" ; then
+       if test x"$samba_cv_md5lib" != x ; then
+               LIBS="${LIBS} -l${samba_cv_md5lib}"
+       fi
+       CRYPTO_MD5_OBJ=
+       AC_DEFINE(HAVE_LIBMD5, 1,
+           [Whether libmd5 conformant to rfc1321 is available.])
+else
+       CRYPTO_MD5_OBJ="../lib/crypto/md5.o"
+fi
+
+AC_SUBST(CRYPTO_MD5_OBJ)
+
+
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
 #include <rpc/rpc.h>
@@ -1083,7 +1117,7 @@ AC_CHECK_FUNCS(getgrset)
 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocate posix_fallocate64)
 AC_CHECK_FUNCS(fallocate fallocate64)
-AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
+AC_CHECK_FUNCS(fseeko fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(fdopendir fdopendir64)
 AC_CHECK_FUNCS(getpwent_r)
@@ -2103,7 +2137,7 @@ fi
 if test "x$enable_external_libtalloc" = xno
 then
        m4_include(../lib/talloc/libtalloc.m4)
-       if test x"$USESHARED" == x"no" ; then
+       if test x"$USESHARED" = x"no" ; then
                LINK_LIBTALLOC=STATIC
        fi
        LIBTALLOCVERSION=`grep ^VERSION ${tallocdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
@@ -2144,7 +2178,7 @@ AC_SUBST(LIBTDB_OBJ0)
 if test "x$enable_external_libtdb" = xno
 then
        m4_include(../lib/tdb/libtdb.m4)
-       if test x"$USESHARED" == x"no" ; then
+       if test x"$USESHARED" = x"no" ; then
                LINK_LIBTDB=STATIC
        fi
        LIBTDBVERSION=`grep ^VERSION ${tdbdir}/wscript | sed -e "s/'//g" -e 's/.* //'`
@@ -2828,8 +2862,10 @@ samba_cv_HAVE_INOTIFY=yes,
 samba_cv_HAVE_INOTIFY=no,
 samba_cv_HAVE_INOTIFY=cross)
 
-if test x"$ac_cv_func_inotify_init" = x"yes" -a x"$ac_cv_header_linux_inotify_h" = x"yes"; then
-    AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support])
+if test x"$ac_cv_func_inotify_init" = x"yes"; then
+    if test  x"$ac_cv_header_sys_inotify_h" = x"yes" -o x"$ac_cv_header_linux_inotify_h" = x"yes"; then
+        AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel or sys has inotify support])
+    fi
 fi
 
 #################################################
@@ -3841,7 +3877,6 @@ if test x"$with_ads_support" != x"no"; then
   AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS)
-  AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_free_data_contents, $KRB5_LIBS)
@@ -4120,6 +4155,27 @@ if test x"$with_ads_support" != x"no"; then
     found_arcfour_hmac=yes
   fi
 
+  AC_CACHE_CHECK([for ENCTYPE_AES128_CTS_HMAC_SHA1_96],
+                 samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96,[
+    AC_TRY_COMPILE([#include <krb5.h>],
+      [krb5_enctype enctype; enctype = ENCTYPE_AES128_CTS_HMAC_SHA1_96;],
+      samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96=yes,
+      samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96=no)])
+  if test x"$samba_cv_HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96" = x"yes"; then
+    AC_DEFINE(HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96,1,
+              [Whether the ENCTYPE_AES128_CTS_HMAC_SHA1_96 key type definition is available])
+  fi
+  AC_CACHE_CHECK([for ENCTYPE_AES256_CTS_HMAC_SHA1_96],
+                 samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96,[
+    AC_TRY_COMPILE([#include <krb5.h>],
+      [krb5_enctype enctype; enctype = ENCTYPE_AES256_CTS_HMAC_SHA1_96;],
+      samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96=yes,
+      samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96=no)])
+  if test x"$samba_cv_HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96" = x"yes"; then
+    AC_DEFINE(HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96,1,
+              [Whether the ENCTYPE_AES256_CTS_HMAC_SHA1_96 key type definition is available])
+  fi
+
   AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY],
                  samba_cv_HAVE_AP_OPTS_USE_SUBKEY,[
     AC_TRY_COMPILE([#include <krb5.h>],
@@ -5894,16 +5950,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 sendfile64 support],samba_cv_HAVE_SENDFILE64,[
                AC_TRY_LINK([#include <sys/sendfile.h>],
@@ -6139,14 +6202,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.
@@ -6672,6 +6733,9 @@ if test x"$enable_pthreadpool" = x"yes" -a x"$samba_cv_HAVE_PTHREAD" = x"yes"; t
     AC_SUBST(PTHREADPOOL_OBJ, "lib/pthreadpool/pthreadpool.o")
     PTHREADPOOLTEST="bin/pthreadpooltest\$(EXEEXT)"
     AC_SUBST(PTHREADPOOLTEST)
+    if test x"$samba_cv_HAVE_AIO" = x"yes"; then
+        default_shared_modules="$default_shared_modules vfs_aio_pthread"
+    fi
 fi
 
 #################################################
@@ -6899,6 +6963,7 @@ SMB_MODULE(vfs_readahead, \$(VFS_READAHEAD_OBJ), "bin/readahead.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_tsmsm, \$(VFS_TSMSM_OBJ), "bin/tsmsm.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_fileid, \$(VFS_FILEID_OBJ), "bin/fileid.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_aio_fork, \$(VFS_AIO_FORK_OBJ), "bin/aio_fork.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_aio_pthread, \$(VFS_AIO_PTHREAD_OBJ), "bin/aio_pthread.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_preopen, \$(VFS_PREOPEN_OBJ), "bin/preopen.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_syncops, \$(VFS_SYNCOPS_OBJ), "bin/syncops.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_zfsacl, \$(VFS_ZFSACL_OBJ), "bin/zfsacl.$SHLIBEXT", VFS)