summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-11 13:31:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:25 -0500
commiteb1f0b49cf0e84385a62f9dfcb2167fea2e8fd8b (patch)
tree998b540f4bbadf8c70f572021b0288079c880a27
parent4b9d79147ae81fb701abf02dc046076f606443b6 (diff)
downloadsamba-eb1f0b49cf0e84385a62f9dfcb2167fea2e8fd8b.tar.gz
r19244: fix the build on systems with broken krb5
we need to make sure HAVE_GSSAPI HAVE_KRB5_H HAVE_GSSAPI_H HAVE_GSSAPI_GSSAPI_GENERIC_H HAVE_GSSAPI_GSSAPI_H are not in config.h this adds 2 new macros to libreplace AC_REMOVE_DEFINE(), AC_REMOVE_INCLUDE() metze
-rw-r--r--source/configure.in16
-rw-r--r--source/lib/replace/libreplace_macros.m418
2 files changed, 29 insertions, 5 deletions
diff --git a/source/configure.in b/source/configure.in
index 5e019c00151..9bc71058fcd 100644
--- a/source/configure.in
+++ b/source/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/source/lib/replace/libreplace_macros.m4 b/source/lib/replace/libreplace_macros.m4
index 4a645ef81f9..0669c10c2a0 100644
--- a/source/lib/replace/libreplace_macros.m4
+++ b/source/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.