Index: dyn_modules/callgfanlib/Makefile.am
===================================================================
--- dyn_modules/callgfanlib/Makefile.am	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/Makefile.am	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -48,5 +48,5 @@
 gfanlib_g_la_CXXFLAGS = ${DEBUGCXXFLAGS}
 
-gfanlib_la_LIBADD = ${abs_top_builddir}/gfanlib/libgfan.la
+gfanlib_la_LIBADD = ${abs_top_builddir}/gfanlib/libgfan.la -lcddgmp
 gfanlib_g_la_LIBADD = ${gfanlib_la_LIBADD}
 
Index: dyn_modules/callgfanlib/bbcone.cc
===================================================================
--- dyn_modules/callgfanlib/bbcone.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbcone.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -1,4 +1,3 @@
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <gfanlib/gfanlib.h>
@@ -15,4 +14,6 @@
 #include <bbpolytope.h>
 #include <sstream>
+
+#include "Singular/ipid.h"
 
 // #include <omalloc/omalloc.h>
@@ -1559,5 +1560,5 @@
 }
 
-void bbcone_setup()
+void bbcone_setup(SModulFunctions* p)
 {
   blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
@@ -1572,46 +1573,43 @@
   b->blackbox_Assign=bbcone_Assign;
   b->blackbox_Op2=bbcone_Op2;
-  iiAddCproc("","coneViaInequalities",FALSE,coneViaNormals);
-  iiAddCproc("","coneViaPoints",FALSE,coneViaRays);
+  p->iiAddCproc("","coneViaInequalities",FALSE,coneViaNormals);
+  p->iiAddCproc("","coneViaPoints",FALSE,coneViaRays);
 
   // iiAddCproc("","makePolytope",FALSE,coneToPolytope);
-  iiAddCproc("","ambientDimension",FALSE,ambientDimension);
-  iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
-  iiAddCproc("","codimension",FALSE,codimension);
-  iiAddCproc("","coneLink",FALSE,coneLink);
-  iiAddCproc("","containsAsFace",FALSE,hasFace);
-  iiAddCproc("","containsInSupport",FALSE,containsInSupport);
-  iiAddCproc("","containsPositiveVector",FALSE,containsPositiveVector);
-  iiAddCproc("","containsRelatively",FALSE,containsRelatively);
-  iiAddCproc("","convexHull",FALSE,convexHull);
-  iiAddCproc("","convexIntersection",FALSE,intersectCones);
-  iiAddCproc("","dimension",FALSE,dimension);
-  iiAddCproc("","dualCone",FALSE,dualCone);
-  iiAddCproc("","equations",FALSE,equations);
-  iiAddCproc("","facets",FALSE,facets);
-  iiAddCproc("","generatorsOfLinealitySpace",FALSE,generatorsOfLinealitySpace);
-  iiAddCproc("","generatorsOfSpan",FALSE,generatorsOfSpan);
-  iiAddCproc("","getLinearForms",FALSE,getLinearForms);
-  iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
-  iiAddCproc("","inequalities",FALSE,inequalities);
-  iiAddCproc("","isFullSpace",FALSE,isFullSpace);
-  iiAddCproc("","isOrigin",FALSE,isOrigin);
-  iiAddCproc("","isSimplicial",FALSE,isSimplicial);
-  iiAddCproc("","linealityDimension",FALSE,linealityDimension);
-  iiAddCproc("","linealitySpace",FALSE,linealitySpace);
-  iiAddCproc("","negatedCone",FALSE,negatedCone);
-  iiAddCproc("","quotientLatticeBasis",FALSE,quotientLatticeBasis);
-  iiAddCproc("","randomPoint",FALSE,randomPoint);
-  iiAddCproc("","rays",FALSE,rays);
-  iiAddCproc("","relativeInteriorPoint",FALSE,relativeInteriorPoint);
-  iiAddCproc("","semigroupGenerator",FALSE,semigroupGenerator);
-  iiAddCproc("","setLinearForms",FALSE,setLinearForms);
-  iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
-  iiAddCproc("","span",FALSE,impliedEquations);
-  iiAddCproc("","uniquePoint",FALSE,uniquePoint);
-  iiAddCproc("","listContainsCone",FALSE,containsCone);
+  p->iiAddCproc("","ambientDimension",FALSE,ambientDimension);
+  p->iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
+  p->iiAddCproc("","codimension",FALSE,codimension);
+  p->iiAddCproc("","coneLink",FALSE,coneLink);
+  p->iiAddCproc("","containsAsFace",FALSE,hasFace);
+  p->iiAddCproc("","containsInSupport",FALSE,containsInSupport);
+  p->iiAddCproc("","containsPositiveVector",FALSE,containsPositiveVector);
+  p->iiAddCproc("","containsRelatively",FALSE,containsRelatively);
+  p->iiAddCproc("","convexHull",FALSE,convexHull);
+  p->iiAddCproc("","convexIntersection",FALSE,intersectCones);
+  p->iiAddCproc("","dimension",FALSE,dimension);
+  p->iiAddCproc("","dualCone",FALSE,dualCone);
+  p->iiAddCproc("","equations",FALSE,equations);
+  p->iiAddCproc("","facets",FALSE,facets);
+  p->iiAddCproc("","generatorsOfLinealitySpace",FALSE,generatorsOfLinealitySpace);
+  p->iiAddCproc("","generatorsOfSpan",FALSE,generatorsOfSpan);
+  p->iiAddCproc("","getLinearForms",FALSE,getLinearForms);
+  p->iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
+  p->iiAddCproc("","inequalities",FALSE,inequalities);
+  p->iiAddCproc("","isFullSpace",FALSE,isFullSpace);
+  p->iiAddCproc("","isOrigin",FALSE,isOrigin);
+  p->iiAddCproc("","isSimplicial",FALSE,isSimplicial);
+  p->iiAddCproc("","linealityDimension",FALSE,linealityDimension);
+  p->iiAddCproc("","linealitySpace",FALSE,linealitySpace);
+  p->iiAddCproc("","negatedCone",FALSE,negatedCone);
+  p->iiAddCproc("","quotientLatticeBasis",FALSE,quotientLatticeBasis);
+  p->iiAddCproc("","randomPoint",FALSE,randomPoint);
+  p->iiAddCproc("","rays",FALSE,rays);
+  p->iiAddCproc("","relativeInteriorPoint",FALSE,relativeInteriorPoint);
+  p->iiAddCproc("","semigroupGenerator",FALSE,semigroupGenerator);
+  p->iiAddCproc("","setLinearForms",FALSE,setLinearForms);
+  p->iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
+  p->iiAddCproc("","span",FALSE,impliedEquations);
+  p->iiAddCproc("","uniquePoint",FALSE,uniquePoint);
+  p->iiAddCproc("","listContainsCone",FALSE,containsCone);
   coneID=setBlackboxStuff(b,"cone");
 }
