s3-krb5 Only build ADS support if arcfour-hmac-md5 is available
[samba.git] / source3 / configure.in
index 26e98f53336aa3715aa4e5cfb63c3a1cb7f34989..b4564eec0831015044761b9755f75fa2b86d87f4 100644 (file)
@@ -813,15 +813,21 @@ if test x$enable_cups != xno; then
 
         if test "x$CUPS_CONFIG" != x; then
 
-               ac_save_CFLAGS=$CFLAGS
                ac_save_LDFLAGS=$LDFLAGS
                ac_save_PRINT_LIBS=$PRINT_LIBS
-               CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
-               LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
-               PRINT_LIBS="$PRINT_LIBS -lcups"
                AC_CHECK_HEADERS(cups/cups.h cups/language.h)
+
                if test x"$ac_cv_header_cups_cups_h" = xyes -a \
                        x"$ac_cv_header_cups_language_h" = xyes; then
+                       # try linking with -lcups alone first. That should work unless libcups is
+                       # underlinked. With cups-config --libs we pull in unwanted and unneeded
+                       # dendencies including thread libraries - use cups-config only if really
+                       # required. 
+                       AC_CHECK_LIB_EXT(cups, ac_save_PRINT_LIBS , httpConnect,
+                               [PRINT_LIBS"$ac_save_PRINT_LIBS -lcups"],
+                               [AC_MSG_WARN([your cups library doesn't link with -lcups alone, it might be underlinked.]) ;
+                                PRINT_LIBS="$ac_save_PRINT_LIBS `$CUPS_CONFIG --libs`"])
+
                        AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
                        samba_cv_HAVE_CUPS=yes
                        AC_CHECK_LIB_EXT(cups, PRINT_LIBS, httpConnectEncrypt)
@@ -1105,6 +1111,15 @@ AC_CHECK_LIB(exc, trace_back_stack)
 # check for sysctlbyname for BSD systems
 AC_CHECK_FUNCS(sysctlbyname)
 
+#################################################
+# Check to see if core dump directory is defined in linux
+# with /proc/sys/kernel/core_pattern
+
+AC_CHECK_FILE([/proc/sys/kernel/core_pattern],
+       AC_DEFINE(HAVE_SYS_KERNEL_PROC_CORE_PATTERN, 1,
+       [Whether Linux kernel uses core_pattern for core files]),
+        [])
+
 #############################
 # check if building with gpfs
 AC_CHECK_HEADERS(gpfs_gpl.h)
@@ -2122,6 +2137,7 @@ then
        LINK_LIBTDB=STATIC
        SMB_LIBRARY(tdb, 1)
        LIBTDB_OBJ0=""
+       LIBTDB_LIBS="$LIBTDB_LIBS $TDB_DEPS"
        for obj in ${TDB_OBJ}; do
                LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
        done
@@ -3740,7 +3756,7 @@ if test x"$with_ads_support" != x"no"; then
 
   # now check for gssapi headers.  This is also done here to allow for
   # different kerberos include paths
-  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h)
+  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h gssapi/gssapi_ext.h com_err.h)
 
   ##################################################################
   # we might need the k5crypto and com_err libraries on some systems
@@ -3765,6 +3781,7 @@ if test x"$with_ads_support" != x"no"; then
   # now see if we can find the gssapi libs in standard paths
   if test x"$have_gssapi" != x"yes"; then
      AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],have_gssapi=yes)
+     AC_CHECK_FUNC_EXT(gss_wrap_iov, $KRB5_LIBS)
   fi
 
   AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
@@ -4023,6 +4040,7 @@ if test x"$with_ads_support" != x"no"; then
               [Whether the krb5_keyblock struct has a keyvalue property])
   fi
 
+  found_arcfour_hmac=no
   AC_CACHE_CHECK([for ENCTYPE_ARCFOUR_HMAC_MD5],
                  samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,[
     AC_TRY_COMPILE([#include <krb5.h>],
@@ -4040,7 +4058,19 @@ if test x"$with_ads_support" != x"no"; then
   if test x"$samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5" = x"yes" -a\
           x"$samba_cv_HAVE_KEYTYPE_ARCFOUR_56" = x"yes"; then
     AC_DEFINE(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,1,
-              [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available])
+              [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type definition is available])
+    found_arcfour_hmac=yes
+  fi
+  AC_CACHE_CHECK([for ENCTYPE_ARCFOUR_HMAC],
+                 samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC,[
+    AC_TRY_COMPILE([#include <krb5.h>],
+      [krb5_enctype enctype; enctype = ENCTYPE_ARCFOUR_HMAC;],
+      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC=yes,
+      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC=no)])
+  if test x"$samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC" = x"yes"; then
+    AC_DEFINE(HAVE_ENCTYPE_ARCFOUR_HMAC,1,
+              [Whether the ENCTYPE_ARCFOUR_HMAC key type definition is available])
+    found_arcfour_hmac=yes
   fi
 
   AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY],
@@ -4283,6 +4313,11 @@ if test x"$with_ads_support" != x"no"; then
   # NOTE: all tests should be done before this block!
   #
   #
+  if test x"$found_arcfour_hmac" != x"yes"; then
+    AC_MSG_WARN(arcfour-hmac-md5 encryption type not found in -lkrb5)
+    use_ads=no
+  fi
+
   if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" != x"yes"; then
     AC_MSG_WARN(krb5_mk_req_extended not found in -lkrb5)
     use_ads=no