summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/configure.in16
-rw-r--r--source3/lib/replace/libreplace_macros.m418
2 files changed, 29 insertions, 5 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 5e019c0015..9bc71058fc 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -3400,6 +3400,7 @@ fi
use_ads=no
if test x"$with_ads_support" != x"no"; then
use_ads=yes
+ have_gssapi=no
ac_save_LIBS=$LIBS
# now check for gssapi headers. This is also done here to allow for
@@ -3417,8 +3418,7 @@ if test x"$with_ads_support" != x"no"; then
AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec)
# Heimdal checks. On static Heimdal gssapi must be linked before krb5.
- AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status,[],[],
- AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
+ AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status,[],[],have_gssapi=yes)
########################################################
# now see if we can find the krb5 libs in standard paths
@@ -3428,8 +3428,7 @@ if test x"$with_ads_support" != x"no"; then
########################################################
# now see if we can find the gssapi libs in standard paths
- AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],
- AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
+ AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],have_gssapi=yes)
AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS)
@@ -3841,14 +3840,21 @@ if test x"$with_ads_support" != x"no"; then
fi
if test x"$use_ads" = x"yes"; then
- AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
+ AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
+ if test x"$have_gssapi" = x"yes"; then
+ AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])
+ fi
else
if test x"$with_ads_support" = x"yes"; then
AC_MSG_ERROR(krb5 libs don't have all features required for Active Directory support)
else
AC_MSG_WARN(krb5 libs don't have all features required for Active Directory support)
fi
+ AC_REMOVE_DEFINE(HAVE_KRB5_H)
+ AC_REMOVE_DEFINE(HAVE_GSSAPI_H)
+ AC_REMOVE_DEFINE(HAVE_GSSAPI_GSSAPI_GENERIC_H)
+ AC_REMOVE_DEFINE(HAVE_GSSAPI_GSSAPI_H)
KRB5_LIBS=""
with_ads_support=no
fi
diff --git a/source3/lib/replace/libreplace_macros.m4 b/source3/lib/replace/libreplace_macros.m4
index 4a645ef81f..0669c10c2a 100644
--- a/source3/lib/replace/libreplace_macros.m4
+++ b/source3/lib/replace/libreplace_macros.m4
@@ -264,6 +264,24 @@ define(AC_ADD_INCLUDE,
EOF
])
+dnl remove an #include
+dnl AC_REMOVE_INCLUDE(VARIABLE)
+define(AC_REMOVE_INCLUDE,
+[
+grep -v '[#include] $1' confdefs.h >confdefs.h.tmp
+cat confdefs.h.tmp > confdefs.h
+rm confdefs.h.tmp
+])
+
+dnl remove an #define
+dnl AC_REMOVE_DEFINE(VARIABLE)
+define(AC_REMOVE_DEFINE,
+[
+grep -v '[#define] $1 ' confdefs.h |grep -v '[#define] $1[$]'>confdefs.h.tmp
+cat confdefs.h.tmp > confdefs.h
+rm confdefs.h.tmp
+])
+
dnl AS_HELP_STRING is not available in autoconf 2.57, and AC_HELP_STRING is deprecated
dnl in autoconf 2.59, so define AS_HELP_STRING to be AC_HELP_STRING unless it is already
dnl defined.