diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-03-29 14:51:39 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-03-29 15:01:24 +0100 |
commit | 9f0eb95a7a8e3a3162b62b34ce1d47b3ea66e421 (patch) | |
tree | 23facb464c4f18bce476e55889b8b05e791a17cf | |
parent | 59784c2357e5eda663123359f861d8e209a44b90 (diff) |
Fix extension of native Python module
When building debug modules this e.g. has to be _d.so instead of just .so
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | gi/overrides/Makefile.am | 14 |
2 files changed, 15 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 4c9b9cf..993ad71 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,13 @@ then else AC_MSG_ERROR(too old) fi + +# - 'SO' for PyPy, CPython 2.7-3.2 +# - 'EXT_SUFFIX' for CPython3.3+ (http://bugs.python.org/issue16754) +# - fallback to '.so' +PYTHON_SO=`$PYTHON -c "import distutils.sysconfig, sys; get = distutils.sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.so');"` +AC_SUBST(PYTHON_SO) + AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) AS_AC_EXPAND(PYTHONDIR, $pythondir) AS_AC_EXPAND(PYEXECDIR, $pyexecdir) diff --git a/gi/overrides/Makefile.am b/gi/overrides/Makefile.am index 2cfd86d..c99650b 100644 --- a/gi/overrides/Makefile.am +++ b/gi/overrides/Makefile.am @@ -1,6 +1,6 @@ common_cflags = $(PYGOBJECT_CFLAGS) $(GST_CFLAGS) -fno-strict-aliasing common_libadd = $(GST_LIBS) $(PYGOBJECT_LIBS) -common_ldflags = -module -avoid-version +common_ldflags = -module -avoid-version -shrext $(PYTHON_SO) # We install everything in the gi/overrides folder pygioverridesdir = $(PYGI_OVERRIDES_DIR) @@ -27,9 +27,11 @@ build_pylinks: [ -e $(builddir)/$$f ] || $(LN_S) -f $(srcdir)/$$f $(builddir)/$$f; \ done -all: $(pygioverridesexec_LTLIBRARIES:.la=.so) build_pylinks -check-local: $(pygioverridesexec_LTLIBRARIES:.la=.so) build_pylinks +all: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks +check-local: $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) build_pylinks clean-local: - rm -f $(pygioverridesexec_LTLIBRARIES:.la=.so) -.la.so: - $(LN_S) -f .libs/$@ $@ || true + rm -f $(pygioverridesexec_LTLIBRARIES:.la=$(PYTHON_SO)) + +%$(PYTHON_SO): %.la + $(LN_S) -f .libs/$@ $@ + |