Index: rnel/mod_raw.cc
===================================================================
--- kernel/mod_raw.cc	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ 	(revision )
@@ -1,329 +1,0 @@
-/****************************************
-*  Computer Algebra System SINGULAR     *
-****************************************/
-/* $Id$ */
-/*
- * ABSTRACT: machine depend code for dynamic modules
- *
- * Provides: dynl_open()
- *           dynl_sym()
- *           dynl_error()
- *           dynl_close()
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-
-#include <kernel/mod2.h>
-#include <Singular/static.h>
-
-#include <kernel/mod_raw.h>
-#include <kernel/febase.h>
-
-#ifdef HAVE_STATIC
-#undef HAVE_DL
-#endif
-/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
-#define BYTES_TO_CHECK 7
-
-lib_types type_of_LIB(char *newlib, char *libnamebuf)
-{
-  const char mach_o[]={0xfe,0xed,0xfa,0xce,0};
-  const char mach_o_module[]={0xce,0xfa,0xed,0xfe,0};
-  char        buf[BYTES_TO_CHECK+1];        /* one extra for terminating '\0' */
-  struct stat sb;
-  int nbytes = 0;
-  int ret;
-  lib_types LT=LT_NONE;
-
-  FILE * fp = feFopen( newlib, "r", libnamebuf, FALSE );
-  ret = stat(libnamebuf, &sb);
-
-  if (fp==NULL)
-  {
-    return LT_NOTFOUND;
-  }
-  if((sb.st_mode & S_IFMT) != S_IFREG)
-  {
-    goto lib_type_end;
-  }
-  if ((nbytes = fread((char *)buf, sizeof(char), BYTES_TO_CHECK, fp)) == -1)
-  {
-    goto lib_type_end;
-    /*NOTREACHED*/
-  }
-  if (nbytes == 0)
-    goto lib_type_end;
-  else
-  {
-    buf[nbytes++] = '\0';        /* null-terminate it */
-  }
-  if( (strncmp(buf, "\177ELF", 4)==0)) /* generic ELF */
-  {
-    LT = LT_ELF;
-    //omFree(newlib);
-    //newlib = omStrDup(libnamebuf);
-    goto lib_type_end;
-  }
-
-  if( (strncmp(buf, &mach_o[0], 4)==0)) /* generic Mach-O module */
-  {
-    LT = LT_MACH_O;
-    //omFree(newlib);
-    //newlib = omStrDup(libnamebuf);
-    goto lib_type_end;
-  }
-
-  if( (strncmp(buf, &mach_o_module[0], 4)==0)) /* Mach-O bundle */
-  {
-    LT = LT_MACH_O;
-    //omFree(newlib);
-    //newlib = omStrDup(libnamebuf);
-    goto lib_type_end;
-  }
-
-   
-  if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0))
-  {
-    LT = LT_HPUX;
-    //omFree(newlib);
-    //newlib = omStrDup(libnamebuf);
-    goto lib_type_end;
-  }
-  if(isprint(buf[0]) || buf[0]=='\n')
-  { LT = LT_SINGULAR; goto lib_type_end; }
-
-  lib_type_end:
-  fclose(fp);
-  return LT;
-}
-/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
-#if defined(HAVE_DL)
-
-/*****************************************************************************
- *
- * General section
- * These are just wrappers around the repsective dynl_* calls
- * which look for the binary in the bin_dir of Singular and ommit warnings if
- * somethings goes wrong
- *
- *****************************************************************************/
-static BOOLEAN warn_handle = FALSE;
-static BOOLEAN warn_proc = FALSE;
-#ifndef DL_TAIL
-#define DL_TAIL "so"
-#endif
-
-void* dynl_open_binary_warn(const char* binary_name, const char* msg)
-{
-  void* handle = NULL;
-  const char* bin_dir = feGetResource('b');
-  if (bin_dir != NULL)
-  {
-    char path_name[MAXPATHLEN];
-    sprintf(path_name, "%s%s%s.%s", bin_dir, DIR_SEPP, binary_name,
-            DL_TAIL);
-    handle = dynl_open(path_name);
-    if (handle == NULL && ! warn_handle)
-    {
-      Warn("Could not open dynamic library: %s", path_name);
-      Warn("Error message from system: %s", dynl_error());
-      if (msg != NULL) Warn("%s", msg);
-      Warn("See the INSTALL section in the Singular manual for details.");
-      warn_handle = TRUE;
-    }
-  }
-  return  handle;
-}
-
-void* dynl_sym_warn(void* handle, const char* proc, const char* msg)
-{
-  void *proc_ptr = NULL;
-  if (handle != NULL)
-  {
-    proc_ptr = dynl_sym(handle, proc);
-    if (proc_ptr == NULL && ! warn_proc)
-    {
-      Warn("Could load a procedure from a dynamic library");
-      Warn("Error message from system: %s", dynl_error());
-      if (msg != NULL) Warn("%s", msg);
-      Warn("See the INSTALL section in the Singular manual for details.");
-      warn_proc = TRUE;
-    }
-  }
-  return proc_ptr;
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*****************************************************************************
- * SECTION generic ELF: ix86-linux / alpha-linux / IA64-linux /x86_64_Linux  *
- *                      SunOS-5 / IRIX-6 / ppcMac-Darwin / FreeeBSD          *
- *****************************************************************************/
-// relying on gcc to define __ELF__, check with cpp -dM /dev/null
-// Mac OsX is an ELF system, but does not define __ELF__
-// Solaris is an ELF system, but does not define __ELF__
-#if defined(__ELF__)
-#define HAVE_ELF_SYSTEM
-#endif
-
-#if defined(ppcMac_darwin)
-#define HAVE_ELF_SYSTEM
-#endif
-
-#if defined(ix86Mac_darwin)
-#define HAVE_ELF_SYSTEM
-#endif
-
-#if defined(x86_64Mac_darwin)
-#define HAVE_ELF_SYSTEM
-#endif
-
-#if defined(SunOS_5)
-#define HAVE_ELF_SYSTEM
-#endif
-
-#if defined(HAVE_ELF_SYSTEM)
-#include <dlfcn.h>
-
-static void* kernel_handle = NULL;
-void *dynl_open(
-  char *filename    /* I: filename to load */
-  )
-{
-// glibc 2.2:
-  if ((filename==NULL) || (dlopen(filename,RTLD_NOW|RTLD_NOLOAD)==NULL))
-    return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
-  else
-    Werror("module %s already loaded",filename);
-  return NULL;
-// alternative  
-//    return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
-}
-
-void *dynl_sym(void *handle, const char *symbol)
-{
-  if (handle == DYNL_KERNEL_HANDLE)
-  {
-    if (kernel_handle == NULL)
-      kernel_handle = dynl_open(NULL);
-    handle = kernel_handle;
-  }
-  return(dlsym(handle, symbol));
-}
-
-int dynl_close (void *handle)
-{
-  return(dlclose (handle));
-}
-
-const char *dynl_error()
-{
-  return(dlerror());
-}
-#endif /* ELF_SYSTEM */
-
-/*****************************************************************************
- * SECTION HPUX-9/10                                                         *
- *****************************************************************************/
-#if defined(HPUX_9) || defined(HPUX_10)
-#include <dl.h>
-
-typedef char *((*func_ptr) ());
-
-void *dynl_open(char *filename)
-{
-  shl_t           handle = shl_load(filename, BIND_DEFERRED, 0);
-
-  return ((void *) handle);
-}
-
-void *dynl_sym(void *handle, const char *symbol)
-{
-  func_ptr        f;
-
-  if (handle == DYNL_KERNEL_HANDLE)
-    handle = PROG_HANDLE;
-
-  if (shl_findsym((shl_t *) & handle, symbol, TYPE_PROCEDURE, &f) == -1)
-  {
-    if (shl_findsym((shl_t *) & handle, symbol, TYPE_UNDEFINED, &f) == -1)
-    {
-      f = (func_ptr) NULL;
-    }
-  }
-  return ((void *)f);
-}
-
-int dynl_close (void *handle)
-{
-  shl_unload((shl_t) handle);
-  return(0);
-}
-
-const char *dynl_error()
-{
-  static char errmsg[] = "shl_load failed";
-
-  return errmsg;
-}
-#endif /* HPUX_9  or HPUX_10 */
-
-/*****************************************************************************
- * SECTION AIX-4                                                             *
- *****************************************************************************/
-#ifdef AIX_4
-#define DL_NOT_IMPLEMENTED
-#endif
-
-/*****************************************************************************
- * SECTION Sun3OS-4                                                          *
- *****************************************************************************/
-#ifdef Sun3OS_4
-#define DL_NOT_IMPLEMENTED
-#endif
-
-/*****************************************************************************
- * SECTION SunOS-4                                                         *
- *****************************************************************************/
-#if defined(SunOS_4)
-#define DL_NOT_IMPLEMENTED
-#endif
-
-/*****************************************************************************
- * SECTION generic: dynamic madules not available
- *****************************************************************************/
-#ifdef DL_NOT_IMPLEMEMENTED
-
-void *dynl_open(char *filename)
-{
-  return(NULL);
-}
-
-void *dynl_sym(void *handle, const char *symbol)
-{
-  return(NULL);
-}
-
-int dynl_close (void *handle)
-{
-  return(0);
-}
-
-const char *dynl_error()
-{
-  static char errmsg[] = "support for dynamic loading not implemented";
-  return errmsg;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* HAVE_DL */
Index: rnel/mod_raw.h
===================================================================
--- kernel/mod_raw.h	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#ifndef MOD_RAW_H
-#define MOD_RAW_H
-/****************************************
-*  Computer Algebra System SINGULAR     *
-****************************************/
-/* $Id$ */
-/*
- * ABSTRACT: machine depend code for dynamic modules
- *
- * Provides: dynl_open()
- *           dynl_sym()
- *           dynl_error()
- *           dunl_close()
-*/
-
-typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O} lib_types;
-
-lib_types type_of_LIB(char *newlib, char *fullname);
-
-#if defined(HAVE_DL)
-#ifdef __cplusplus
-void* dynl_open_binary_warn(const char* binary_name, const char* msg = NULL );
-void* dynl_sym_warn(void* handle, const char* proc, const char* msg = NULL );
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-void *       dynl_open(char *filename);
-// if handle == DYNL_KERNEL_HANDLE, then symbol is searched for
-// in kernel of program
-#define DYNL_KERNEL_HANDLE ((void*) 0x1)
-void *       dynl_sym(void *handle, const char *symbol);
-int          dynl_close (void *handle);
-const char * dynl_error();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* HAVE_DL */
-#endif /* MOD_RAW_H */
Index: libpolys/coeffs/ffields.h
===================================================================
--- libpolys/coeffs/ffields.h	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/coeffs/ffields.h	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -51,5 +51,5 @@
 void    nfReadTable   (const int c, const coeffs r);
 
-void    nfShowMipo();
+void    nfShowMipo(const coeffs r);
 #endif
 
Index: libpolys/polys/Makefile.am
===================================================================
--- libpolys/polys/Makefile.am	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/polys/Makefile.am	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -34,6 +34,6 @@
 	nc/gring.cc nc/sca.cc nc/summator.cc nc/ncSAFormula.cc nc/ncSACache.cc nc/ncSAMult.cc \
 	pDebug.cc pInline0.cc polys0.cc prCopy.cc \
-	kbuckets.cc sbuckets.cc ${USE_P_PROCS_STATIC_CC} ${USE_P_PROCS_DYNAMIC_CC} weight.cc \
-        weight0.c simpleideals.cc matpol.cc
+	kbuckets.cc sbuckets.cc weight.cc weight0.c simpleideals.cc matpol.cc \
+  ${USE_P_PROCS_STATIC_CC} ${USE_P_PROCS_DYNAMIC_CC} templates/mod_raw.cc 
 
 BUILT_SOURCES = templates/p_Procs.inc
@@ -46,5 +46,5 @@
 	pInline0.h operations/pShallowCopyDelete.h \
 	templates/p_MemAdd.h templates/p_MemCmp.h templates/p_MemCopy.h operations/p_Mult_q.h \
-	templates/p_Numbers.h templates/p_Procs.h \
+	templates/p_Numbers.h templates/p_Procs.h templates/mod_raw.h \
 	templates/p_Procs_Dynamic.h templates/p_Procs_Impl.h templates/p_Procs_Set.h templates/p_Procs_Static.h \
 	monomials/p_polys.h monomials/polys-impl.h monomials/maps.h polys.h prCopy.h prCopyMacros.h \
Index: libpolys/polys/monomials/ring.cc
===================================================================
--- libpolys/polys/monomials/ring.cc	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/polys/monomials/ring.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -267,5 +267,5 @@
     Print("//   primitive element : %s\n", r->parameter[0]);
     StringSetS("//   minpoly        : ");
-    nfShowMipo();PrintS(StringAppendS("\n"));
+    nfShowMipo(r->cf);PrintS(StringAppendS("\n"));
   }
 #ifdef HAVE_RINGS
