]> granicus.if.org Git - recode/commitdiff
Compute Python extension suffix and use it
authorReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 20:04:46 +0000 (20:04 +0000)
committerReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 20:19:50 +0000 (20:19 +0000)
This information doesn’t seem to be available from Python, so write our own
test in configure.ac.

configure.ac
tests/Makefile.am

index ea8df23340472854eba09e7e2006fe7cd51d0af0..93da4e2354b0ef45da74194a7dab8bf2d1cf5460 100644 (file)
@@ -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],
index d3245b87cb577a7125c9ac0d7cca95c12d0e7e16..3dea44f2a14b81aa99cf50c169b678074ec73303 100644 (file)
@@ -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