2014-02-10 23:30:21 +00:00
|
|
|
|
2013-11-03 23:55:09 +00:00
|
|
|
AC_ARG_WITH(cudd,
|
|
|
|
[ --with-cudd[=DIR] use CUDD package in DIR],
|
|
|
|
yap_cv_cudd="$withval",
|
|
|
|
[yap_cv_cudd=no])
|
|
|
|
|
2014-02-10 23:30:21 +00:00
|
|
|
AC_ARG_ENABLE(bddlib,
|
|
|
|
[ --enable-bddlib dynamic bdd library ],
|
|
|
|
dynamic_bdd="$enableval", dynamic_bdd=no)
|
|
|
|
|
2013-11-03 23:55:09 +00:00
|
|
|
if test "$yap_cv_cudd" = no
|
|
|
|
then
|
2014-02-10 23:30:21 +00:00
|
|
|
PKG_BDDLIB=""
|
|
|
|
elif test "$dynamic_bdd" = yes
|
|
|
|
then
|
|
|
|
PKG_BDDLIB="packages/bdd packages/ProbLog/simplecudd packages/ProbLog/simplecudd_lfi"
|
2013-11-03 23:55:09 +00:00
|
|
|
else
|
2014-02-10 23:30:21 +00:00
|
|
|
PKG_BDDLIB="packages/ProbLog/simplecudd packages/ProbLog/simplecudd_lfi"
|
2013-11-03 23:55:09 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$yap_cv_cudd" != no; then
|
|
|
|
|
|
|
|
oldlibs="$LIBS"
|
|
|
|
|
|
|
|
if test "$yap_cv_cudd" != "NONE" -a "$yap_cv_cudd" != "yes"; then
|
|
|
|
CUDD_CPPFLAGS="-I $yap_cv_cudd/include"
|
|
|
|
cudd_dir="$yap_cv_cudd"
|
|
|
|
elif test "$prefix" != "NONE"; then
|
|
|
|
CUDD_CPPFLAGS="-I $prefix/include"
|
|
|
|
cudd_dir="$prefix"
|
|
|
|
else
|
|
|
|
CUDD_CPPFLAGS="-I /usr/local/include"
|
|
|
|
cudd_dir=/usr/local
|
|
|
|
fi
|
|
|
|
|
|
|
|
OLD_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $CUDD_CPPFLAGS"
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(util.h cudd/util.h cudd.h cudd/cudd.h)
|
|
|
|
AC_CHECK_HEADERS(cuddInt.h cudd/cuddInt.h)
|
|
|
|
|
|
|
|
dnl cudd can be most everywhere
|
|
|
|
if test -d "$cudd_dir/lib64/cudd" -a "$YAP_TARGET" = amd64; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/lib64/cudd"
|
|
|
|
elif test -d "$cudd_dir/lib64" -a "$YAP_TARGET" = amd64; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/lib64 -L $cudd_dir/lib"
|
|
|
|
elif test -d "$cudd_dir/lib/cudd"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/lib/cudd"
|
|
|
|
elif test -d "$cudd_dir/lib"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/lib"
|
|
|
|
fi
|
|
|
|
|
2014-11-03 00:13:34 +00:00
|
|
|
if test "$target_os" = "mingw32" -o "$target_os" = "mingw64" -o "$target_os" = "msys"
|
2014-01-23 01:46:16 +00:00
|
|
|
then
|
|
|
|
#mingw: we know where things are
|
2014-10-26 17:39:52 +00:00
|
|
|
CUDD_LIBS="$cudd_dir/lib/all_cudd.dll"
|
2014-03-06 13:34:35 +00:00
|
|
|
cudd_installed="yes"
|
2014-01-23 01:46:16 +00:00
|
|
|
else
|
|
|
|
|
2013-11-03 23:55:09 +00:00
|
|
|
if test -d "$cudd_dir/util"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/util"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(util_print_cpu_stats, [cuddutil util])
|
|
|
|
|
|
|
|
if test -d "$cudd_dir/st"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/st"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(st_insert, [cuddst st])
|
|
|
|
|
|
|
|
if test -d "$cudd_dir/epd"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/epd"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(EpdAdd, [epd])
|
|
|
|
|
|
|
|
if test -d "$cudd_dir/mtr"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/mtr"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(Mtr_InitTree, [mtr])
|
|
|
|
|
|
|
|
if test -d "$cudd_dir/cudd"; then
|
|
|
|
LIBS="$LIBS -L $cudd_dir/cudd"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(Cudd_Init, [cudd], [cudd_installed="yes"], [cudd_installed="no"])
|
|
|
|
|
|
|
|
CPPFLAGS="$OLD_CPPFLAGS"
|
|
|
|
|
|
|
|
if test "$cudd_installed" = yes; then
|
2014-10-26 17:39:52 +00:00
|
|
|
CUDD_LIBS="$LIBS"
|
2013-11-03 23:55:09 +00:00
|
|
|
else
|
|
|
|
cat << EOF
|
|
|
|
##################################################################
|
|
|
|
# ERROR: Could not find cudd library. Either I don't have the
|
|
|
|
# correct path, or CUDD is installed in some strange way
|
|
|
|
##################################################################
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBS="$oldlibs"
|
|
|
|
|
2014-01-23 01:46:16 +00:00
|
|
|
fi
|
2013-11-03 23:55:09 +00:00
|
|
|
fi
|
|
|
|
|
2014-02-10 23:30:21 +00:00
|
|
|
AC_SUBST(PKG_BDDLIB)
|
2014-10-26 17:39:52 +00:00
|
|
|
AC_SUBST(CUDD_LIBS)
|
2013-11-03 23:55:09 +00:00
|
|
|
AC_SUBST(CUDD_CPPFLAGS)
|
2014-02-10 23:30:21 +00:00
|
|
|
|
|
|
|
mkdir -p packages/bdd
|
|
|
|
|
|
|
|
if test "$PKG_BDDLIB" != ""; then
|
|
|
|
AC_CONFIG_FILES([packages/bdd/Makefile])
|
|
|
|
AC_CONFIG_FILES([packages/ProbLog/simplecudd/Makefile])
|
|
|
|
AC_CONFIG_FILES([packages/ProbLog/simplecudd_lfi/Makefile])
|
|
|
|
fi
|
|
|
|
|