From c4acd0ce499810a14e6401feed155bea101e2af9 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Tue, 16 Jun 2020 15:17:53 -0700 Subject: [PATCH] Update makefiles to use Python 3 Prior to this change, generation of the character lookup table could use Python 2 or Python 3, depending on what the first instance of python in the PATH pointed to. On most systems, python is a symbolic link to python2.7. However, given that Python 2 is EOL, it makes sense to switch the code to use Python 3 now, rather than later. This change updates the requirements to use Python 3.6 or later, and updates the Makefile to invoke the script with the detected python binary, rather than relying on the shebang to use the system Python. --- INSTALL.md | 6 +++--- configure.ac | 2 +- lib/libx52util/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index e6b5bda..8f904de 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -20,14 +20,14 @@ Build has been tested on the following operating systems (x86-64 only): * libtool * libusb-1.0 + headers * pkg-config -* python (2.6 or greater) +* python3 (3.6 or greater) ### Installation instructions | Platform | Install instructions | | -------- | -------------------- | -| Ubuntu | `sudo apt-get install automake autoconf gettext autopoint libtool libusb-1.0-0-dev pkg-config python` | -| MacOS + Homebrew | `brew install automake autoconf gettext libtool libusb pkg-config python` | +| Ubuntu | `sudo apt-get install automake autoconf gettext autopoint libtool libusb-1.0-0-dev pkg-config python3` | +| MacOS + Homebrew | `brew install automake autoconf gettext libtool libusb pkg-config python3` | ## Optional Packages diff --git a/configure.ac b/configure.ac index 7158f31..121650a 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ AC_PROG_CC AC_PROG_CC_STDC AC_PROG_AWK AM_PROG_AR -AM_PATH_PYTHON([2.6]) +AM_PATH_PYTHON([3.6]) LT_INIT PKG_PROG_PKG_CONFIG PKG_INSTALLDIR diff --git a/lib/libx52util/Makefile.am b/lib/libx52util/Makefile.am index c7e586b..0dc3282 100644 --- a/lib/libx52util/Makefile.am +++ b/lib/libx52util/Makefile.am @@ -28,5 +28,5 @@ EXTRA_DIST = x52_char_map.cfg \ # Autogenerated file that needs to be cleaned up CLEANFILES = util_char_map.c util_char_map.c: $(srcdir)/x52_char_map.cfg x52_char_map_gen.py - $(AM_V_GEN) $(srcdir)/x52_char_map_gen.py $(srcdir)/x52_char_map.cfg $@ + $(AM_V_GEN) $(PYTHON) $(srcdir)/x52_char_map_gen.py $(srcdir)/x52_char_map.cfg $@