From 4c3aaf3ad0023204c8e09d02de150ca2a29e9e59 Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 8 Jan 2014 15:17:46 +0100 Subject: Revert "Do not dlopen libpython" This reverts commit d63756bd11b097f11f115d5477110893b7ee16a2. Causes problems like the following issue on github: https://github.com/mate-desktop/python-caja/issues/5 --- src/Makefile.am | 4 +++- src/caja-python.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index f03fe1a..7ccb7c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,6 +6,8 @@ AM_CPPFLAGS = \ -I$(top_builddir) \ $(DISABLE_DEPRECATED_CFLAGS) \ $(CAJA_PYTHON_CFLAGS) \ + -DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \ + -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \ $(PYTHON_INCLUDES) caja_extensiondir=$(CAJA_EXTENSION_DIR) @@ -18,5 +20,5 @@ libcaja_python_la_SOURCES = \ caja-python-object.c \ caja-python-object.h -libcaja_python_la_LDFLAGS = -module -avoid-version -no-undefined +libcaja_python_la_LDFLAGS = -module -avoid-version libcaja_python_la_LIBADD = $(CAJA_PYTHON_LIBS) $(PYTHON_LIBS) diff --git a/src/caja-python.c b/src/caja-python.c index 21e7f42..a6a7478 100644 --- a/src/caja-python.c +++ b/src/caja-python.c @@ -155,11 +155,17 @@ static gboolean caja_python_init_python (void) { PyObject *caja; + GModule *libpython; char *argv[] = { "caja", NULL }; if (Py_IsInitialized()) return TRUE; + debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0"); + libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0", 0); + if (!libpython) + g_warning("g_module_open libpython failed: %s", g_module_error()); + debug("Py_Initialize"); Py_Initialize(); if (PyErr_Occurred()) -- cgit v1.2.1 From 067facfc97151ce24ccb6cf7ecda124ea0d6afbe Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 8 Jan 2014 17:47:37 +0100 Subject: Cleanup AM_CPPFLAGS --- src/Makefile.am | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 7ccb7c5..e3d7c3f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,15 +1,3 @@ -AM_CPPFLAGS = \ - -DG_LOG_DOMAIN=\"Caja-Python\" \ - -DDATADIR=\"$(datadir)\" \ - -DLIBDIR=\"$(libdir)\" \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - $(DISABLE_DEPRECATED_CFLAGS) \ - $(CAJA_PYTHON_CFLAGS) \ - -DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \ - -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \ - $(PYTHON_INCLUDES) - caja_extensiondir=$(CAJA_EXTENSION_DIR) caja_extension_LTLIBRARIES = libcaja-python.la @@ -20,5 +8,20 @@ libcaja_python_la_SOURCES = \ caja-python-object.c \ caja-python-object.h +libcaja_python_la_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -DG_LOG_DOMAIN=\"Caja-Python\" \ + -DDATADIR=\"$(datadir)\" \ + -DLIBDIR=\"$(libdir)\" \ + -DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \ + -DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \ + $(PYTHON_INCLUDES) \ + $(AM_CPPFLAGS) + +libcaja_python_la_CFLAGS = \ + $(CAJA_PYTHON_CFLAGS) \ + $(AM_CFLAGS) + libcaja_python_la_LDFLAGS = -module -avoid-version libcaja_python_la_LIBADD = $(CAJA_PYTHON_LIBS) $(PYTHON_LIBS) -- cgit v1.2.1