TODO: s3:configure.in: fix rfc1321 md5 detection
[metze/samba/wip.git] / source3 / configure.in
index aae2be06fa34e3ae7d403c2e0840faf30ab7ead9..244a2dc7bd61a7386e2797469fb896d505693d1f 100644 (file)
@@ -752,23 +752,29 @@ AC_CHECK_HEADERS(netgroup.h)
 AC_CHECK_HEADERS(linux/falloc.h)
 
 dnl check for OS implementation of md5 conformant to rfc1321
-AC_CHECK_HEADERS(md5.h)
-
 samba_cv_md5lib=none
 
-if test x"$ac_cv_header_md5_h" = x"yes"; then
-       AC_DEFINE(HAVE_MD5_H, 1,
-               [Whether md5.h is available.])
-       AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5])
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])
 fi
 
-if test x"$ac_cv_header_md5_h" = x"yes" -a \
-        x"$samba_cv_md5lib" = x"none" ; then
+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
-       LIBS="${LIBS} -l${samba_cv_md5lib}"
+       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.])
@@ -2131,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/.* //'`
@@ -2172,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/.* //'`
@@ -4149,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>],
@@ -5923,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>],
@@ -6168,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.