2 AC_DEFUN([_OPENAFS_ROKEN_INTERNAL], [
5 LDFLAGS_roken="-L\$(TOP_LIBDIR)"
9 dnl _OPENAFS_ROKEN_CHECK($path,
11 dnl $action-if-not-found)
12 dnl Find a roken library at $path.
14 dnl If $path is not specified,
15 dnl try to find one in the standard locations on the system.
17 dnl If we fail, and $path was given, then error out. Otherwise,
18 dnl fall back to the internal roken implementation
19 AC_DEFUN([_OPENAFS_ROKEN_CHECK], [
22 save_CPPFLAGS=$CPPFLAGS
25 AS_IF([test x"$roken_path" != x],
26 [CPPFLAGS="-I$roken_path/include $CPPFLAGS"
27 LDFLAGS="-L$roken_path/lib $LDFLAGS"])
29 dnl Need to be careful what we check for here, as libroken contains
30 dnl different symbols on different platforms.
31 AC_CHECK_LIB([roken], [ct_memcmp], [roken_foundlib=true])
32 AC_CHECK_HEADER([roken.h], [roken_foundheader=true])
33 CPPFLAGS=$save_CPPFLAGS
37 AS_IF([test x"$roken_foundlib" = xtrue && test x"$roken_foundheader" = xtrue],
38 [AS_IF([test x"$roken_path" != x],
39 [CPPFLAGS_roken="-I$roken_path/include"
40 LDFLAGS_roken="-L$roken_path/lib"])
46 AC_DEFUN([OPENAFS_ROKEN], [
49 AC_SUBST(CPPFLAGS_roken)
50 AC_SUBST(LDFLAGS_roken)
54 [AS_HELP_STRING([--with-roken=DIR],
55 [Location of the roken library, or 'internal'])],
56 [AS_IF([test x"$withval" = xno],
57 [AC_ERROR("OpenAFS requires roken to build")],
58 [AS_IF([test x"$withval" != xyes],
59 [roken_root="$withval"])
63 AS_IF([test x"$roken_root" = xinteral],
64 [_OPENAFS_ROKEN_INTERNAL()],
65 [AS_IF([test x"$roken_root" = x],
66 [_OPENAFS_ROKEN_CHECK([], [], [_OPENAFS_ROKEN_INTERNAL()])],
67 [_OPENAFS_ROKEN_CHECK($roken_root,
69 [AC_MSG_ERROR([Cannot find roken at that location])])