[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:54:14 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit 17ba225267dad4e7de73e7b223ddb9f47c3f14e0
Author: Hans Schoenemann <hannes at mathematik.uni-kl.de>
Date: Thu Mar 22 14:14:50 2012 +0100
fix: module_help_proc/module_help_main
add: very trivial example for modules
fix: HAVE_FEREAD handling for x86_64-Linux
diff --git a/Singular/iplib.cc b/Singular/iplib.cc
index ac63631..850ee80 100644
--- a/Singular/iplib.cc
+++ b/Singular/iplib.cc
@@ -1168,7 +1168,7 @@ BOOLEAN load_builtin(char *newlib, BOOLEAN autoexport, SModulFunc_t init)
void module_help_main(char *newlib,const char *help)
{
char *plib = iiConvName(newlib);
- idhdl pl = IDROOT->get(plib,0);
+ idhdl pl = basePack->idroot->get(plib,0); /* always start at Top level */
if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
Werror(">>%s<< is not a package",plib);
else
@@ -1183,7 +1183,7 @@ void module_help_main(char *newlib,const char *help)
void module_help_proc(char *newlib,const char *p, const char *help)
{
char *plib = iiConvName(newlib);
- idhdl pl = IDROOT->get(plib,0);
+ idhdl pl = basePack->idroot->get(plib,0);
if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
Werror(">>%s<< is not a package",plib);
else
diff --git a/calldummy/Makefile b/calldummy/Makefile
new file mode 100755
index 0000000..aa9d5df
--- /dev/null
+++ b/calldummy/Makefile
@@ -0,0 +1,14 @@
+CFLAGS += -march=native -DOM_NDEBUG -DNDEBUG -O3 -fPIC
+CXX = g++ -m32
+
+all: dummy
+
+dummy:
+ ${CXX} -o dummy.o -I. ${CFLAGS} -I../ -c dummy.cc
+ ${CXX} -shared -o dummy.so ${LDFLAGS} dummy.o
+ cp dummy.so ../Singular/dummy.so
+
+clean:
+ rm *.so *.o
+ rm ../Singular/dummy.so
+
diff --git a/calldummy/dummy.cc b/calldummy/dummy.cc
new file mode 100755
index 0000000..075fc34
--- /dev/null
+++ b/calldummy/dummy.cc
@@ -0,0 +1,31 @@
+#include <kernel/mod2.h>
+#include <kernel/structs.h>
+#include <kernel/febase.h>
+
+#include <Singular/ipid.h>
+#include <Singular/ipshell.h>
+#include <Singular/subexpr.h>
+#include <Singular/tok.h>
+
+
+BOOLEAN writeHUHU(leftv res, leftv arg)
+{
+ res->rtyp=NONE;
+ if (arg->Typ()==STRING_CMD)
+ {
+ Print("Hello %s\n",(char *)(arg->Data()));
+ return FALSE;
+ }
+ else
+ return TRUE;
+}
+extern "C" int mod_init(void* polymakesingular)
+{
+
+ iiAddCproc("dummy.so","hello",FALSE,writeHUHU);
+ module_help_main("dummy.so","Help for dummy.so\n"
+ "Provide an example for documenting dynamic modules\n");
+ module_help_proc("dummy.so","hello","say hello to the <arg>");
+
+ return 0;
+}
diff --git a/kernel/febase.h b/kernel/febase.h
index b40248b..35cad48 100644
--- a/kernel/febase.h
+++ b/kernel/febase.h
@@ -54,10 +54,12 @@ extern "C"
#define HAVE_FEREAD 1
#elif ! defined(HAVE_READLINE)
#ifndef ix86_Win
+#ifdef HAVE_TERM_H
#define HAVE_FEREAD 1
#endif
#endif
-#ifdef ix86_Linux
+#endif
+#if defined(ix86_Linux) || defined(x86_64_Linux)
// FEREAD stuff does not work with glibc2
#undef HAVE_FEREAD
#endif
diff --git a/kernel/feread.cc b/kernel/feread.cc
index cf43c85..6d1bc69 100644
--- a/kernel/feread.cc
+++ b/kernel/feread.cc
@@ -27,11 +27,6 @@
#undef HAVE_DYN_RL
#endif
-#ifdef ix86_Linux
-#undef HAVE_FEREAD
-// not compatible with glibc2
-#endif
-
#if defined(HAVE_DYN_RL)
#include <unistd.h>
#endif
--
an open source computer algebra system
More information about the debian-science-commits
mailing list