Index: libpolys/polys/templates/mod_raw.cc
===================================================================
--- libpolys/polys/templates/mod_raw.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
+++ libpolys/polys/templates/mod_raw.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -0,0 +1,336 @@
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/* $Id$ */
+/*
+ * ABSTRACT: machine depend code for dynamic modules
+ *
+ * Provides: dynl_open()
+ *           dynl_sym()
+ *           dynl_error()
+ *           dynl_close()
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+
+#include "config.h"
+#include <misc/auxiliary.h>
+
+// #include <kernel/mod2.h>
+// #include <Singular/static.h>
+
+#include <reporter/reporter.h>
+
+#include <resources/feResource.h>
+#include <resources/feFopen.h>
+
+#include "templates/mod_raw.h"
+
+#ifdef HAVE_STATIC
+#undef HAVE_DL
+#endif
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
+#define BYTES_TO_CHECK 7
+
+lib_types type_of_LIB(char *newlib, char *libnamebuf)
+{
+  const char mach_o[]={0xfe,0xed,0xfa,0xce,0};
+  const char mach_o_module[]={0xce,0xfa,0xed,0xfe,0};
+  char        buf[BYTES_TO_CHECK+1];        /* one extra for terminating '\0' */
+  struct stat sb;
+  int nbytes = 0;
+  int ret;
+  lib_types LT=LT_NONE;
+
+  FILE * fp = feFopen( newlib, "r", libnamebuf, FALSE );
+  ret = stat(libnamebuf, &sb);
+
+  if (fp==NULL)
+  {
+    return LT_NOTFOUND;
+  }
+  if((sb.st_mode & S_IFMT) != S_IFREG)
+  {
+    goto lib_type_end;
+  }
+  if ((nbytes = fread((char *)buf, sizeof(char), BYTES_TO_CHECK, fp)) == -1)
+  {
+    goto lib_type_end;
+    /*NOTREACHED*/
+  }
+  if (nbytes == 0)
+    goto lib_type_end;
+  else
+  {
+    buf[nbytes++] = '\0';        /* null-terminate it */
+  }
+  if( (strncmp(buf, "\177ELF", 4)==0)) /* generic ELF */
+  {
+    LT = LT_ELF;
+    //omFree(newlib);
+    //newlib = omStrDup(libnamebuf);
+    goto lib_type_end;
+  }
+
+  if( (strncmp(buf, &mach_o[0], 4)==0)) /* generic Mach-O module */
+  {
+    LT = LT_MACH_O;
+    //omFree(newlib);
+    //newlib = omStrDup(libnamebuf);
+    goto lib_type_end;
+  }
+
+  if( (strncmp(buf, &mach_o_module[0], 4)==0)) /* Mach-O bundle */
+  {
+    LT = LT_MACH_O;
+    //omFree(newlib);
+    //newlib = omStrDup(libnamebuf);
+    goto lib_type_end;
+  }
+
+   
+  if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0))
+  {
+    LT = LT_HPUX;
+    //omFree(newlib);
+    //newlib = omStrDup(libnamebuf);
+    goto lib_type_end;
+  }
+  if(isprint(buf[0]) || buf[0]=='\n')
+  { LT = LT_SINGULAR; goto lib_type_end; }
+
+  lib_type_end:
+  fclose(fp);
+  return LT;
+}
+/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
+#if defined(HAVE_DL)
+
+/*****************************************************************************
+ *
+ * General section
+ * These are just wrappers around the repsective dynl_* calls
+ * which look for the binary in the bin_dir of Singular and ommit warnings if
+ * somethings goes wrong
+ *
+ *****************************************************************************/
+static BOOLEAN warn_handle = FALSE;
+static BOOLEAN warn_proc = FALSE;
+#ifndef DL_TAIL
+#define DL_TAIL "so"
+#endif
+
+void* dynl_open_binary_warn(const char* binary_name, const char* msg)
+{
+  void* handle = NULL;
+  const char* bin_dir = feGetResource('b');
+  if (bin_dir != NULL)
+  {
+    char path_name[MAXPATHLEN];
+    sprintf(path_name, "%s%s%s.%s", bin_dir, DIR_SEPP, binary_name,
+            DL_TAIL);
+    handle = dynl_open(path_name);
+    if (handle == NULL && ! warn_handle)
+    {
+      Warn("Could not open dynamic library: %s", path_name);
+      Warn("Error message from system: %s", dynl_error());
+      if (msg != NULL) Warn("%s", msg);
+      Warn("See the INSTALL section in the Singular manual for details.");
+      warn_handle = TRUE;
+    }
+  }
+  return  handle;
+}
+
+void* dynl_sym_warn(void* handle, const char* proc, const char* msg)
+{
+  void *proc_ptr = NULL;
+  if (handle != NULL)
+  {
+    proc_ptr = dynl_sym(handle, proc);
+    if (proc_ptr == NULL && ! warn_proc)
+    {
+      Warn("Could load a procedure from a dynamic library");
+      Warn("Error message from system: %s", dynl_error());
+      if (msg != NULL) Warn("%s", msg);
+      Warn("See the INSTALL section in the Singular manual for details.");
+      warn_proc = TRUE;
+    }
+  }
+  return proc_ptr;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************
+ * SECTION generic ELF: ix86-linux / alpha-linux / IA64-linux /x86_64_Linux  *
+ *                      SunOS-5 / IRIX-6 / ppcMac-Darwin / FreeeBSD          *
+ *****************************************************************************/
+// relying on gcc to define __ELF__, check with cpp -dM /dev/null
+// Mac OsX is an ELF system, but does not define __ELF__
+// Solaris is an ELF system, but does not define __ELF__
+#if defined(__ELF__)
+#define HAVE_ELF_SYSTEM
+#endif
+
+#if defined(ppcMac_darwin)
+#define HAVE_ELF_SYSTEM
+#endif
+
+#if defined(ix86Mac_darwin)
+#define HAVE_ELF_SYSTEM
+#endif
+
+#if defined(x86_64Mac_darwin)
+#define HAVE_ELF_SYSTEM
+#endif
+
+#if defined(SunOS_5)
+#define HAVE_ELF_SYSTEM
+#endif
+
+#if defined(HAVE_ELF_SYSTEM)
+#include <dlfcn.h>
+
+static void* kernel_handle = NULL;
+void *dynl_open(
+  char *filename    /* I: filename to load */
+  )
+{
+// glibc 2.2:
+  if ((filename==NULL) || (dlopen(filename,RTLD_NOW|RTLD_NOLOAD)==NULL))
+    return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
+  else
+    Werror("module %s already loaded",filename);
+  return NULL;
+// alternative  
+//    return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL));
+}
+
+void *dynl_sym(void *handle, const char *symbol)
+{
+  if (handle == DYNL_KERNEL_HANDLE)
+  {
+    if (kernel_handle == NULL)
+      kernel_handle = dynl_open(NULL);
+    handle = kernel_handle;
+  }
+  return(dlsym(handle, symbol));
+}
+
+int dynl_close (void *handle)
+{
+  return(dlclose (handle));
+}
+
+const char *dynl_error()
+{
+  return(dlerror());
+}
+#endif /* ELF_SYSTEM */
+
+/*****************************************************************************
+ * SECTION HPUX-9/10                                                         *
+ *****************************************************************************/
+#if defined(HPUX_9) || defined(HPUX_10)
+#include <dl.h>
+
+typedef char *((*func_ptr) ());
+
+void *dynl_open(char *filename)
+{
+  shl_t           handle = shl_load(filename, BIND_DEFERRED, 0);
+
+  return ((void *) handle);
+}
+
+void *dynl_sym(void *handle, const char *symbol)
+{
+  func_ptr        f;
+
+  if (handle == DYNL_KERNEL_HANDLE)
+    handle = PROG_HANDLE;
+
+  if (shl_findsym((shl_t *) & handle, symbol, TYPE_PROCEDURE, &f) == -1)
+  {
+    if (shl_findsym((shl_t *) & handle, symbol, TYPE_UNDEFINED, &f) == -1)
+    {
+      f = (func_ptr) NULL;
+    }
+  }
+  return ((void *)f);
+}
+
+int dynl_close (void *handle)
+{
+  shl_unload((shl_t) handle);
+  return(0);
+}
+
+const char *dynl_error()
+{
+  static char errmsg[] = "shl_load failed";
+
+  return errmsg;
+}
+#endif /* HPUX_9  or HPUX_10 */
+
+/*****************************************************************************
+ * SECTION AIX-4                                                             *
+ *****************************************************************************/
+#ifdef AIX_4
+#define DL_NOT_IMPLEMENTED
+#endif
+
+/*****************************************************************************
+ * SECTION Sun3OS-4                                                          *
+ *****************************************************************************/
+#ifdef Sun3OS_4
+#define DL_NOT_IMPLEMENTED
+#endif
+
+/*****************************************************************************
+ * SECTION SunOS-4                                                         *
+ *****************************************************************************/
+#if defined(SunOS_4)
+#define DL_NOT_IMPLEMENTED
+#endif
+
+/*****************************************************************************
+ * SECTION generic: dynamic madules not available
+ *****************************************************************************/
+#ifdef DL_NOT_IMPLEMEMENTED
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, const char *symbol)
+{
+  return(NULL);
+}
+
+int dynl_close (void *handle)
+{
+  return(0);
+}
+
+const char *dynl_error()
+{
+  static char errmsg[] = "support for dynamic loading not implemented";
+  return errmsg;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAVE_DL */
Index: libpolys/polys/templates/mod_raw.h
===================================================================
--- libpolys/polys/templates/mod_raw.h	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
+++ libpolys/polys/templates/mod_raw.h	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -0,0 +1,42 @@
+#ifndef MOD_RAW_H
+#define MOD_RAW_H
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/* $Id$ */
+/*
+ * ABSTRACT: machine depend code for dynamic modules
+ *
+ * Provides: dynl_open()
+ *           dynl_sym()
+ *           dynl_error()
+ *           dunl_close()
+*/
+
+typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O} lib_types;
+
+lib_types type_of_LIB(char *newlib, char *fullname);
+
+#if defined(HAVE_DL)
+#ifdef __cplusplus
+void* dynl_open_binary_warn(const char* binary_name, const char* msg = NULL );
+void* dynl_sym_warn(void* handle, const char* proc, const char* msg = NULL );
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void *       dynl_open(char *filename);
+// if handle == DYNL_KERNEL_HANDLE, then symbol is searched for
+// in kernel of program
+#define DYNL_KERNEL_HANDLE ((void*) 0x1)
+void *       dynl_sym(void *handle, const char *symbol);
+int          dynl_close (void *handle);
+const char * dynl_error();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAVE_DL */
+#endif /* MOD_RAW_H */
Index: libpolys/polys/templates/p_Procs_Dynamic.cc
===================================================================
--- libpolys/polys/templates/p_Procs_Dynamic.cc	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/polys/templates/p_Procs_Dynamic.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -30,10 +30,12 @@
 #define LINKAGE extern "C"
 #define p_Procs_Kernel
