You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-commits@lucene.apache.org by va...@apache.org on 2010/05/18 19:38:19 UTC
svn commit: r945782 - in /lucene/pylucene/branches/branch_3x/jcc/jcc:
python.py sources/jcc.cpp
Author: vajda
Date: Tue May 18 17:38:19 2010
New Revision: 945782
URL: http://svn.apache.org/viewvc?rev=945782&view=rev
Log:
add --import'ed libs to link line, removed initVM()'s export keyword
Modified:
lucene/pylucene/branches/branch_3x/jcc/jcc/python.py
lucene/pylucene/branches/branch_3x/jcc/jcc/sources/jcc.cpp
Modified: lucene/pylucene/branches/branch_3x/jcc/jcc/python.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/branch_3x/jcc/jcc/python.py?rev=945782&r1=945781&r2=945782&view=diff
==============================================================================
--- lucene/pylucene/branches/branch_3x/jcc/jcc/python.py (original)
+++ lucene/pylucene/branches/branch_3x/jcc/jcc/python.py Tue May 18 17:38:19 2010
@@ -1772,6 +1772,10 @@ def compile(env, jccPath, output, module
args['extra_link_args'] += ['-Wl,-rpath', shlibdir]
args['library_dirs'] = [shlibdir]
args['libraries'] = ['jcc']
+ args['extra_link_args'] += [
+ getattr(import_, "_%s" %(import_.__name__)).__file__
+ for import_ in imports
+ ]
elif sys.platform == 'win32':
_d = debug and '_d' or ''
libdir = os.path.join(modulePath, 'lib')
Modified: lucene/pylucene/branches/branch_3x/jcc/jcc/sources/jcc.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/branch_3x/jcc/jcc/sources/jcc.cpp?rev=945782&r1=945781&r2=945782&view=diff
==============================================================================
--- lucene/pylucene/branches/branch_3x/jcc/jcc/sources/jcc.cpp (original)
+++ lucene/pylucene/branches/branch_3x/jcc/jcc/sources/jcc.cpp Tue May 18 17:38:19 2010
@@ -357,51 +357,18 @@ _DLL_EXPORT PyObject *initVM(PyObject *s
{
static char *kwnames[] = {
"classpath", "initialheap", "maxheap", "maxstack",
- "vmargs", "export", NULL
+ "vmargs", NULL
};
char *classpath = NULL;
char *initialheap = NULL, *maxheap = NULL, *maxstack = NULL;
char *vmargs = NULL;
- int export_ = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzzzzi", kwnames,
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzzzz", kwnames,
&classpath,
&initialheap, &maxheap, &maxstack,
- &vmargs, &export_))
+ &vmargs))
return NULL;
-#ifdef linux
- if (export_)
- {
- PyObject *__file__ = PyObject_GetAttrString(self, "__file__");
-
- if (!__file__)
- return NULL;
-
- if (PyString_Check(__file__))
- {
- if (!dlopen(PyString_AS_STRING(__file__), RTLD_NOW | RTLD_GLOBAL))
- {
- PyErr_Format(PyExc_SystemError,
- "dlopen(%s, RTLD_NOW | RTLD_GLOBAL) failed",
- PyString_AS_STRING(__file__));
- Py_DECREF(__file__);
-
- return NULL;
- }
- }
- else
- {
- PyErr_SetString(PyExc_TypeError, "__file__ is not a string");
- Py_DECREF(__file__);
-
- return NULL;
- }
-
- Py_DECREF(__file__);
- }
-#endif
-
if (env->vm)
{
PyObject *module_cp = NULL;