-
-#endif
-/* HAVE_FANS */
Index: dyn_modules/callgfanlib/bbcone.h
===================================================================
--- dyn_modules/callgfanlib/bbcone.h	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbcone.h	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -3,5 +3,4 @@
 
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <gfanlib/gfanlib.h>
@@ -9,7 +8,9 @@
 #include <libpolys/coeffs/bigintmat.h>
 
+#include "Singular/ipid.h"
+
 extern int coneID;
 
-void bbcone_setup();
+void bbcone_setup(SModulFunctions* p);
 
 /***
@@ -37,3 +38,2 @@
 
 #endif
-#endif
Index: dyn_modules/callgfanlib/bbfan.cc
===================================================================
--- dyn_modules/callgfanlib/bbfan.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbfan.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -1,4 +1,3 @@
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <Singular/ipid.h>
@@ -976,5 +975,5 @@
 
 
-void bbfan_setup()
+void bbfan_setup(SModulFunctions* p)
 {
   blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
@@ -998,24 +997,21 @@
   // iiAddCproc("","isSimplicial",FALSE,isSimplicial);
   /********************************************************/
-  iiAddCproc("","isCompatible",FALSE,isCompatible);
-  iiAddCproc("","numberOfConesOfDimension",FALSE,numberOfConesOfDimension);
-  iiAddCproc("","ncones",FALSE,ncones);
-  iiAddCproc("","nmaxcones",FALSE,nmaxcones);
-  iiAddCproc("","insertCone",FALSE,insertCone);
-  iiAddCproc("","removeCone",FALSE,removeCone);
-  iiAddCproc("","getCone",FALSE,getCone);
-  iiAddCproc("","getCones",FALSE,getCones);
-  iiAddCproc("","isPure",FALSE,isPure);
-  iiAddCproc("","fanFromString",FALSE,fanFromString);
-  iiAddCproc("","fanViaCones",FALSE,fanViaCones);
-  iiAddCproc("","numberOfConesWithVector",FALSE,numberOfConesWithVector);
+  p->iiAddCproc("","isCompatible",FALSE,isCompatible);
+  p->iiAddCproc("","numberOfConesOfDimension",FALSE,numberOfConesOfDimension);
+  p->iiAddCproc("","ncones",FALSE,ncones);
+  p->iiAddCproc("","nmaxcones",FALSE,nmaxcones);
+  p->iiAddCproc("","insertCone",FALSE,insertCone);
+  p->iiAddCproc("","removeCone",FALSE,removeCone);
+  p->iiAddCproc("","getCone",FALSE,getCone);
+  p->iiAddCproc("","getCones",FALSE,getCones);
+  p->iiAddCproc("","isPure",FALSE,isPure);
+  p->iiAddCproc("","fanFromString",FALSE,fanFromString);
+  p->iiAddCproc("","fanViaCones",FALSE,fanViaCones);
+  p->iiAddCproc("","numberOfConesWithVector",FALSE,numberOfConesWithVector);
   // iiAddCproc("","isComplete",FALSE,isComplete);  not working as expected, should leave this to polymake