-#include "p_Procs.inc"
-
-#include <polys/p_Procs_Dynamic.h>
+
+#include "templates/p_Procs.inc"
+
+#include "templates/p_Procs_Dynamic.h"
 // include general p_Proc stuff
-#include <polys/p_Procs_Impl.h>
-#include <polys/mod_raw.h>
+#include "templates/p_Procs_Impl.h"
+
+#include "templates/mod_raw.h"
 
 // define to bound for length of p_Proc name
Index: libpolys/resources/feFopen.cc
===================================================================
--- libpolys/resources/feFopen.cc	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/resources/feFopen.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -12,6 +12,6 @@
 #include <reporter/reporter.h>
 
-#include <resources/feFopen.h>
-#include <resources/feResource.h>
+#include "feFopen.h"
+#include "feResource.h"
 
 
Index: libpolys/resources/feResource.cc
===================================================================
--- libpolys/resources/feResource.cc	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/resources/feResource.cc	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -153,12 +153,12 @@
 }
 
+char* feResource(const char id, int warn)
+{
+  return feResource(feGetResourceConfig(id), warn);
+}
+
 char* feGetResource(const char id)
 {
   return feResource(feGetResourceConfig(id), -1);
-}
-
-char* feResource(const char id, int warn)
-{
-  return feResource(feGetResourceConfig(id), warn);
 }
 
