diff --git a/.gitignore b/.gitignore index 87c9e34..ca10712 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ current_cddlib *~ autom4te.cache/ bin/ +src/config.* config.log config.status configure diff --git a/PackageInfo.g b/PackageInfo.g index bad1683..bb97c47 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "CddInterface", Subtitle := "Gap interface to Cdd package", -Version := "2024.09.01", +Version := "2024.09.02", Date := ~.Version{[ 1 .. 10 ]}, Date := Concatenation( ~.Date{[ 9, 10 ]}, "/", ~.Date{[ 6, 7 ]}, "/", ~.Date{[ 1 .. 4 ]} ), License := "GPL-2.0-or-later", diff --git a/autogen.sh b/autogen.sh index 5f12428..efe9b05 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,4 +2,4 @@ # # Regenerate configure from configure.ac. Requires GNU autoconf. set -ex -autoconf -Wall -f +autoreconf -Wall -f diff --git a/configure.ac b/configure.ac index f2bb10d..4636a30 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ AC_PREREQ([2.68]) AC_INIT([CddInterface], [package]) AC_CONFIG_SRCDIR([src/CddInterface.c]) AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([src/config.h]) m4_include([m4/find_gap.m4]) dnl ## @@ -62,7 +63,15 @@ old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS $CDD_CPPFLAGS" LDFLAGS="$LDFLAGS $CDD_LDFLAGS" -AC_CHECK_HEADER([setoper.h], [], [AC_MSG_ERROR([could not use setoper.h])], []) + +AC_CHECK_HEADER( + [cddlib/setoper.h], + [AC_DEFINE([HAVE_CDDLIB_SETOPER_H], [1], [setting HAVE_CDDLIB_SETOPER_H=1])], + [AC_CHECK_HEADER( + [setoper.h], + [AC_DEFINE([HAVE_CDDLIB_SETOPER_H], [0], [setting HAVE_CDDLIB_SETOPER_H=0])], + [AC_MSG_ERROR([could not find setoper.h])])]) + AC_CHECK_LIB([cddgmp],[dd_SetLinearity]) CPPFLAGS="$old_CPPFLAGS" LDFLAGS="$old_LDFLAGS" diff --git a/src/CddInterface.c b/src/CddInterface.c index ad9e059..d0899cc 100644 --- a/src/CddInterface.c +++ b/src/CddInterface.c @@ -3,9 +3,15 @@ */ #include "compiled.h" // GAP headers - -#include "setoper.h" -#include "cdd.h" +#include "config.h" + +#if HAVE_CDDLIB_SETOPER_H == 1 +#include +#include +#else +#include +#include +#endif #include "gmp.h"