No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / roken.m4
blob26dc2ec2bba64f4ccb9138dd9e94c2dfb44f148a
1 dnl $Heimdal: roken.m4 14162 2004-08-26 11:27:32Z joda $
2 dnl $NetBSD$
3 dnl
4 dnl try to look for an installed roken library with sufficient stuff
5 dnl
6 dnl set LIB_roken to the what we should link with
7 dnl set DIR_roken to if the directory should be built
8 dnl set CPPFLAGS_roken to stuff to add to CPPFLAGS
10 dnl AC_ROKEN(version,directory-to-try,roken-dir,fallback-library,fallback-cppflags)
11 AC_DEFUN([AC_ROKEN], [
13 AC_ARG_WITH(roken,
14         AS_HELP_STRING([--with-roken=dir],[use the roken library in dir]),
15 [if test "$withval" = "no"; then
16   AC_MSG_ERROR(roken is required)
17 fi])
19 save_CPPFLAGS="${CPPFLAGS}"
21 case $with_roken in
22 yes|"")
23   dirs="$2" ;;
25   dirs="$with_roken" ;;
26 esac
28 roken_installed=no
30 for i in $dirs; do
32 AC_MSG_CHECKING(for roken in $i)
34 CPPFLAGS="-I$i/include ${CPPFLAGS}"
36 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
37 #include <roken.h>
38 #if ROKEN_VERSION < $1
39 #error old roken version, should be $1
40 fail
41 #endif
42 ]])],[roken_installed=yes; break])
44 AC_MSG_RESULT($roken_installed)
46 done
48 CPPFLAGS="$save_CPPFLAGS"
50 if test "$roken_installed" != "yes"; then
51   DIR_roken="roken"
52   LIB_roken='$4'
53   CPPFLAGS_roken='$5'
54   AC_CONFIG_SUBDIRS(lib/roken)
55 else
56   LIB_roken="$i/lib/libroken.la"
57   CPPFLAGS_roken="-I$i/include"
60 LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
62 AC_SUBST(LIB_roken)dnl
63 AC_SUBST(DIR_roken)dnl
64 AC_SUBST(CPPFLAGS_roken)dnl