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.
pull/22/head
nirenjan 2020-06-16 15:17:53 -07:00
parent 3eaee7b8f4
commit c4acd0ce49
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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 $@