summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2005-10-18 22:47:48 +0000
committerTom Yu <tlyu@mit.edu>2005-10-18 22:47:48 +0000
commit8e431547d07ebd8e9bd12993445285813c7ac206 (patch)
tree1d47b9a95e38d87036059e7ecca068aa794fb655 /src/util
parent072be09306f58aa8b0cfeef047c3c37921c4d95b (diff)
downloadkrb5-8e431547d07ebd8e9bd12993445285813c7ac206.tar.gz
krb5-8e431547d07ebd8e9bd12993445285813c7ac206.tar.xz
krb5-8e431547d07ebd8e9bd12993445285813c7ac206.zip
* ac_check_krb5.m4: Example autoconf macro to use krb5-config for
setting build flags for applications. ticket: 2923 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17433 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r--src/util/ChangeLog5
-rw-r--r--src/util/ac_check_krb5.m458
2 files changed, 63 insertions, 0 deletions
diff --git a/src/util/ChangeLog b/src/util/ChangeLog
index 56872aeac9..59e24584d7 100644
--- a/src/util/ChangeLog
+++ b/src/util/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-18 Tom Yu <tlyu@mit.edu>
+
+ * ac_check_krb5.m4: Example autoconf macro to use krb5-config for
+ setting build flags for applications.
+
2005-10-04 Ken Raeburn <raeburn@mit.edu>
* db2: Directory moved to modules/kdb/db2/libdb2.
diff --git a/src/util/ac_check_krb5.m4 b/src/util/ac_check_krb5.m4
new file mode 100644
index 0000000000..025da283a4
--- /dev/null
+++ b/src/util/ac_check_krb5.m4
@@ -0,0 +1,58 @@
+dnl Copyright (C) 2005 by the Massachusetts Institute of Technology.
+dnl All rights reserved.
+dnl
+dnl Export of this software from the United States of America may
+dnl require a specific license from the United States Government.
+dnl It is the responsibility of any person or organization contemplating
+dnl export to obtain such a license before exporting.
+dnl
+dnl WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+dnl distribute this software and its documentation for any purpose and
+dnl without fee is hereby granted, provided that the above copyright
+dnl notice appear in all copies and that both that copyright notice and
+dnl this permission notice appear in supporting documentation, and that
+dnl the name of M.I.T. not be used in advertising or publicity pertaining
+dnl to distribution of the software without specific, written prior
+dnl permission. Furthermore if you modify this software you must label
+dnl your software as modified software and not distribute it in such a
+dnl fashion that it might be confused with the original M.I.T. software.
+dnl M.I.T. makes no representations about the suitability of
+dnl this software for any purpose. It is provided "as is" without express
+dnl or implied warranty.
+
+dnl AC_CHECK_KRB5
+dnl
+dnl Check for krb5-config; update CPPFLAGS and LDFLAGS accordingly.
+dnl
+AC_DEFUN([AC_CHECK_KRB5],
+[AC_ARG_WITH([kerberos5],
+ [ --with-kerberos5=PATH Enable Kerberos 5 support],
+ [if test "x$withval" != "xno"; then
+ if test "x$withval" = "xyes"; then
+ KRB5ROOT=/usr/local
+ else
+ KRB5ROOT=${withval}
+ fi
+ AC_MSG_CHECKING([for krb5-config])
+ if test -x "$KRB5ROOT/bin/krb5-config"; then
+ KRB5CONF=$KRB5ROOT/bin/krb5-config
+ AC_MSG_RESULT([$KRB5CONF])
+ AC_MSG_CHECKING([for gssapi support in krb5-config])
+ if "$KRB5CONF" | grep gssapi > /dev/null; then
+ AC_MSG_RESULT([yes])
+ k5confopts=gssapi
+ else
+ AC_MSG_RESULT([no])
+ k5confopts=
+ fi
+ K5CFLAGS=`"$KRB5CONF" --cflags $k5confopts`
+ CPPFLAGS="$CPPFLAGS $K5CFLAGS"
+
+ K5LDFLAGS=`"$KRB5CONF" --libs $k5confopts`
+ LDFLAGS="$LDFLAGS $K5LDFLAGS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([--with-kerberos5 specified but krb5-config not found])
+ fi
+ fi])
+])