autogen.sh: Allow overriding the python to be used by setting $PYTHON.

Some installations have several python versions installed. Allow user
to choose which one to use by setting $PYTHON.
This commit is contained in:
Jon McCune 2015-03-06 00:33:41 +01:00 committed by Vladimir Serbinenko
parent 8842991a56
commit be41c1cf11
2 changed files with 10 additions and 4 deletions

View File

@ -104,6 +104,9 @@ The simplest way to compile this package is:
3. Type `./autogen.sh'.
* autogen.sh uses python. By default invocation is "python" but can be
overriden by setting variable $PYTHON.
4. Type `./configure' to configure the package for your system.
If you're using `csh' on an old version of System V, you might
need to type `sh ./configure' instead to prevent `csh' from trying

View File

@ -2,6 +2,9 @@
set -e
# Set ${PYTHON} to plain 'python' if not set already
: ${PYTHON:=python}
export LC_COLLATE=C
unset LC_ALL
@ -9,10 +12,10 @@ find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './b
find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
echo "Importing unicode..."
python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
echo "Importing libgcrypt..."
python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
${PYTHON} util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h
if [ -f include/grub/gcrypt/g10lib.h ]; then
rm include/grub/gcrypt/g10lib.h
@ -54,8 +57,8 @@ for extra in contrib/*/Makefile.core.def; do
fi
done
python gentpl.py $UTIL_DEFS > Makefile.util.am
python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
${PYTHON} gentpl.py $UTIL_DEFS > Makefile.util.am
${PYTHON} gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
for extra in contrib/*/Makefile.common; do
if test -e "$extra"; then