summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-06-24 05:31:08 +0000
committerTim Potter <tpot@samba.org>2003-06-24 05:31:08 +0000
commit200af4e84cbf48caa000915d86532e678e84fc46 (patch)
tree102d3c433a4937ecff31d28b6c50ee4a374001fe /source3/configure.in
parent98689251bb33486f22cf54ab780e4af377d70249 (diff)
downloadsamba-200af4e84cbf48caa000915d86532e678e84fc46.tar.gz
samba-200af4e84cbf48caa000915d86532e678e84fc46.tar.bz2
samba-200af4e84cbf48caa000915d86532e678e84fc46.zip
More sensible behaviour for bug 152. If we don't have krb5.h and were explicitly
configured using --with-ads then give an error, otherwise fall back to compiling without ADS. Tested on redhat 8.0 with and without MIT kerberos packages installed. Metze, let me know if this is working OK for you now! (This used to be commit 7ea81535b8180314acbf0873104a8c942ce4ec14)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in46
1 files changed, 36 insertions, 10 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 3d021b02bf..4d52d493eb 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2093,27 +2093,26 @@ AC_ARG_WITH(dfs,
#################################################
# active directory support
-with_ads_support=yes
+with_ads_support=auto
AC_MSG_CHECKING([whether to use Active Directory])
AC_ARG_WITH(ads,
[ --with-ads Active Directory support (default yes)],
[ case "$withval" in
- no)
- with_ads_support=no
+ yes|no)
+ with_ads_support="$withval"
;;
esac ])
-if test x"$with_ads_support" = x"yes"; then
- AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
-fi
-
AC_MSG_RESULT($with_ads_support)
FOUND_KRB5=no
KRB5_LIBS=""
-if test x"$with_ads_support" = x"yes"; then
+if test x"$with_ads_support" != x"no"; then
+
+ # Do no harm to the values of CFLAGS and LIBS while testing for
+ # Kerberos support.
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
@@ -2200,9 +2199,35 @@ if test x"$with_ads_support" = x"yes"; then
AC_CHECK_HEADERS(krb5.h)
if test x"$ac_cv_header_krb5_h" = x"no"; then
- AC_MSG_WARN([Active Directory cannot be supported without krb5.h])
+
+ # Give a warning if AD support was not explicitly requested,
+ # i.e with_ads_support = auto, otherwise die with an error.
+
+ if test x"$with_ads_support" = x"yes"; then
+ AC_MSG_ERROR([Active Directory cannot be supported without krb5.h])
+ else
+ AC_MSG_WARN([Active Directory cannot be supported without krb5.h])
+ fi
+
+ # Turn off AD support and restore CFLAGS and LIBS variables
+
+ with_ads_support="no"
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
fi
+ # Get rid of case where $with_ads_support=auto
+
+ with_ads_support="yes"
+fi
+
+# Now we have determined whether we really want ADS support
+
+if test x"$with_ads_support" = x"yes"; then
+
+ AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
+
# 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)
@@ -2337,7 +2362,8 @@ if test x"$with_ads_support" = x"yes"; then
[KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5";
AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])])
- LIBS="$ac_save_LIBS"; CFLAGS="$ac_save_CFLAGS"
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
fi
########################################################