5 AC_DEFUN([AC_CHECK_ROKEN],[
9 LIB_roken='$(top_builddir)/lib/roken/libroken.a'
10 INC_roken='-I$(top_builddir)/include'
11 ac_cv_arla_with_roken=yes
15 [ --with-roken=dir make with roken in dir],
16 [if test "$with_roken" != "no"; then
19 if test "X$withval" != "Xyes"; then
20 LIB_roken="-L$withval/lib -lroken"
21 INC_roken="-I$withval/include"
27 ac_cv_arla_with_roken=no
30 AC_ARG_WITH(roken-include,
31 [ --with-roken-include=dir make with roken headers in dir],
32 [if test "$with_roken" != "no"; then
35 if test "X$withval" != "Xyes"; then
36 INC_roken="-I$withval"
40 ac_cv_arla_with_roken=no
43 AC_ARG_WITH(roken-lib,
44 [ --with-roken-lib=dir make with roken lib in dir],
45 [if test "$with_roken" != "no"; then
48 if test "X$withval" != "X"; then
49 LIB_roken="-L$withval -lroken"
53 ac_cv_arla_with_roken=no
56 dnl kerberos may include a roken, lets use that if available
58 if test "X$ac_cv_arla_with_roken" = "Xyes"; then
59 if expr "x$KRB5_LIB_FLAGS" : ".*-lroken" > /dev/null ; then
62 CFLAGS="$KRB5_INC_DIR $CFLAGS"
64 AC_CHECK_HEADERS([getarg.h],
65 [working_krb_getarg=yes],[working_krb_getarg=no])
69 if test "X$working_krb_getarg" = "Xyes"; then
72 LIB_roken="$KRB5_LIB_DIR -lroken"
73 INC_roken="$KRB5_INC_DIR"
74 ac_cv_arla_with_roken=no
79 if test "X$ROKEN_H" = "X"; then
81 AC_CACHE_CHECK([what roken depends on ],[ac_cv_roken_deps],[
82 ac_cv_roken_deps="error"
84 for a in "" "-lcrypt" ; do
85 LIBS="$saved_LIBS $LIB_roken $a"
86 AC_TRY_LINK([],[getarg()],[
87 if test "X$a" = "X"; then
88 ac_cv_roken_deps="nothing"
93 if test $ac_cv_roken_deps != "error"; then break; fi
98 if test "$ac_cv_roken_deps" = "error"; then
99 AC_MSG_ERROR([failed to figure out libroken depencies])
102 if test "$ac_cv_roken_deps" != "nothing"; then
103 LIB_roken="$LIB_roken $ac_cv_roken_deps"