-  iiAddCproc("","fVector",FALSE,fVector);
-  iiAddCproc("","containsInCollection",FALSE,containsInCollection);
+  p->iiAddCproc("","fVector",FALSE,fVector);
+  p->iiAddCproc("","containsInCollection",FALSE,containsInCollection);
   // iiAddCproc("","grFan",FALSE,grFan);
   fanID=setBlackboxStuff(b,"fan");
   //Print("created type %d (fan)\n",fanID);
 }
-
-#endif
-/* HAVE_FANS */
Index: dyn_modules/callgfanlib/bbfan.h
===================================================================
--- dyn_modules/callgfanlib/bbfan.h	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbfan.h	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -3,11 +3,11 @@
 
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <gfanlib/gfanlib.h>
+#include <Singular/ipid.h>
 
 extern int fanID;
 
-void bbfan_setup();
+void bbfan_setup(SModulFunctions* p);
 
 int getAmbientDimension(gfan::ZFan* zf);
@@ -19,3 +19,2 @@
 
 #endif
-#endif
Index: dyn_modules/callgfanlib/bbpolytope.cc
===================================================================
--- dyn_modules/callgfanlib/bbpolytope.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbpolytope.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -1,4 +1,3 @@
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <gfanlib/gfanlib.h>
@@ -460,5 +459,5 @@
 }
 
-void bbpolytope_setup()
+void bbpolytope_setup(SModulFunctions* p)
 {
   blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
@@ -472,10 +471,10 @@
   b->blackbox_Copy=bbpolytope_Copy;
   b->blackbox_Assign=bbpolytope_Assign;
-  iiAddCproc("","polytopeViaPoints",FALSE,polytopeViaVertices);
-  iiAddCproc("","polytopeViaInequalities",FALSE,polytopeViaNormals);
-  iiAddCproc("","vertices",FALSE,vertices);
-  iiAddCproc("","newtonPolytope",FALSE,newtonPolytope);
-  iiAddCproc("","scalePolytope",FALSE,scalePolytope);
-  iiAddCproc("","dualPolytope",FALSE,dualPolytope);
+  p->iiAddCproc("","polytopeViaPoints",FALSE,polytopeViaVertices);
+  p->iiAddCproc("","polytopeViaInequalities",FALSE,polytopeViaNormals);
+  p->iiAddCproc("","vertices",FALSE,vertices);
+  p->iiAddCproc("","newtonPolytope",FALSE,newtonPolytope);
+  p->iiAddCproc("","scalePolytope",FALSE,scalePolytope);
+  p->iiAddCproc("","dualPolytope",FALSE,dualPolytope);
   /********************************************************/
   /* the following functions are implemented in bbcone.cc */
@@ -497,5 +496,2 @@
   //Print("created type %d (polytope)\n",polytopeID);
 }
