[libpeas] Fix building python plugin loaders



commit 0db03f62b97efdef5fa76bd3a4603bbdd3290f7c
Author: Garrett Regier <garrettregier gmail com>
Date:   Thu Feb 14 02:58:38 2013 -0800

    Fix building python plugin loaders

 configure.ac                |   11 ++++++++---
 loaders/python/Makefile.am  |    5 +++--
 loaders/python3/Makefile.am |    5 +++--
 3 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2a1c4bd..a973382 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,10 +346,11 @@ else
                     found_python2=yes
                     PYTHON2_CFLAGS=`${PYTHON2_CONFIG} --includes`
                     PYTHON2_LIBS=`${PYTHON2_CONFIG} --libs`
-                    pyexecdir=`$PYTHON2 -c "import sys; from distutils import sysconfig; print 
sysconfig.get_python_lib(True, prefix='')"`
-                    PYTHON2_PYEXECDIR="\${exec_prefix}/${pyexecdir}"
+                    PYTHON2_LDFLAGS=`${PYTHON2_CONFIG} --ldflags`
+                    PYTHON2_PYEXECDIR=`$PYTHON2 -c "from distutils import sysconfig; 
print(sysconfig.get_python_lib(1, 0, prefix='\\$' '{exec_prefix}'))"`
                     AC_SUBST(PYTHON2_CFLAGS)
                     AC_SUBST(PYTHON2_LIBS)
+                    AC_SUBST(PYTHON2_LDFLAGS)
                     AC_SUBST(PYTHON2_PYEXECDIR)
                     AC_DEFINE(ENABLE_PYTHON2, 1, [Define to compile with Python 2 support])
                 ], [
@@ -389,9 +390,11 @@ else
                 found_python3=yes
                 PYTHON3_CFLAGS=`${PYTHON3_CONFIG} --includes`
                 PYTHON3_LIBS=`${PYTHON3_CONFIG} --libs`
+                PYTHON3_LDFLAGS=`${PYTHON3_CONFIG} --ldflags`
                 PYTHON3_PYEXECDIR="${pyexecdir}"
                 AC_SUBST(PYTHON3_CFLAGS)
                 AC_SUBST(PYTHON3_LIBS)
+                AC_SUBST(PYTHON3_LDFLAGS)
                 AC_SUBST(PYTHON3_PYEXECDIR)
                 AC_DEFINE(ENABLE_PYTHON3, 1, [Define to compile with Python 3 support])
             ], [
@@ -435,7 +438,9 @@ AC_SUBST(LT_AGE)
 PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
 TEST_PLUGIN_LIBTOOL_FLAGS="$PLUGIN_LIBTOOL_FLAGS -rpath /nowhere"
 TEST_INTROSPECTION_LIBTOOL_FLAGS="-rpath /nowhere -export-dynamic -no-undefined"
-LOADER_LIBTOOL_FLAGS="-module -avoid-version -export-symbols-regex peas_register_types"
+# Cannot use "-export-symbols-regex peas_register_types"
+# because it might make the python plugin loader not work!
+LOADER_LIBTOOL_FLAGS="-module -avoid-version"
 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
 AC_SUBST(TEST_PLUGIN_LIBTOOL_FLAGS)
 AC_SUBST(TEST_INTROSPECTION_LIBTOOL_FLAGS)
diff --git a/loaders/python/Makefile.am b/loaders/python/Makefile.am
index fee60da..2bd1321 100644
--- a/loaders/python/Makefile.am
+++ b/loaders/python/Makefile.am
@@ -22,8 +22,9 @@ libpythonloader_la_SOURCES = \
        peas-plugin-loader-python.h
 
 libpythonloader_la_LDFLAGS = \
-       $(LOADER_LIBTOOL_FLAGS) \
-       $(GCOV_LDFLAGS)
+       $(LOADER_LIBTOOL_FLAGS)         \
+       $(GCOV_LDFLAGS)                 \
+       $(PYTHON2_LDFLAGS)
 
 libpythonloader_la_LIBADD = \
        $(PEAS_LIBS)                    \
diff --git a/loaders/python3/Makefile.am b/loaders/python3/Makefile.am
index fbe52ad..6116665 100644
--- a/loaders/python3/Makefile.am
+++ b/loaders/python3/Makefile.am
@@ -22,8 +22,9 @@ libpython3loader_la_SOURCES = \
        $(top_srcdir)/loaders/python/peas-plugin-loader-python.h
 
 libpython3loader_la_LDFLAGS = \
-       $(LOADER_LIBTOOL_FLAGS) \
-       $(GCOV_LDFLAGS)
+       $(LOADER_LIBTOOL_FLAGS)         \
+       $(GCOV_LDFLAGS)                 \
+       $(PYTHON3_LDFLAGS)
 
 libpython3loader_la_LIBADD = \
        $(PEAS_LIBS)                    \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]