Index: Singular/Makefile.in
===================================================================
--- Singular/Makefile.in	(revision 9072740e999bc6ac0bac667d5cf795b18fe7f539)
+++ Singular/Makefile.in	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
@@ -82,5 +82,5 @@
     mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \
     mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \
-    ndbm.cc spSpolyLoop.cc libparse.cc mod-${SINGUNAME}.cc\
+    ndbm.cc spSpolyLoop.cc libparse.cc mod_raw.cc\
 	pcv.cc
 
@@ -103,5 +103,5 @@
 	kutil.h mpsr_Put.h spolys0.h sing_dld.h\
 	ndbm.h spSpolyLoop.h polys-impl.h polys-comp.h getopt.h libparse.h \
-	pcv.h
+	pcv.h mod_raw.h
 
 INCS=febase.inc polys.inc iparith.inc mpsr_Tok.inc spSpolyLoop.inc
@@ -130,5 +130,5 @@
      mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \
      mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o libparse.o \
-     find_exec.o getopt.o fereadl.o  mod-${SINGUNAME}.o \
+     find_exec.o getopt.o fereadl.o  mod_raw.o \
 	pcv.o
 
@@ -346,5 +346,5 @@
      mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \
      mpsr_Get.og mpsr_GetMisc.og \
-     ndbm.og spSpolyLoop.og libparse.og  mod-${SINGUNAME}.og \
+     ndbm.og spSpolyLoop.og libparse.og  mod_raw.og \
 	pcv.og
 
@@ -422,5 +422,5 @@
      mpsr_Error.op mpsr_Put.op mpsr_PutPoly.op mpsr_GetPoly.op \
      mpsr_Get.op mpsr_GetMisc.op \
-     ndbm.op spSpolyLoop.op libparse.op  mod-${SINGUNAME}.op \
+     ndbm.op spSpolyLoop.op libparse.op  mod_raw.op \
 	pcv.op
 
@@ -448,5 +448,5 @@
      mpsr_Error.ob mpsr_Put.ob mpsr_PutPoly.ob mpsr_GetPoly.ob \
      mpsr_Get.ob mpsr_GetMisc.ob \
-     ndbm.ob spSpolyLoop.ob libparse.ob mod-${SINGUNAME}.ob \
+     ndbm.ob spSpolyLoop.ob libparse.ob mod_raw.ob \
 	pcv.ob
 
Index: Singular/iplib.cc
===================================================================
--- Singular/iplib.cc	(revision 9072740e999bc6ac0bac667d5cf795b18fe7f539)
+++ Singular/iplib.cc	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: iplib.cc,v 1.52 1999-03-16 15:33:14 Singular Exp $ */
+/* $Id: iplib.cc,v 1.53 1999-04-01 10:09:58 krueger Exp $ */
 /*
 * ABSTRACT: interpreter: LIB and help
@@ -32,10 +32,5 @@
 #define NS_LRING namespaceroot->next->currRing
 
-#ifdef HAVE_DYNAMIC_LOADING
-void *dynl_open(char *filename);
-void *dynl_sym(void *handle, char *symbol);
-int dynl_close (void *handle);
-char *dynl_error();
-#endif /* HAVE_DYNAMIC_LOADING */
+#include "mod_raw.h"
 
 char *iiConvName(char *p);
@@ -1172,5 +1167,5 @@
     goto lib_type_end;
   }
-  if( (strncmp(buf, "\02\013\01\016\05\022@", 7)==0)) {
+  if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0)) {
     LT = LT_HPUX;
     FreeL(newlib);
Index: Singular/mod_raw.cc
===================================================================
--- Singular/mod_raw.cc	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
+++ Singular/mod_raw.cc	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
@@ -0,0 +1,292 @@
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/* $Id: mod_raw.cc,v 1.1 1999-04-01 10:10:08 krueger Exp $ */
+/*
+ * ABSTRACT: machine depend code for dynamic modules
+ *
+ * Provides: dynl_open()
+ *           dynl_sym()
+ *           dynl_error()
+ *           dunl_close()
+*/
+
+#include "mod2.h"
+#ifdef HAVE_DYNAMIC_LOADING
+#include "mod_raw.h"
+
+
+/*****************************************************************************
+ * SECTION ix86-linux                                                        *
+ *****************************************************************************/
+#  ifdef ix86_Linux
+#    include <dlfcn.h>
+
+void *dynl_open(
+  char *filename    /* I: filename to load */
+  )
+{
+  return(dlopen(filename, RTLD_GLOBAL));
+}
+
+void *dynl_sym(void *handle, char *symbol)
+{
+  return(dlsym(handle, symbol));
+}
+
+int dynl_close (void *handle)
+{
+  return(dlclose (handle));
+}
+
+const char *dynl_error()
+{
+  return(dlerror());
+}
+#  endif /* ix86_Linux */
+
+/*****************************************************************************
+ * 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, char *symbol)
+{
+  func_ptr        f;
+
+  if (shl_findsym((shl_t *) & handle, symbol, TYPE_PROCEDURE, &f) == -1)
+  {
+    f = (func_ptr) NULL;
+  }
+  return (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 68k-MPW                                                           *
+ *****************************************************************************/
+#  ifdef 68k_MPW
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* 68k_MPW */
+
+
+/*****************************************************************************
+ * SECTION AIX-4                                                             *
+ *****************************************************************************/
+#  ifdef AIX_4
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* AIX_4 */
+
+/*****************************************************************************
+ * SECTION IRIX-6                                                            *
+ *****************************************************************************/
+#  ifdef IRIX_6
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* IRIX_6 */
+
+/*****************************************************************************
+ * SECTION Sun3OS-4                                                          *
+ *****************************************************************************/
+#  ifdef Sun3OS_4
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* Sun3OS_4 */
+
+/*****************************************************************************
+ * SECTION SunOS-4/5                                                         *
+ *****************************************************************************/
+#  if defined(SunOS_4) || defined(SunOS_5)
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* SunOS_4 or SunOS_5 */
+
+/*****************************************************************************
+ * SECTION ix86-win                                                          *
+ *****************************************************************************/
+#  ifdef ix86_win
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* ix86_win */
+
+/*****************************************************************************
+ * SECTION ppc-MPW                                                           *
+ *****************************************************************************/
+#  ifdef ppc_MPW
+/* #    include <> */
+
+void *dynl_open(char *filename)
+{
+  return(NULL);
+}
+
+void *dynl_sym(void *handle, 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 /* ppc_MPW */
+
+
+#endif /* HAVE_DYNAMIC_LOADING */
Index: Singular/mod_raw.h
===================================================================
--- Singular/mod_raw.h	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
+++ Singular/mod_raw.h	(revision 69a9545fbd087159a4c37f2ece16874e05f78de2)
@@ -0,0 +1,26 @@
+/****************************************
+*  Computer Algebra System SINGULAR     *
+****************************************/
+/* $Id: mod_raw.h,v 1.1 1999-04-01 10:10:08 krueger Exp $ */
+/*
+ * ABSTRACT: machine depend code for dynamic modules
+ *
+ * Provides: dynl_open()
+ *           dynl_sym()
+ *           dynl_error()
+ *           dunl_close()
+*/
+
+#ifndef MOD_RAW_H
+#  define MOD_RAW_H
+#  include "mod2.h"
+#  ifdef HAVE_DYNAMIC_LOADING
+
+void *dynl_open(char *filename);
+void *dynl_sym(void *handle, char *symbol);
+int dynl_close (void *handle);
+const char *dynl_error();
+
+
+#  endif /* HAVE_DYNAMIC_LOADING */
+#endif /* MOD_RAW_H */
