1 dnl kerberos_v4.m4--Kafs libraries and includes
3 dnl from KTH kafs and Arla
4 dnl $Id: kafs.m4,v 1.7 2005/04/26 19:14:07 shadow Exp $
6 AC_DEFUN([CMU_KAFS_INC_WHERE1], [
7 saved_CPPFLAGS=$CPPFLAGS
8 CPPFLAGS="$saved_CPPFLAGS -I$1"
11 #include <sys/ioctl.h>
14 [struct ClearToken foo;],
15 ac_cv_found_kafs_inc=yes,
16 ac_cv_found_kafs_inc=no)
17 if test "$ac_cv_found_kafs_inc" = "no"; then
18 CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
21 #include <sys/ioctl.h>
24 [struct ClearToken foo;],
25 [ac_cv_found_kafs_inc=yes],
26 ac_cv_found_kafs_inc=no)
28 CPPFLAGS=$saved_CPPFLAGS
31 AC_DEFUN([CMU_KAFS_INC_WHERE], [
33 AC_MSG_CHECKING(for kafs headers in $i)
34 CMU_KAFS_INC_WHERE1($i)
35 CMU_TEST_INCPATH($i, kafs)
36 if test "$ac_cv_found_kafs_inc" = "yes"; then
37 ac_cv_kafs_where_inc=$i
41 AC_MSG_RESULT(not found)
46 AC_DEFUN([CMU_KAFS_LIB_WHERE1], [
48 LIBS="$saved_LIBS -L$1 -lkafs $KRB_LIB_FLAGS $KRB5_LIB_FLAGS"
51 [ac_cv_found_kafs_lib=yes],
52 ac_cv_found_kafs_lib=no)
56 AC_DEFUN([CMU_KAFS_LIB_WHERE], [
58 AC_MSG_CHECKING(for kafs libraries in $i)
59 CMU_KAFS_LIB_WHERE1($i)
60 dnl deal with false positives from implicit link paths
61 CMU_TEST_LIBPATH($i, kafs)
62 if test "$ac_cv_found_kafs_lib" = "yes" ; then
63 ac_cv_kafs_where_lib=$i
67 AC_MSG_RESULT(not found)
72 AC_DEFUN([CMU_KAFS], [
73 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
74 AC_REQUIRE([CMU_SOCKETS])
75 AC_REQUIRE([CMU_KRB4])
76 AC_REQUIRE([CMU_KRB5])
78 [ --with-kafs=PREFIX Compile with Kafs support],
79 [if test "X$with_kafs" = "X"; then
83 [ --with-kafs-lib=dir use kafs libraries in dir],
84 [if test "$withval" = "yes" -o "$withval" = "no"; then
85 AC_MSG_ERROR([No argument for --with-kafs-lib])
87 AC_ARG_WITH(kafs-include,
88 [ --with-kafs-include=dir use kafs headers in dir],
89 [if test "$withval" = "yes" -o "$withval" = "no"; then
90 AC_MSG_ERROR([No argument for --with-kafs-include])
93 if test "X$with_kafs" != "X"; then
94 if test "$with_kafs" != "yes" -a "$with_kafs" != no; then
95 ac_cv_kafs_where_lib=$with_kafs/$CMU_LIB_SUBDIR
96 ac_cv_kafs_where_inc=$with_kafs/include
100 if test "$with_kafs" != "no"; then
101 if test "X$with_kafs_lib" != "X"; then
102 ac_cv_kafs_where_lib=$with_kafs_lib
104 if test "X$ac_cv_kafs_where_lib" = "X"; then
105 CMU_KAFS_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
108 if test "X$with_kafs_include" != "X"; then
109 ac_cv_kafs_where_inc=$with_kafs_include
111 if test "X$ac_cv_kafs_where_inc" = "X"; then
112 CMU_KAFS_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
116 AC_MSG_CHECKING(whether to include kafs)
117 if test "X$ac_cv_kafs_where_lib" = "X" -a "X$ac_cv_kafs_where_inc" = "X"; then
123 KAFS_INC_DIR=$ac_cv_kafs_where_inc
124 KAFS_LIB_DIR=$ac_cv_kafs_where_lib
125 KAFS_INC_FLAGS="-I${KAFS_INC_DIR}"
126 KAFS_LIB_FLAGS="-L${KAFS_LIB_DIR} -lkafs"
127 if test "X$RPATH" = "X"; then
132 if test "X$RPATH" = "X"; then
133 RPATH="-Wl,-rpath,${KAFS_LIB_DIR}"
135 RPATH="${RPATH}:${KAFS_LIB_DIR}"
139 if test "X$RPATH" = "X"; then
140 RPATH="-Wl,+b${KAFS_LIB_DIR}"
142 RPATH="${RPATH}:${KAFS_LIB_DIR}"
146 if test "X$RPATH" = "X"; then
147 RPATH="-Wl,-rpath,${KAFS_LIB_DIR}"
149 RPATH="${RPATH}:${KAFS_LIB_DIR}"
153 if test "$ac_cv_prog_gcc" = yes; then
154 if test "X$RPATH" = "X"; then
155 RPATH="-Wl,-R${KAFS_LIB_DIR}"
157 RPATH="${RPATH}:${KAFS_LIB_DIR}"
160 RPATH="${RPATH} -R${KAFS_LIB_DIR}"