try to clean-up makefiles and autoconfs

This commit is contained in:
Vítor Santos Costa
2014-10-26 17:39:52 +00:00
parent 9cd2975532
commit 2053c44054
18 changed files with 143 additions and 86 deletions

View File

@@ -23,7 +23,7 @@ SHAREDIR=$(ROOTDIR)/share/Yap
#
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
CC=@CC@
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I$(srcdir)/../../include @CPPFLAGS@
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I$(srcdir)/../../include -I../.. @CPPFLAGS@
#
#
# You shouldn't need to change what follows.
@@ -35,8 +35,7 @@ SHELL=/bin/sh
RANLIB=@RANLIB@
srcdir=@srcdir@
SO=@SO@
CPLINT_CFLAGS=@CPLINT_CFLAGS@
CPLINT_LDFLAGS=@CPLINT_LDFLAGS@
CPLINT_CFLAGS=@CPLINT_CPPFLAGS@
CPLINT_LIBS=@CPLINT_LIBS@
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
CWD=$(PWD)

View File

@@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin
# where YAP should look for libraries
#
LIBDIR=@libdir@/Yap
DESTDIR=$(prefix)/share/Yap
DESTDIR=$(BINDIR)
#
#
CC=@CC@
@@ -25,14 +25,14 @@ INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
SHELL=/bin/sh
RANLIB=ranlib
SHLIB_CFLAGS=-shared -fPIC
SHLIB_SUFFIX=.so
RANLIB=@RANLIB@
SHLIB_SUFFIX=@SO@
CWD=$(PWD)
srcdir=@srcdir@
CPLINT_CFLAGS=@CPLINT_CFLAGS@
CPLINT_CPPFLAGS=@CPPFLAGS@ @CPLINT_CPPFLAGS@ -I@abs_top_builddir@
CPLINT_LDFLAGS=@CPLINT_LDFLAGS@
CPLINT_LIBS=@CPLINT_LIBS@
CFLAGS=@CFLAGS@ $(YAP_EXTRAS) $(DEFS)
#
@@ -45,7 +45,7 @@ LPADBDD: ProblogBDD.o simplecudd.o general.o
$(CC) $(CPLINT_LDFLAGS) ProblogBDD.o simplecudd.o general.o $(CPLINT_LIBS) -o LPADBDD
%.o : $(srcdir)/%.c
$(CC) $(CPLINT_CFLAGS) -c $<
$(CC) $(CPLINT_CPPFLAGS) -c $<
clean:
rm -f *.o LPADBDD

View File

@@ -196,9 +196,25 @@ variable=value
#include <string.h>
#include <math.h>
#include <time.h>
#include "util.h"
#include "config.h"
#if HAVE_UTIL_H
#include <util.h>
#endif
#if HAVE_CUDD_UTIL_H
#include <cudd/util.h>
#endif
#if HAVE_CUDD_H
#include "cudd.h"
#endif
#if HAVE_CUDD_CUDD_H
#include "cudd/cudd.h"
#endif
#if HAVE_CUDDINT_H
#include "cuddInt.h"
#endif
#if HAVE_CUDD_CUDDINT_H
#include "cudd/cuddInt.h"
#endif
#include "general.h"
#define IsHigh(manager, node) HIGH(manager) == node

View File

