diff options
author | Nathan Scott <nathans@redhat.com> | 2020-08-23 11:24:52 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-08-23 11:24:52 +1000 |
commit | 9e57b5c3f48c15aa8fb0ced408ec745eb6ad8874 (patch) | |
tree | 5b9d9bb52640880e50722c7aba3066d518317d26 | |
parent | b3aef4ea3a043c1988451bf237902fa77bccb0d5 (diff) |
Generate an appropriate shebang line for MakeHeader script3.0.0rc2
Use configure.ac to handle platform differences where some
build hosts have only a python3, or only python, binary.
Related to https://github.com/htop-dev/htop/pull/6
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rwxr-xr-x | scripts/MakeHeader.py.in (renamed from scripts/MakeHeader.py) | 2 |
3 files changed, 6 insertions, 2 deletions
@@ -39,4 +39,5 @@ libtool ltmain.sh m4/ missing +scripts/MakeHeader.py stamp-h1 diff --git a/configure.ac b/configure.ac index 323a94e9..a2eb53ec 100644 --- a/configure.ac +++ b/configure.ac @@ -299,6 +299,9 @@ AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as er AS_IF([test "x$enable_werror" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -Werror"]) AC_SUBST([AM_CFLAGS]) +AC_CHECK_PROGS(PYTHON, [python python3 python2]) +AC_SUBST(PYTHON) + # Bail out on errors. # ---------------------------------------------------------------------- if test ! -z "$missing_libraries"; then @@ -320,7 +323,7 @@ AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin]) AM_CONDITIONAL([HTOP_SOLARIS], [test "$my_htop_platform" = solaris]) AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported]) AC_SUBST(my_htop_platform) -AC_CONFIG_FILES([Makefile htop.1]) +AC_CONFIG_FILES([Makefile htop.1 scripts/MakeHeader.py], [chmod +x scripts/MakeHeader.py]) AC_OUTPUT if test "$my_htop_platform" = "unsupported" diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py.in index 3ef34b88..9da6685a 100755 --- a/scripts/MakeHeader.py +++ b/scripts/MakeHeader.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env @PYTHON@ import os, sys, string, io try: from StringIO import StringIO |