Changeset 51f563 in git
- Timestamp:
- Dec 6, 2012, 3:52:36 PM (11 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 7e18d198148353f88708cfa20f738ac338cb1f55
- Parents:
- 35a0c12b6003b7ecc3cca7a1072c5f0d145a1829
- git-author:
- Alexander Dreyer <adreyer@gmx.de>2012-12-06 15:52:36+01:00
- git-committer:
- Alexander Dreyer <adreyer@gmx.de>2012-12-06 16:20:28+01:00
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/pyobject.cc
r35a0c12 r51f563 714 714 715 715 716 void pyobject_init() 716 #define PYOBJECT_ADD_C_PROC(name) \ 717 add_C_proc(currPack->libname, (char*)#name, FALSE, name); 718 719 typedef BOOLEAN (*func_type)(leftv, leftv); 720 void pyobject_init(int (*add_C_proc)(const char*, const char*, BOOLEAN, 721 func_type) ) 717 722 { 718 723 int tok = -1; … … 732 737 733 738 PythonInterpreter::init(tok); 734 } 735 } 736 737 #define PYOBJECT_ADD_C_PROC(name) \ 738 psModulFunctions->iiAddCproc(currPack->libname, (char*)#name, FALSE, name); 739 739 740 PYOBJECT_ADD_C_PROC(python_import); 741 PYOBJECT_ADD_C_PROC(python_eval); 742 PYOBJECT_ADD_C_PROC(python_run); 743 } 744 } 745 #undef PYOBJECT_ADD_C_PROC 746 747 #ifndef EMBED_PYTHON 740 748 extern "C" { 741 749 void mod_init(SModulFunctions* psModulFunctions) 742 750 { 743 pyobject_init(); 744 745 PYOBJECT_ADD_C_PROC(python_import); 746 PYOBJECT_ADD_C_PROC(python_eval); 747 PYOBJECT_ADD_C_PROC(python_run); 748 } 749 } 750 #undef PYOBJECT_ADD_C_PROC 751 pyobject_init(psModulFunctions->iiAddCproc); 752 } 753 } 754 #endif -
Singular/pyobject_setup.cc
r35a0c12 r51f563 20 20 21 21 /* whether pyobject module is linked statically or dynamically */ 22 23 #ifdef EMBED_PYTHON // Case: we include the pyobject interface in the binary 24 22 25 #ifdef HAVE_PYTHON 26 #include "pyobject.cc" 27 static BOOLEAN pyobject_load() 28 { 29 pyobject_init(iiAddCproc); 30 return FALSE; 31 } 23 32 24 #if defined(HAVE_STATIC) 25 #ifdef HAVE_STATIC_PYTHON 26 #define HAVE_STATIC_PYOBJECT 27 #endif 28 #else 29 #ifdef EMBED_PYTHON 30 #define HAVE_STATIC_PYOBJECT 31 #else 32 #define HAVE_DYNAMIC_PYOBJECT 33 #endif 34 #endif 33 #else // Forced embedding, but no (development version of) python available! 34 static BOOLEAN pyobject_load() { return TRUE; } 35 35 #endif 36 36 37 # ifdef HAVE_STATIC_PYOBJECT // Case: link pyobject interface statically38 #include "pyobject.cc"39 void pyobject_setup() { pyobject_init(); }40 37 38 # else // Case: pyobject may be loaded from a dynamic module (prefered variant) 39 // Note: we do not need python at compile time. 40 static BOOLEAN pyobject_load() 41 { 42 BOOLEAN jjLOADLIB(const char* libname, BOOLEAN autoexport); 43 return jjLOADLIB("pyobject.so", TRUE); 44 } 45 #endif 41 46 42 # elif defined(HAVE_DYNAMIC_PYOBJECT) // Case: pyobject is dynamic module (prefered variant)43 47 44 48 … … 46 50 void* pyobject_autoload(blackbox* bbx) 47 51 { 48 BOOLEAN jjLOADLIB(const char* libname, BOOLEAN autoexport); 49 if (jjLOADLIB("pyobject.so", TRUE)) return NULL; 50 52 if (pyobject_load()) return NULL; 51 53 return bbx->blackbox_Init(bbx); 52 54 } … … 65 67 setBlackboxStuff(bbx, "pyobject"); 66 68 } 67 68 #else // Case: no python69 void pyobject_setup() { }70 69 71 #endif // HAVE_PYTHON72 -
configure.ac
r35a0c12 r51f563 61 61 LB_CHECK_FLINT(2.3,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)])) 62 62 63 AX_PYTHON_ENABLE() 63 64 AX_PYTHON_WITH() 64 65 AX_PYTHON_VERSION_ENSURE( [2.4] )
Note: See TracChangeset
for help on using the changeset viewer.