summaryrefslogtreecommitdiff
path: root/loaders
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2013-01-03 14:08:24 +0100
committerPaolo Borelli <pborelli@gnome.org>2013-01-05 18:21:26 +0100
commit590b5e1c3f11b4c5d6b15826aec05caeafaf9258 (patch)
tree91ef0a920fca3aea40485a84c5114a005433478d /loaders
parent519d9ebe0608c855ea84a1050036c93eda7dacbe (diff)
downloadlibpeas-590b5e1c3f11b4c5d6b15826aec05caeafaf9258.tar.gz
Support py2 and py3 at the same time
This patch reworks the build system so that we use the same sources to build both a python2 loader and a python3 loader. The python 2 one keeps the same name for backward compatibility, while the python 3 one is explicitely called "python3". Supporting py2 and py3 in the same build is tricky since the existing autotools support is limited, so we make some assumptions: - there are separate --enable-python2 and --enable-python3 flags, --enable-python has been removed - the py3 loader is in a separate dir but compliles the files from the py2 loader - for py2 we only check the binary and the python2-config tool, while for py3 we use the proper AM_PATH_PYTHON macro - for py2 we manually detect pyexecdir, hopefully with the same logic used by the AM_PATH_PYTHON macro - we do not check for Python.h header anymore since it is not strictly needed and autoconf caching makes it difficult - for we build the demos only for python3 (unit tests instead are replicated for both) https://bugzilla.gnome.org/show_bug.cgi?id=691081
Diffstat (limited to 'loaders')
-rw-r--r--loaders/Makefile.am6
-rw-r--r--loaders/python/Makefile.am8
-rw-r--r--loaders/python3/Makefile.am34
3 files changed, 44 insertions, 4 deletions
diff --git a/loaders/Makefile.am b/loaders/Makefile.am
index 8de15e7..dd5ac86 100644
--- a/loaders/Makefile.am
+++ b/loaders/Makefile.am
@@ -4,10 +4,14 @@ if ENABLE_GJS
SUBDIRS += gjs
endif
-if ENABLE_PYTHON
+if ENABLE_PYTHON2
SUBDIRS += python
endif
+if ENABLE_PYTHON3
+SUBDIRS += python3
+endif
+
if ENABLE_SEED
SUBDIRS += seed
endif
diff --git a/loaders/python/Makefile.am b/loaders/python/Makefile.am
index f029d8c..fee60da 100644
--- a/loaders/python/Makefile.am
+++ b/loaders/python/Makefile.am
@@ -8,8 +8,9 @@ INCLUDES = \
$(GCOV_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
- $(PYTHON_CFLAGS) \
- -DPEAS_PYEXECDIR=\""$(pyexecdir)"\" \
+ $(PYGOBJECT_CFLAGS) \
+ $(PYTHON2_CFLAGS) \
+ -DPEAS_PYEXECDIR=\""$(PYTHON2_PYEXECDIR)"\" \
-DPEAS_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
loader_LTLIBRARIES = libpythonloader.la
@@ -26,7 +27,8 @@ libpythonloader_la_LDFLAGS = \
libpythonloader_la_LIBADD = \
$(PEAS_LIBS) \
- $(PYTHON_LIBS)
+ $(PYGOBJECT_LIBS) \
+ $(PYTHON2_LIBS)
gcov_sources = $(libpythonloader_la_SOURCES)
include $(top_srcdir)/Makefile.gcov
diff --git a/loaders/python3/Makefile.am b/loaders/python3/Makefile.am
new file mode 100644
index 0000000..fbe52ad
--- /dev/null
+++ b/loaders/python3/Makefile.am
@@ -0,0 +1,34 @@
+# Python 3 plugin loader
+
+loaderdir = $(libdir)/libpeas-1.0/loaders
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(PEAS_CFLAGS) \
+ $(GCOV_CFLAGS) \
+ $(WARN_CFLAGS) \
+ $(DISABLE_DEPRECATED) \
+ $(PYGOBJECT_CFLAGS) \
+ $(PYTHON3_CFLAGS) \
+ -DPEAS_PYEXECDIR=\""$(PYTHON3_PYEXECDIR)"\" \
+ -DPEAS_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
+
+loader_LTLIBRARIES = libpython3loader.la
+
+libpython3loader_la_SOURCES = \
+ $(top_srcdir)/loaders/python/peas-extension-python.c \
+ $(top_srcdir)/loaders/python/peas-extension-python.h \
+ $(top_srcdir)/loaders/python/peas-plugin-loader-python.c \
+ $(top_srcdir)/loaders/python/peas-plugin-loader-python.h
+
+libpython3loader_la_LDFLAGS = \
+ $(LOADER_LIBTOOL_FLAGS) \
+ $(GCOV_LDFLAGS)
+
+libpython3loader_la_LIBADD = \
+ $(PEAS_LIBS) \
+ $(PYGOBJECT_LIBS) \
+ $(PYTHON3_LIBS)
+
+gcov_sources = $(libpython3loader_la_SOURCES)
+include $(top_srcdir)/Makefile.gcov