Index: for_Hans_with_love.sh
===================================================================
--- for_Hans_with_love.sh	(revision 44d5adb209a6c64fd34d3985f93a7c9dc6e37179)
+++ for_Hans_with_love.sh	(revision 964389e50adfc08d7756a47697064d105b4d086b)
@@ -50,4 +50,5 @@
   libtoolize --force
   aclocal -I $TOP_DIR/m4
+  autoheader
   autotools
   cd $TOP_DIR
Index: libpolys/configure.ac
===================================================================
--- libpolys/configure.ac	(revision 44d5adb209a6c64fd34d3985f93a7c9dc6e37179)
+++ libpolys/configure.ac	(revision 964389e50adfc08d7756a47697064d105b4d086b)
@@ -71,4 +71,13 @@
 SING_CHECK_PLURAL
 
+if test "x$prefix" != xNONE; then
+  PREFIX="$prefix"
+else
+  PREFIX="$ac_default_prefix"
+fi
+
+# AC_SUBST(PREFIX)
+AC_DEFINE_UNQUOTED(INSTALL_PREFIX,"$PREFIX",Prefix)
+
 AC_SUBST(LIBPREFIX)
 
Index: libpolys/polys/nc/gring.cc
===================================================================
--- libpolys/polys/nc/gring.cc	(revision 44d5adb209a6c64fd34d3985f93a7c9dc6e37179)
+++ libpolys/polys/nc/gring.cc	(revision 964389e50adfc08d7756a47697064d105b4d086b)
@@ -2372,6 +2372,6 @@
   int *M1=(int *)omAlloc0((rN+1)*sizeof(int));
   int *M2=(int *)omAlloc0((rN+1)*sizeof(int));
-  int *PREFIX=(int *)omAlloc0((rN+1)*sizeof(int));
-  int *SUFFIX=(int *)omAlloc0((rN+1)*sizeof(int));
+  int *aPREFIX=(int *)omAlloc0((rN+1)*sizeof(int));
+  int *aSUFFIX=(int *)omAlloc0((rN+1)*sizeof(int));
   p_GetExpV(m1,M1, r);
   p_GetExpV(m2,M2, r);
@@ -2419,15 +2419,15 @@
           {
             /* now mult (prefix, bres, suffix) */
-            memcpy(SUFFIX, M1,(rN+1)*sizeof(int));
-            memcpy(PREFIX, M1,(rN+1)*sizeof(int));
-            for (k=1;k<=j;k++) SUFFIX[k]=0;
-            for (k=j;k<=rN;k++) PREFIX[k]=0;
-            SUFFIX[0]=0;
-            PREFIX[0]=0;
+            memcpy(aSUFFIX, M1,(rN+1)*sizeof(int));
+            memcpy(aPREFIX, M1,(rN+1)*sizeof(int));
+            for (k=1;k<=j;k++) aSUFFIX[k]=0;
+            for (k=j;k<=rN;k++) aPREFIX[k]=0;
+            aSUFFIX[0]=0;
+            aPREFIX[0]=0;
             prefix=p_One(r);
             suffix=p_One(r);
-            p_SetExpV(prefix,PREFIX, r);
+            p_SetExpV(prefix,aPREFIX, r);
             p_Setm(prefix, r);
-            p_SetExpV(suffix,SUFFIX, r);
+            p_SetExpV(suffix,aSUFFIX, r);
             p_Setm(suffix, r);
             if (!p_LmIsConstant(prefix, r)) bres = gnc_mm_Mult_p(prefix, bres, r);
@@ -2435,5 +2435,5 @@
             ares=p_Add_q(ares, bres, r);
             /* What to give free? */
-        /* Do we have to free PREFIX/SUFFIX? it seems so */
+        /* Do we have to free aPREFIX/aSUFFIX? it seems so */
             p_Delete(&prefix, r);
             p_Delete(&suffix, r);
@@ -2444,15 +2444,15 @@
       {
         /* now mult (prefix, bres, suffix) */
-        memcpy(SUFFIX, M2,(rN+1)*sizeof(int));
-        memcpy(PREFIX, M2,(rN+1)*sizeof(int));
-        for (k=1;k<=i;k++) SUFFIX[k]=0;
-        for (k=i;k<=rN;k++) PREFIX[k]=0;
-        SUFFIX[0]=0;
-        PREFIX[0]=0;
+        memcpy(aSUFFIX, M2,(rN+1)*sizeof(int));
+        memcpy(aPREFIX, M2,(rN+1)*sizeof(int));
+        for (k=1;k<=i;k++) aSUFFIX[k]=0;
+        for (k=i;k<=rN;k++) aPREFIX[k]=0;
+        aSUFFIX[0]=0;
+        aPREFIX[0]=0;
         prefix=p_One(r);
         suffix=p_One(r);
-        p_SetExpV(prefix,PREFIX, r);
+        p_SetExpV(prefix,aPREFIX, r);
         p_Setm(prefix, r);
-        p_SetExpV(suffix,SUFFIX, r);
+        p_SetExpV(suffix,aSUFFIX, r);
         p_Setm(suffix, r);
         bres=ares;
@@ -2467,6 +2467,6 @@
   freeT(M1, rN);
   freeT(M2, rN);
-  freeT(PREFIX, rN);
-  freeT(SUFFIX, rN);
+  freeT(aPREFIX, rN);
+  freeT(aSUFFIX, rN);
 #ifdef PDEBUG
   p_Test(res, r);
Index: libpolys/resources/feResource.cc
===================================================================
--- libpolys/resources/feResource.cc	(revision 44d5adb209a6c64fd34d3985f93a7c9dc6e37179)
+++ libpolys/resources/feResource.cc	(revision 964389e50adfc08d7756a47697064d105b4d086b)
@@ -77,4 +77,5 @@
   {"SearchPath",    's', feResPath,  NULL,
    "$SINGULARPATH;"
+   "" INSTALL_PREFIX ";"
    "%b/LIB;"
    "%b/MOD;"