@@ -3,13 +3,14 @@ dnl
dnl CPLINT_LIBS=
dnl CPLINT_LDFLAGS=
dnl CPLINT_SHLIB_LD=
dnl CPLINT_CPPFLAGS=
dnl
found_cplint=false
AC_ARG_ENABLE(cplint,
[ --enable-cplint[=DIR] enable the cplint library using the CUDD library in DIR/lib],
yap_cv_cplint=$enableval, yap_cv_cplint=no)
AC_ARG_WITH(cplint,
[ --with-cplint[=DIR] with the cplint library using the CUDD library in DIR/lib],
yap_cv_cplint=$withval, yap_cv_cplint=no)
if test x"$yap_cv_cplint" = "xno"
then
@@ -17,23 +18,27 @@ then
else
if test x"$yap_cv_cplint" != "xyes"
then
CPLINT_LDFLAGS+=" -L${yap_cv_cplint}/cudd -L${yap_cv_cplint}/mtr -L${yap_cv_cplint}/st -L${yap_cv_cplint}/util -L${yap_cv_cplint}/epd "
CPLINT_LIBS+=" -L${yap_cv_cplint}/cudd -L${yap_cv_cplint}/mtr -L${yap_cv_cplint}/st -L${yap_cv_cplint}/util -L${yap_cv_cplint}/epd "
#typical of user-compiled cudd fi
CPLINT_CFLAGS+=" -I${yap_cv_cplint}/include"
CPLINT_LIBS="$LIBS"
CPLINT_CPPFLAGS+=" -I${yap_cv_cplint}/include"
found_cplint=true
fi
# cudd has been probably just tested, so why try again?
# cudd is available on fedora, and maybe other linux distributions
if test -d "/usr/include/cudd" -a x"$CPLINT_CFLAGS" = x
if test x"$CUDD_LIBS" != x -a x"$CPLINT_CPPFLAGS" = x
then
CPLINT_CFLAGS=" -I/usr/include/cudd"
CPLINT_LIBS="-lcudd -lmtr -lcuddst -lepd -lcuddutil -lm $LIBS"
CPLINT_CPPFLAGS="$CUDD_CPPFLAGS"
CPLINT_LIBS="$CUDD_LIBS"
found_cplint=true
elif test -d "/usr/local/include/cudd" -a x"$CPLINT_CFLAGS" = x
elif test -d "/usr/include/cudd" -a x"$CPLINT_CPPFLAGS" = x
then
CPLINT_CPPFLAGS=" -I/usr/include/cudd"
CPLINT_LIBS+="-lcudd -lmtr -lcuddst -lepd -lcuddutil -lm"
found_cplint=true
elif test -d "/usr/local/include/cudd" -a x"$CPLINT_CPPFLAGS" = x
then
found_cplint=true
CPLINT_CFLAGS=" -I/usr/local/include/cudd"
CPLINT_CPPFLAGS+=" -I/usr/local/include/cudd"
CPLINT_LIBS+=" -L/usr/local/lib"
fi
if test "$found_cplint" = true
@@ -49,11 +54,11 @@ else
CPLINT_SHLIB_LD="$SHLIB_LD"
fi
PKG_CPLINT="packages/cplint/approx/simplecuddLPADs packages/cplint"
CPLINT_LDFLAGS="$LDFLAGS"
AC_SUBST(CPLINT_LIBS)
AC_SUBST(CPLINT_CFLAGS)
AC_SUBST(CPLINT_LDFLAGS)
AC_SUBST(CPLINT_CPPFLAGS)
AC_SUBST(CPLINT_SHLIB_LD)
AC_SUBST(SHLIB_SUFFIX)
else
PKG_CPLINT=""
fi

View File

@@ -7,10 +7,16 @@ This package uses the library cudd, see http://vlsi.colorado.edu/~fabio/CUDD/
for the relative license.
*/
#include "config.h"
#if HAVE_CUDD_UTIL_H
#include "cudd/util.h"
#include "cudd/cuddInt.h"
#include "cudd/mtr.h"
#else
#include "util.h"
#include "cuddInt.h"
#include "mtr.h"
#endif
#include "YapInterface.h"
typedef struct

View File

@@ -17,7 +17,7 @@ DESTDIR=$(prefix)/lib/Yap
#
#
CC=@CC@
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir)/../../../include @CPPFLAGS@
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir)/../../../include -I../../.. @CPPFLAGS@
#
#
# You shouldn't need to change what follows.

View File

@@ -13,7 +13,12 @@ for the relative license.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "config.h"
#if HAVE_CUDD_CUDDINT_H
#include "cudd/cuddInt.h"
#else
#include "cuddInt.h"
#endif
#include "YapInterface.h"
#define LOGZERO log(0.000001)
#define CACHE_SLOTS 1