-
-#endif
-/* HAVE_FANS */
Index: dyn_modules/callgfanlib/bbpolytope.h
===================================================================
--- dyn_modules/callgfanlib/bbpolytope.h	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/bbpolytope.h	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -3,11 +3,11 @@
 
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <gfanlib/gfanlib.h>
+#include "Singular/ipid.h"
 
 extern int polytopeID;
 
-void bbpolytope_setup();
+void bbpolytope_setup(SModulFunctions* p);
 
 // zc is meant to represent a polytope here
@@ -18,3 +18,2 @@
 
 #endif
-#endif
Index: dyn_modules/callgfanlib/gfan.cc
===================================================================
--- dyn_modules/callgfanlib/gfan.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/gfan.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -7,5 +7,4 @@
 #include <kernel/mod2.h>
 
-#ifdef HAVE_FANS
 #include <libpolys/misc/options.h>
 #include <kernel/kstd1.h>
@@ -4521,3 +4520,2 @@
 //     WerrorS("Need wp ordering");
 // }
-#endif
Index: dyn_modules/callgfanlib/gfan.h
===================================================================
--- dyn_modules/callgfanlib/gfan.h	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/gfan.h	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -4,6 +4,4 @@
 Author: monerjan
 */
-#ifdef HAVE_FANS
-
 #ifndef GFAN_H
 #define GFAN_H
@@ -269,3 +267,2 @@
 // bool iv64isStrictlyPositive(int64vec *);
 #endif
-#endif
Index: dyn_modules/callgfanlib/gfanlib.cc
===================================================================
--- dyn_modules/callgfanlib/gfanlib.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/gfanlib.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -1,8 +1,9 @@
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
+
 #include <bbcone.h>
 #include <bbfan.h>
 #include <bbpolytope.h>
 #include <gitfan.h>
+#include"Singular/ipid.h"
 
 template class gfan::Vector<gfan::Integer>;
@@ -11,10 +12,9 @@
 template class gfan::Matrix<gfan::Rational>;
 
-extern "C" int mod_init(void* gfanlibsingular)
+extern "C" int mod_init(SModulFunctions* p)
 {
-  bbcone_setup();
-  bbfan_setup();
-  bbpolytope_setup();
-  gitfan_setup();
+  bbcone_setup(p);
+  bbfan_setup(p);
+  bbpolytope_setup(p);
+  gitfan_setup(p);
 }
-#endif
Index: dyn_modules/callgfanlib/gitfan.cc
===================================================================
--- dyn_modules/callgfanlib/gitfan.cc	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/gitfan.cc	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -11,6 +11,6 @@
 
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
-
+
+#include <Singular/ipid.h>
 #include <Singular/lists.h>
 #include <Singular/ipshell.h>
@@ -257,8 +257,6 @@
 }
 
-void gitfan_setup()
-{
-  iiAddCproc("","refineCones",FALSE,refineCones);
-}
-
-#endif
+void gitfan_setup(SModulFunctions* p)
+{
+  p->iiAddCproc("","refineCones",FALSE,refineCones);
+}
Index: dyn_modules/callgfanlib/gitfan.h
===================================================================
--- dyn_modules/callgfanlib/gitfan.h	(revision dd9de08cf1acd4433f35d74d593d1ec792b0176b)
+++ dyn_modules/callgfanlib/gitfan.h	(revision 58b40709be120cdebadfaa297ed805f7b5ae72a9)
@@ -3,8 +3,8 @@
 
 #include <kernel/mod2.h>
-#ifdef HAVE_FANS
 
 #include <bbcone.h>
 #include <bbfan.h>
+#include <Singular/ipid.h>
 
 namespace gitfan
@@ -50,6 +50,5 @@
 }
 
-void gitfan_setup();
+void gitfan_setup(SModulFunctions* p);
 
 #endif
-#endif
