Skip to content

Commit 7c4ff1a

Browse files
monneratvkareh
authored andcommitted
Include Python 3 ABI flags in shared library name.
Python 3 appends the ABI flags to the version in the shared library file name: since this library is loaded as a gmodule, the correct file name must be provided.
1 parent 855e612 commit 7c4ff1a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ dnl **************************************************
4141
AM_PATH_PYTHON([2.7])
4242
PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
4343
PYTHON_LIB_LOC="`pkg-config python-${PYTHON_VERSION} --variable=libdir`"
44+
PYTHON_ABIFLAGS=`$PYTHON -c 'import sys; exec("try: print (sys.abiflags)\nexcept: pass")'`
4445
AC_SUBST(PYTHON_LIBS)
4546
AC_SUBST(PYTHON_CFLAGS)
4647
AC_SUBST(PYTHON_LIB_LOC)
48+
AC_SUBST(PYTHON_ABIFLAGS)
4749

4850
PYGOBJECT_MAJOR_VERSION=3
4951
PYGOBJECT_MINOR_VERSION=0

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ libcaja_python_la_CPPFLAGS = \
1515
-DDATADIR=\"$(datadir)\" \
1616
-DLIBDIR=\"$(libdir)\" \
1717
-DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \
18+
-DPYTHON_ABIFLAGS=\"$(PYTHON_ABIFLAGS)\" \
1819
-DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \
1920
$(CAJA_PYTHON_CFLAGS) \
2021
$(AM_CPPFLAGS)

src/caja-python.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ caja_python_init_python (void)
174174
if (Py_IsInitialized())
175175
return TRUE;
176176

177-
debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0");
178-
libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION "." G_MODULE_SUFFIX ".1.0", 0);
177+
debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0");
178+
libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0", 0);
179179
if (!libpython)
180180
g_warning("g_module_open libpython failed: %s", g_module_error());
181181

0 commit comments

Comments
 (0)