2008-05-07 13:39:42 +00:00
|
|
|
dnl $Id: roken.m4 14162 2004-08-26 11:27:32Z joda $
|
2001-02-13 16:46:19 +00:00
|
|
|
dnl
|
|
|
|
dnl try to look for an installed roken library with sufficient stuff
|
|
|
|
dnl
|
|
|
|
dnl set LIB_roken to the what we should link with
|
|
|
|
dnl set DIR_roken to if the directory should be built
|
|
|
|
dnl set CPPFLAGS_roken to stuff to add to CPPFLAGS
|
|
|
|
|
|
|
|
dnl AC_ROKEN(version,directory-to-try,roken-dir,fallback-library,fallback-cppflags)
|
2004-04-03 21:22:55 +00:00
|
|
|
AC_DEFUN([AC_ROKEN], [
|
2001-02-13 16:46:19 +00:00
|
|
|
|
|
|
|
AC_ARG_WITH(roken,
|
2008-05-07 13:39:42 +00:00
|
|
|
AS_HELP_STRING([--with-roken=dir],[use the roken library in dir]),
|
2001-02-13 16:46:19 +00:00
|
|
|
[if test "$withval" = "no"; then
|
|
|
|
AC_MSG_ERROR(roken is required)
|
|
|
|
fi])
|
|
|
|
|
|
|
|
save_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
|
|
|
|
case $with_roken in
|
|
|
|
yes|"")
|
|
|
|
dirs="$2" ;;
|
|
|
|
*)
|
|
|
|
dirs="$with_roken" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
roken_installed=no
|
|
|
|
|
|
|
|
for i in $dirs; do
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for roken in $i)
|
|
|
|
|
|
|
|
CPPFLAGS="-I$i/include ${CPPFLAGS}"
|
|
|
|
|
2008-05-07 13:39:42 +00:00
|
|
|
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
|
|
|
#include <roken.h>
|
2001-02-13 16:46:19 +00:00
|
|
|
#if ROKEN_VERSION < $1
|
|
|
|
#error old roken version, should be $1
|
|
|
|
fail
|
|
|
|
#endif
|
2008-05-07 13:39:42 +00:00
|
|
|
]])],[roken_installed=yes; break])
|
2001-02-13 16:46:19 +00:00
|
|
|
|
|
|
|
AC_MSG_RESULT($roken_installed)
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
|
|
|
|
if test "$roken_installed" != "yes"; then
|
|
|
|
DIR_roken="roken"
|
|
|
|
LIB_roken='$4'
|
|
|
|
CPPFLAGS_roken='$5'
|
|
|
|
AC_CONFIG_SUBDIRS(lib/roken)
|
|
|
|
else
|
|
|
|
LIB_roken="$i/lib/libroken.la"
|
|
|
|
CPPFLAGS_roken="-I$i/include"
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
|
|
|
|
|
|
|
|
AC_SUBST(LIB_roken)dnl
|
|
|
|
AC_SUBST(DIR_roken)dnl
|
|
|
|
AC_SUBST(CPPFLAGS_roken)dnl
|
|
|
|
])
|