Index: libpolys/resources/feResource.h
===================================================================
--- libpolys/resources/feResource.h	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/resources/feResource.h	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -6,6 +6,13 @@
 #endif
 
+#include <omalloc/mylimits.h>
+
 #define DIR_SEP '/'
 #define DIR_SEPP "/"
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
 
 /*****************************************************************
@@ -21,4 +28,11 @@
 char* feResource(const char id, int warn = -1);
 char* feResource(const char* key, int warn = -1);
+
+char* feGetResource(const char id);
+
+// char* feResourceDefault(const char id);
+// char* feResourceDefault(const char* key);
+
+
 // This needs to be called before the first call to feResource
 // Initializes Resources, SearchPath, and extends PATH
@@ -28,4 +42,5 @@
 // Prints resources into string with StringAppend, etc
 void feStringAppendResources(int warn = -1);
+
 
 
Index: libpolys/tests/polys_test.h
===================================================================
--- libpolys/tests/polys_test.h	(revision e1761c4c3c661c1550c448e992db9c52e345ed63)
+++ libpolys/tests/polys_test.h	(revision 8c99125adf3766ea3c93c4198e3f4aeed1b29b5f)
@@ -32,5 +32,5 @@
 #endif
      
-     rKill(r);
+     rDelete(r);
    }
 };
