From 836a57190e85ba0b178782697af4d5dc1cb20a64 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 19 Sep 2017 08:12:14 +0100 Subject: [PATCH] Fix --with-2to3 configure option --- CHANGES.current | 3 +++ Examples/Makefile.in | 2 +- configure.ac | 15 +++++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index f76e5a58e..dd9c87135 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.0.0 (in progress) =========================== +2017-09-19: futatuki + [Python] #1003 Add --with-2to3=/path/to/2to3 option to configure. + 2017-09-18: wsfulton Fix type promotion wrapping constant expressions of the form: # define EXPR_MIXED1 (0x80 + 11.1) - 1 diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 6d4260d13..e020a659a 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -386,7 +386,7 @@ else PYSCRIPT = $(RUNME)3.py endif -PY2TO3 = @PY2TO3PROG@ `@PY2TO3PROG@ -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'` +PY2TO3 = @PY2TO3@ `@PY2TO3@ -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'` python_run: $(PYSCRIPT) ifneq (,$(PEP8)) diff --git a/configure.ac b/configure.ac index d2f2c85b3..48bb1ce81 100644 --- a/configure.ac +++ b/configure.ac @@ -902,10 +902,17 @@ if test -n "$PYINCLUDE" || test -n "$PY3INCLUDE" ; then AC_MSG_RESULT($pep8_version) fi fi -AC_ARG_WITH(2to3, AS_HELP_STRING([--with-2to3], [alternate 2to3 executable]) -AS_HELP_STRING([--with-2to3=path], [Specify 2to3 utility path]),[ PY2TO3="$withval"], [PY2TO3="2to3"]) -if [ ! -z "$PYTHON3" ] ; then - AC_CHECK_PROGS(PY2TO3PROG, $PY2TO3) + +AC_ARG_WITH(2to3, AS_HELP_STRING([--with-2to3=path], [Set location of Python 2to3 tool]), [PY2TO3BIN="$withval"], [PY2TO3BIN="yes"]) +if test -n "$PYTHON3"; then + if test "x$PY2TO3BIN" = xyes; then + AC_CHECK_PROGS(PY2TO3, 2to3) + else + PY2TO3="$PY2TO3BIN" + fi + if test -z "$PY2TO3"; then + PYTHON3= + fi fi #----------------------------------------------------------------