2 AC_DEFUN([_OPENAFS_ROKEN_INTERNAL], [
5 LDFLAGS_roken="-L\$(TOP_LIBDIR)"
7 buildtool_roken="\$(TOP_OBJDIR)/src/roken/librokenafs.a"
10 dnl _OPENAFS_ROKEN_PATHS()
11 dnl Set CPPFLAGS_roken, LDFLAGS_roken, and LIB_roken based on the values
12 dnl of roken_root, roken_libdir, and roken_includedir.
13 AC_DEFUN([_OPENAFS_ROKEN_PATHS], [
14 AS_IF([test x"$roken_libdir" != x],
15 [LDFLAGS_roken="-L$roken_libdir"],
16 [AS_IF([test x"$roken_root" != x],
17 [LDFLAGS_roken="-L$roken_root/lib"])])
18 AS_IF([test x"$roken_includedir" != x],
19 [CPPFLAGS_roken="-I$roken_includedir"],
20 [AS_IF([test x"$roken_root" != x],
21 [CPPFLAGS_roken="-I$roken_root/include"])])
23 buildtool_roken="\$(LDFLAGS_roken) \$(LIB_roken)"])
25 dnl _OPENAFS_ROKEN_CHECK($action-if-found,
26 dnl $action-if-not-found)
27 dnl Find a roken library using $roken_root, $roken_libdir, and $roken_includedir
29 dnl If none of the three paths are specified,
30 dnl try to find one in the standard locations on the system.
32 dnl If we fail, and at least one path was given, then error out. Otherwise,
33 dnl fall back to the internal roken implementation.
34 AC_DEFUN([_OPENAFS_ROKEN_CHECK], [
37 save_CPPFLAGS=$CPPFLAGS
40 AS_IF([test x"$CPPFLAGS_roken" != x],
41 [CPPFLAGS="$CPPFLAGS_roken $CPPFLAGS"])
42 AS_IF([test x"$LDFLAGS_roken" != x],
43 [LDFLAGS="$LDFLAGS_roken $LDFLAGS"])
44 AS_IF([test x"$roken_libdir" != x || test x"$roken_includedir" != x],
45 [checkstr=" with specified include and lib paths"],
46 [AS_IF([test x"$roken_root" != x],
47 [checkstr=" in $roken_root"])])
49 AC_MSG_CHECKING([for usable system libroken$checkstr])
51 LIBS="$LIBS $LIB_roken"
52 dnl Need to be careful what we check for here, as libroken contains
53 dnl different symbols on different platforms. We cannot simply check
54 dnl if e.g. rk_rename is a symbol or not, since on most platforms it
55 dnl will be a preprocessor define, but on others it will be a symbol.
57 dnl Also note that we need to check for the specific functionality in
58 dnl roken that we use, not just the existence of the library itself,
59 dnl since older versions of roken do not contain all of the functions
60 dnl we need. It may not be practical to check everything we use, so
61 dnl just add functions to check here as we find installations where
65 [[#include <roken.h>]],
66 [[ct_memcmp(NULL, NULL, 0); rk_rename(NULL, NULL);]])],
68 AC_MSG_RESULT([yes])],
69 [AC_MSG_RESULT([no])])
71 CPPFLAGS=$save_CPPFLAGS
75 AS_IF([test x"$roken_found" = xtrue],
79 AC_DEFUN([OPENAFS_ROKEN], [
82 AC_SUBST(CPPFLAGS_roken)
83 AC_SUBST(LDFLAGS_roken)
85 AC_SUBST(buildtool_roken)
88 [AS_HELP_STRING([--with-roken=DIR],
89 [Location of the roken library, or 'internal'])],
90 [AS_IF([test x"$withval" = xno],
91 [AC_MSG_ERROR("OpenAFS requires roken to build")],
92 [AS_IF([test x"$withval" != xyes],
93 [roken_root="$withval"])
96 AC_ARG_WITH([roken-include],
97 [AS_HELP_STRING([--with-roken-include=DIR],
98 [Location of roken headers])],
99 [AS_IF([test x"$withval" != xyes && test x"$withval" != xno],
100 [roken_includedir="$withval"])])
101 AC_ARG_WITH([roken-lib],
102 [AS_HELP_STRING([--with-roken-lib=DIR],
103 [Location of roken libraries])],
104 [AS_IF([test x"$withval" != xyes && test x"$withval" != xno],
105 [roken_libdir="$withval"])])
107 AS_IF([test x"$roken_root" = xinternal],
108 [_OPENAFS_ROKEN_INTERNAL()],
109 [AS_IF([test x"$roken_root" = x && test x"$roken_libdir" = x &&
110 test x"$roken_includedir" = x],
111 [_OPENAFS_ROKEN_CHECK([], [_OPENAFS_ROKEN_INTERNAL()])],
112 [_OPENAFS_ROKEN_CHECK([],
113 [AC_MSG_ERROR([Cannot find roken at that location])])
118 AC_DEFUN([OPENAFS_MORE_ROKEN_CHECKS],[
119 dnl Functions that Heimdal's libroken provides, but that we
120 dnl haven't found a need for yet, and so haven't imported
137 dnl Functions that are in objects that we always build from libroken
147 dnl Functions that we're going to try and get from libroken
190 dnl Headers that we're going to try and get from libroken
197 AC_DEFUN([OPENAFS_ROKEN_HEADERS],[
199 AS_IF([test "$ac_cv_header_err_h" != "yes" ],
200 [ROKEN_HEADERS="$ROKEN_HEADERS \$(TOP_INCDIR)/err.h"],
202 AC_SUBST(ROKEN_HEADERS)