From 508c7b58c37d1f986ff523e523e529681b239674 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 30 Jan 2018 20:04:46 +0000 Subject: [PATCH] Compute Python extension suffix and use it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This information doesn’t seem to be available from Python, so write our own test in configure.ac. --- configure.ac | 7 ++++++- tests/Makefile.am | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index ea8df23..93da4e2 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,12 @@ AX_WITH_PROG([HELP2MAN], [help2man], [help2man]) AC_SUBST([objdir]) LT_SYS_MODULE_EXT -AC_SUBST([shlibext], [$libltdl_cv_shlibext]) +case $host_os in + *mingw* ) pyextext=.pyd;; + *cygwin*) pyextext=.dll;; + * ) pyextext=.so;; +esac +AC_SUBST([pyextext], [$pyextext]) dnl Extra warnings with GCC and compatible compilers AC_ARG_ENABLE([gcc-warnings], diff --git a/tests/Makefile.am b/tests/Makefile.am index d3245b8..3dea44f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,17 +28,17 @@ t30_dumps.py t30_quoted.py t40_african.py t40_combine.py t40_testdump.py \ t40_utf7.py t40_utf8.py t50_methods.py t90_bigauto.py EXTRA_DIST = Recode.c Recode.pyx pytest common.py valgrind-python.supp $(SUITE) -CLEANFILES = Recode@shlibext@ Recode_d@shlibext@ Recode.body.c +CLEANFILES = Recode@pyextext@ Recode_d@pyextext@ Recode.body.c DISTCLEANFILES = Recode.c -check-local: Recode@shlibext@ +check-local: Recode@pyextext@ if test -n "$(VALGRIND)"; then export VALGRIND='$(VALGRIND) --suppressions=$(srcdir)/valgrind-python.supp'; fi; \ export LD_LIBRARY_PATH=$(top_builddir)/src/@objdir@; \ RECODE=$(top_builddir)/src/recode$(EXEEXT) PYTHONPATH=.:$(srcdir) \ $$VALGRIND $(PYTHON) $(srcdir)/pytest $(LIMIT) $(srcdir)/t*.py -Recode@shlibext@: Recode.c setup.py - rm -f *@shlibext@ +Recode@pyextext@: Recode.c setup.py + rm -f *@pyextext@ $(PYTHON) setup.py build_ext --inplace rm -fr build -- 2.50.0