Changeset 1d6ec3 in git
- Timestamp:
- Dec 17, 2012, 5:58:15 PM (10 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 2cdd72c35095d3ff171783d5f5a677d4f6658c96
- Parents:
- f51a5bd5a84a0bdc21e8b4b7357a3d1f43bae4e6f4399e865a8d7da06b4d0e0a3d19e4c3acc2d8dc
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.am
rf51a5b r1d6ec3 16 16 CXXTEMPLFLAGS =-ftrapv ## -fno-implicit-templates 17 17 18 AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS) $(FLINT_CFLAGS) 18 AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS) $(FLINT_CFLAGS) ${EMBED_PYOBJECT_CFLAGS} 19 19 20 20 ########################### libSingular* ######################### … … 222 222 Singularg_SOURCES = tesths.cc fegetopt.c fegetopt.h utils.cc utils.h 223 223 224 Singular_LDADD = libSingular.la ${top_builddir}/numeric/libnumeric.la ${top_builddir}/kernel/libkernel.la ${top_builddir}/libpolys/polys/libpolys.la -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 225 Singularg_LDADD = libSingular_g.la ${top_builddir}/numeric/libnumeric_g.la ${top_builddir}/kernel/libkernel_g.la ${top_builddir}/libpolys/polys/libpolys_g.la -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 224 Singular_LDADD = libSingular.la ${top_builddir}/numeric/libnumeric.la ${top_builddir}/kernel/libkernel.la ${top_builddir}/libpolys/polys/libpolys.la -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 225 Singularg_LDADD = libSingular_g.la ${top_builddir}/numeric/libnumeric_g.la ${top_builddir}/kernel/libkernel_g.la ${top_builddir}/libpolys/polys/libpolys_g.la -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 226 226 227 227 Singular_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG … … 244 244 nodist_Singulardg_SOURCES = libSingular_g.la 245 245 246 Singulard_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 247 Singulardg_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 246 Singulard_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 247 Singulardg_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 248 248 249 249 Singulard_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG … … 332 332 test_s_g_SOURCES = test.cc 333 333 334 test_s_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 335 test_s_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 334 test_s_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 335 test_s_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 336 336 337 337 test_s_r_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG … … 353 353 test_d_g_SOURCES = test.cc 354 354 355 test_d_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 356 test_d_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 355 test_d_r_LDADD = libSingular.la -lnumeric -lkernel -lpolys -lcoeffs -lreporter -lmisc $(FACTORY_LIBS) -lomalloc -lfindexec $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 356 test_d_g_LDADD = libSingular_g.la -lnumeric_g -lkernel_g -lpolys_g -lcoeffs_g -lreporter_g -lmisc_g $(FACTORY_LIBS) -lomalloc_g -lfindexec_g $(FLINT_LIBS) $(NTL_LIBS) $(GMP_LIBS) ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT_LDFLAGS} 357 357 358 358 test_d_r_CPPFLAGS = ${AM_CPPFLAGS} -DHAVE_CONFIG_H -DNDEBUG -DOM_NDEBUG … … 392 392 ln -snf ${top_builddir}/libpolys/polys/.libs/ ${builddir}/MOD 393 393 394 if PYTHON_ USE394 if PYTHON_MODULE 395 395 moduledir = $(bindir)/MOD 396 396 module_LTLIBRARIES = pyobject.la -
Singular/extra.cc
rf51a5b r1d6ec3 2948 2948 res->rtyp = NONE; 2949 2949 return FALSE; 2950 }2951 else2952 2953 /*==== pyobject (or pyobject*, like pyobject.so) force loading python ===*/2954 if (strncmp(sys_cmd, "pyobject", 8) == 0)2955 {2956 res->rtyp = NONE;2957 return pyobject_ensure();2958 2950 } 2959 2951 else -
Singular/iparith.cc
rf51a5b r1d6ec3 5155 5155 char libnamebuf[256]; 5156 5156 lib_types LT = type_of_LIB(s, libnamebuf); 5157 5157 5158 #ifdef HAVE_DYNAMIC_LOADING 5158 5159 extern BOOLEAN load_modules(char *newlib, char *fullpath, BOOLEAN autoexport); … … 5194 5195 return bo; 5195 5196 } 5197 case LT_BUILTIN: 5198 SModulFunc_t iiGetBuiltinModInit(char*); 5199 return load_builtin(s,autoexport, iiGetBuiltinModInit(s)); 5196 5200 case LT_MACH_O: 5197 5201 case LT_ELF: -
Singular/ipid.h
rf51a5b r1d6ec3 79 79 80 80 extern idhdl currRingHdl; 81 /* ================================================================== */ 82 /* module support */ 83 typedef int (*SModulFunc_t)(SModulFunctions*); 84 BOOLEAN load_builtin(char *newlib, BOOLEAN autoexport, SModulFunc_t init); 85 void module_help_main(char *newlib,const char *help); 86 void module_help_proc(char *newlib,const char *p, const char *help); 87 88 /* ================================================================== */ 89 81 90 /*extern ring currRing; in ring.h */ 82 91 /*extern ideal currQuotient; in structs.h */ -
Singular/iplib.cc
rf51a5b r1d6ec3 672 672 } 673 673 674 int huhu_mod_init(SModulFunctions*){ return 0; } 675 676 #define SI_GET_BUILTIN_MOD_INIT(name) \ 677 int name##_mod_init(SModulFunctions*); \ 678 if (strcmp(libname, #name ".so") == 0) { return name##_mod_init; } 679 680 681 SModulFunc_t 682 iiGetBuiltinModInit(char* libname) 683 { 684 SI_FOREACH_BUILTIN(SI_GET_BUILTIN_MOD_INIT) 685 686 return NULL; 687 } 688 689 690 #undef SI_GET_BUILTIN_MOD_INIT 691 692 674 693 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 675 694 BOOLEAN iiTryLoadLib(leftv v, const char *id) … … 684 703 idhdl packhdl; 685 704 lib_types LT; 686 687 705 for(i=0; suffix[i] != NULL; i++) 688 706 { … … 700 718 LoadResult = load_modules(s,libnamebuf,FALSE); 701 719 #endif 720 else if (LT==LT_BUILTIN) 721 { 722 LoadResult=load_builtin(s,FALSE, iiGetBuiltinModInit(s)); 723 } 702 724 if(!LoadResult ) 703 725 { … … 1022 1044 BOOLEAN pstatic, 1023 1045 BOOLEAN(*func)(leftv res, leftv v))); 1024 typedef int (*fktn2_t)(SModulFunctions*); 1025 fktn2_t fktn; 1046 SModulFunc_t fktn; 1026 1047 idhdl pl; 1027 1048 char *plib = iiConvName(newlib); … … 1058 1079 } 1059 1080 } 1081 if (dynl_check_opened(FullName)) { 1082 if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded", fullname); 1083 return FALSE; 1084 } 1060 1085 if((IDPACKAGE(pl)->handle=dynl_open(FullName))==(void *)NULL) 1061 1086 { … … 1070 1095 package s=currPack; 1071 1096 currPack=IDPACKAGE(pl); 1072 fktn = ( fktn2_t)dynl_sym(IDPACKAGE(pl)->handle, "mod_init");1097 fktn = (SModulFunc_t)dynl_sym(IDPACKAGE(pl)->handle, "mod_init"); 1073 1098 if( fktn!= NULL) 1074 1099 { … … 1089 1114 #endif /*STATIC */ 1090 1115 } 1116 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 1117 BOOLEAN load_builtin(char *newlib, BOOLEAN autoexport, SModulFunc_t init) 1118 { 1119 int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, 1120 BOOLEAN(*func)(leftv res, leftv v)); 1121 typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname, 1122 BOOLEAN pstatic, 1123 BOOLEAN(*func)(leftv res, leftv v))); 1124 SModulFunc_t fktn; 1125 idhdl pl; 1126 char *plib = iiConvName(newlib); 1127 BOOLEAN RET=TRUE; 1128 int token; 1129 1130 pl = IDROOT->get(plib,0); 1131 if (pl!=NULL) 1132 { 1133 if (BVERBOSE(V_LOAD_LIB)) Warn( "(builtin) %s already loaded", newlib); 1134 omFree(plib); 1135 return FALSE; 1136 } 1137 1138 pl = enterid( plib,0, PACKAGE_CMD, &IDROOT, 1139 TRUE ); 1140 IDPACKAGE(pl)->language = LANG_C; 1141 IDPACKAGE(pl)->libname=omStrDup(newlib); 1142 1143 IDPACKAGE(pl)->handle=(void *)NULL; 1144 SModulFunctions sModulFunctions; 1145 1146 package s=currPack; 1147 currPack=IDPACKAGE(pl); 1148 if( init!= NULL) 1149 { 1150 sModulFunctions.iiArithAddCmd = iiArithAddCmd; 1151 if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop; 1152 else sModulFunctions.iiAddCproc = iiAddCproc; 1153 (*init)(&sModulFunctions); 1154 } 1155 if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded (builtin) %s \n", newlib); 1156 currPack->loaded=1; 1157 currPack=s; 1158 1159 return FALSE; 1160 } 1161 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 1162 void module_help_main(char *newlib,const char *help) 1163 { 1164 char *plib = iiConvName(newlib); 1165 idhdl pl = IDROOT->get(plib,0); 1166 if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD)) 1167 Werror(">>%s<< is not a package",plib); 1168 else 1169 { 1170 package s=currPack; 1171 currPack=IDPACKAGE(pl); 1172 idhdl h=enterid(omStrDup("info"),0,STRING_CMD,&IDROOT,FALSE); 1173 IDSTRING(h)=omStrDup(help); 1174 currPack=s; 1175 } 1176 } 1177 void module_help_proc(char *newlib,const char *p, const char *help) 1178 { 1179 char *plib = iiConvName(newlib); 1180 idhdl pl = IDROOT->get(plib,0); 1181 if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD)) 1182 Werror(">>%s<< is not a package",plib); 1183 else 1184 { 1185 package s=currPack; 1186 currPack=IDPACKAGE(pl); 1187 char buff[256]; 1188 buff[255]='\0'; 1189 strncpy(buff,p,255); 1190 strncat(buff,"_help",255-strlen(p)); 1191 idhdl h=enterid(omStrDup(buff),0,STRING_CMD,&IDROOT,FALSE); 1192 IDSTRING(h)=omStrDup(help); 1193 currPack=s; 1194 } 1195 } 1196 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 1091 1197 1092 1198 // loads a dynamic module from the binary path and returns a named function -
Singular/pyobject.cc
rf51a5b r1d6ec3 413 413 size_t size(leftv iter, size_t distance = 0) const 414 414 { 415 if (iter) { do { ++distance; } while( iter = iter->next); };415 if (iter) { do { ++distance; } while((iter = iter->next)); }; 416 416 return distance; 417 417 } … … 463 463 sync_contexts(); 464 464 465 Py_ XINCREF(Py_None);465 Py_INCREF(Py_None); 466 466 return PythonCastStatic<>(Py_None).assign_to(result); 467 467 } … … 496 496 sync_contexts(); 497 497 498 Py_ XINCREF(Py_None);498 Py_INCREF(Py_None); 499 499 return PythonCastStatic<>(Py_None).assign_to(result); 500 500 } … … 503 503 void* pyobject_Init(blackbox*) 504 504 { 505 Py_ XINCREF(Py_None);505 Py_INCREF(Py_None); 506 506 return Py_None; 507 507 } … … 715 715 716 716 #define PYOBJECT_ADD_C_PROC(name) \ 717 add_C_proc((currPack->libname? 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 psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""),\ 718 (char*)#name, FALSE, name); 719 720 int pyobject_mod_init(SModulFunctions* psModulFunctions) 722 721 { 723 722 int tok = -1; … … 734 733 bbx->blackbox_Op3 = pyobject_Op3; 735 734 bbx->blackbox_OpM = pyobject_OpM; 736 bbx->data = omAlloc0(newstruct_desc_size());735 bbx->data = (void*)omAlloc0(newstruct_desc_size()); 737 736 738 737 PythonInterpreter::init(tok); … … 742 741 PYOBJECT_ADD_C_PROC(python_run); 743 742 } 743 return 0; 744 744 } 745 745 #undef PYOBJECT_ADD_C_PROC … … 747 747 #ifndef EMBED_PYTHON 748 748 extern "C" { 749 voidmod_init(SModulFunctions* psModulFunctions)749 int mod_init(SModulFunctions* psModulFunctions) 750 750 { 751 pyobject_init(psModulFunctions->iiAddCproc);751 return pyobject_mod_init(psModulFunctions); 752 752 } 753 753 } -
Singular/pyobject_setup.cc
rf51a5b r1d6ec3 19 19 #include <Singular/ipshell.h> 20 20 21 /* whether pyobject module is linked statically or dynamically */ 22 23 #ifdef EMBED_PYTHON // Case: we include the pyobject interface in the binary 24 25 #ifdef HAVE_PYTHON 21 #ifdef EMBED_PYTHON 26 22 #include "pyobject.cc" 27 static BOOLEAN pyobject_load()28 {29 pyobject_init(iiAddCproc);30 return FALSE;31 }32 33 #else // Forced embedding, but no (development version of) python available!34 static BOOLEAN pyobject_load() { return TRUE; }35 23 #endif 36 24 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 25 static BOOLEAN pyobject_load() 41 26 { 42 27 return jjLOAD("pyobject.so", TRUE); 43 28 } 44 #endif45 46 47 29 48 30 /// blackbox support - initialization via autoloading -
Singular/tesths.cc
rf51a5b r1d6ec3 181 181 errorreported = 0; 182 182 183 // -- example for "static" modules ------ 184 //load_builtin("huhu.so",FALSE,(SModulFunc_t)huhu_mod_init); 185 //module_help_main("huhu.so","Help for huhu\nhaha\n"); 186 //module_help_proc("huhu.so","p","Help for huhu::p\nhaha\n"); 183 187 setjmp(si_start_jmpbuf); 184 188 -
libpolys/configure.ac
rf51a5b r1d6ec3 132 132 AC_DEFINE([NOSTREAMIO],[1],[DISABLE_GMP_CPP]) 133 133 134 AX_PYTHON_DEFAULT() 135 AX_PYTHON_WITH_VERSION([2.4]) 136 134 137 ## AC_DEFINE([HAVE_POLYEXTENSIONS], [1], [Enable the algebraic & transcendental extensions]) 135 138 -
libpolys/polys/mod_raw.cc
rf51a5b r1d6ec3 5 5 * ABSTRACT: machine depend code for dynamic modules 6 6 * 7 * Provides: dynl_open() 7 * Provides: dynl_check_opened() 8 * dynl_open() 8 9 * dynl_sym() 9 10 * dynl_error() … … 33 34 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 34 35 #define BYTES_TO_CHECK 7 36 37 #define SI_BUILTIN_LIBSTR(name) (char*) #name ".so", 38 39 char* si_bultin_libs[]={ SI_FOREACH_BUILTIN(SI_BUILTIN_LIBSTR) NULL }; 40 41 #undef SI_BUILTIN_LIBSTR 35 42 36 43 lib_types type_of_LIB(char *newlib, char *libnamebuf) … … 42 49 const unsigned char mach_O64[]={0xcf,0xfa,0xed,0xfe,0}; 43 50 51 int i=0; 52 while(si_bultin_libs[i]!=NULL) 53 { 54 if (strcmp(newlib,si_bultin_libs[i])==0) 55 { 56 if(libnamebuf!=NULL) strcpy(libnamebuf,newlib); 57 return LT_BUILTIN; 58 } 59 i++; 60 } 44 61 char buf[BYTES_TO_CHECK+1]; /* one extra for terminating '\0' */ 45 62 struct stat sb; … … 93 110 goto lib_type_end; 94 111 } 95 112 113 96 114 if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0)) 97 115 { … … 207 225 #endif 208 226 209 #if defined(__APPLE__) && defined(__MACH__) 227 #if defined(ix86Mac_darwin) 228 #define HAVE_ELF_SYSTEM 229 #endif 230 231 #if defined(x86_64Mac_darwin) 210 232 #define HAVE_ELF_SYSTEM 211 233 #endif … … 220 242 221 243 static void* kernel_handle = NULL; 244 int dynl_check_opened( 245 char *filename /* I: filename to check */ 246 ) 247 { 248 return dlopen(filename,RTLD_NOW|RTLD_NOLOAD) != NULL; 249 } 250 222 251 void *dynl_open( 223 252 char *filename /* I: filename to load */ … … 265 294 typedef char *((*func_ptr) ()); 266 295 296 int dynl_check_opened( /* NOTE: untested */ 297 char *filename /* I: filename to check */ 298 ) 299 { 300 struct shl_descriptor *desc; 301 for (int idx = 0; shl_get(idx, &desc) != -1; ++idx) 302 { 303 if (strcmp(filename, desc->filename) == 0) return TRUE; 304 } 305 return FALSE; 306 } 307 267 308 void *dynl_open(char *filename) 268 309 { … … 308 349 #ifndef DL_IMPLEMENTED 309 350 351 int dynl_check_opened(char *filename) 352 { 353 return FALSE; 354 } 355 310 356 void *dynl_open(char *filename) 311 357 { -
libpolys/polys/mod_raw.h
rf51a5b r1d6ec3 1 1 2 #ifndef MOD_RAW_H 2 3 #define MOD_RAW_H … … 7 8 * ABSTRACT: machine depend code for dynamic modules 8 9 * 9 * Provides: dynl_open() 10 * Provides: dynl_check_opened() 11 * dynl_open() 10 12 * dynl_sym() 11 13 * dynl_error() … … 13 15 */ 14 16 15 typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O } lib_types;17 typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O, LT_BUILTIN} lib_types; 16 18 17 19 lib_types type_of_LIB(char *newlib, char *fullname); … … 26 28 extern "C" { 27 29 #endif 30 int dynl_check_opened(char* filename); 28 31 void * dynl_open(char *filename); 29 32 // if handle == DYNL_KERNEL_HANDLE, then symbol is searched for … … 39 42 40 43 #endif /* HAVE_DL */ 44 45 46 #ifdef EMBED_PYTHON 47 #define SI_BUILTIN_PYOBJECT(add) add(pyobject) 48 #else 49 #define SI_BUILTIN_PYOBJECT(add) 50 #endif 51 52 /// Data for @c type_of_LIB to determine built-in modules, 53 /// use @c add(name) to add built-in library to macro 54 #define SI_FOREACH_BUILTIN(add)\ 55 add(huhu)\ 56 SI_BUILTIN_PYOBJECT(add) 57 58 41 59 #endif /* MOD_RAW_H */ -
m4/ax_python_with_version.m4
rf51a5b r1d6ec3 28 28 AC_ARG_WITH( 29 29 python, 30 AS_HELP_STRING([--with-python@<:@= PYTHON@:>@],30 AS_HELP_STRING([--with-python@<:@=@<:@embed,@:>@PYTHON@:>@], 31 31 [absolute path name of Python executable] 32 32 ), 33 33 [],[withval="yes"] 34 34 ) 35 py_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," 36 for elt in $withval; do 37 IFS="$py_save_ifs" 38 case $elt in 39 embed|embedding) 40 si_try_embed=true 41 ;; 42 static|dynamic|shared|module) 43 ;; 44 *) 45 si_withval=$elt 46 esac 47 done 48 IFS="$py_save_ifs" 49 if test x"$si_withval" = x"" 50 then 51 withval="yes" 52 else 53 withval="$si_withval" 54 fi 55 35 56 AC_MSG_RESULT($withval) 36 57 if test "$withval" = "no" … … 59 80 AX_PYTHON_VERSION_CHECK([$1], 60 81 [ ax_python_use=true 82 si_embed_python=$si_try_embed 61 83 AC_MSG_RESULT(yes) 62 84 AX_PYTHON_PREFIX( ) … … 64 86 AX_PYTHON_CSPEC( ) 65 87 ], 66 [ax_python_use=false; AC_MSG_RESULT([too old, skipping python interface!])] 88 [ax_python_use=false 89 AC_MSG_RESULT([too old, skipping python interface!])] 67 90 ) 68 91 fi 69 92 fi 70 93 AM_CONDITIONAL(PYTHON_USE, test x"$ax_python_use" = x"true") 94 AM_CONDITIONAL(SI_EMBED_PYTHON, test x"$si_embed_python" = x"true") 95 96 if test x"$si_embed_python" = x"true" 97 then 98 AC_DEFINE(EMBED_PYTHON,1,integrate python) 99 AC_SUBST(EMBED_PYOBJECT_CFLAGS,"\${PYTHON_CSPEC}") 100 AC_SUBST(EMBED_PYOBJECT_LDFLAGS,"\${PYTHON_LSPEC}") 101 fi 102 103 AM_CONDITIONAL(PYTHON_MODULE, test x"$si_embed_python" != x"true") 71 104 fi 72 105
Note: See TracChangeset
for help on using the changeset viewer.