From 0b3e411bfcd1ffc719c41a3f62137f75b17a09ab Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 16 May 2010 23:14:11 +0100 Subject: [PATCH] Autoconf: Use AC_CHECK_MEMBERS AC_CHECK_MEMBERS has been available since autoconf 2.50, which was released in 2001. Use this, rather than rolling our own mechanism to check for structure membership. Change-Id: Ic63bfdd6c448ce3cf2ed13d8f1f36d02e18bd223 Reviewed-on: http://gerrit.openafs.org/1973 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/cf/kerberos.m4 | 47 ++++------------------------------------------ 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/src/cf/kerberos.m4 b/src/cf/kerberos.m4 index 2b01a2ac4b..2cb31b99f0 100644 --- a/src/cf/kerberos.m4 +++ b/src/cf/kerberos.m4 @@ -76,50 +76,11 @@ if test X$conf_krb5 = XYES; then AC_CHECK_HEADERS([kerberosIV/krb.h]) AC_CHECK_HEADERS([kerberosV/heim_err.h]) -AC_MSG_CHECKING(for krb5_creds.keyblock existence) -AC_CACHE_VAL(ac_cv_krb5_creds_keyblock_exists, -[ -AC_TRY_COMPILE( -[#include ], -[krb5_creds _c; -printf("%x\n", _c.keyblock);], -ac_cv_krb5_creds_keyblock_exists=yes, -ac_cv_krb5_creds_keyblock_exists=no)]) -AC_MSG_RESULT($ac_cv_krb5_creds_keyblock_exists) - -AC_MSG_CHECKING(for krb5_creds.session existence) -AC_CACHE_VAL(ac_cv_krb5_creds_session_exists, -[ -AC_TRY_COMPILE( -[#include ], -[krb5_creds _c; -printf("%x\n", _c.session);], -ac_cv_krb5_creds_session_exists=yes, -ac_cv_krb5_creds_session_exists=no)]) -AC_MSG_RESULT($ac_cv_krb5_creds_session_exists) + AC_CHECK_MEMBERS([krb5_creds.keyblock, + krb5_creds.session, + krb5_prompt.type], + [], [], [#include ]) -AC_MSG_CHECKING(for krb5_prompt.type existence) -AC_CACHE_VAL(ac_cv_krb5_prompt_type_exists, -[ -AC_TRY_COMPILE( -[#include ], -[krb5_prompt _p; -printf("%x\n", _p.type);], -ac_cv_krb5_prompt_type_exists=yes, -ac_cv_krb5_prompt_type_exists=no)]) -AC_MSG_RESULT($ac_cv_krb5_prompt_type_exists) - -if test "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then - AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock]) -fi -if test "x$ac_cv_krb5_creds_session_exists" = "xyes"; then - AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session]) -fi -if test "x$ac_cv_krb5_prompt_type_exists" = "xyes"; then - AC_DEFINE(HAVE_KRB5_PROMPT_TYPE, 1, [define if krb5_prompt has type]) -fi - -dnl AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include ]) CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" fi