changeset 1050:223df8e9c694 draft

make.sh: Fix probing for python2.x and be verbose in error reporting
author Elie De Brauwer <eliedebrauwer@gmail.com>
date Fri, 30 Aug 2013 23:59:10 +0200
parents b89ab13436fa
children 626cc2108480
files scripts/make.sh
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/make.sh	Fri Aug 30 23:31:00 2013 +0200
+++ b/scripts/make.sh	Fri Aug 30 23:59:10 2013 +0200
@@ -139,12 +139,17 @@
 
 echo "generated/help.h"
 # Only recreate generated/help.h if python2 is installed. Does not work with 3.
-PYTHON="$(which python2)"
-if [ ! -z "$PYTHON" ] &&
-   [ ! -z "$(grep 'CONFIG_TOYBOX_HELP=y' $KCONFIG_CONFIG)" ]
+PYTHON="$(which python2 || which python2.6 || which python2.7)"
+if [ ! -z "$(grep 'CONFIG_TOYBOX_HELP=y' $KCONFIG_CONFIG)" ];
 then
-  echo "Extract help text from Config.in."
-  "$PYTHON" scripts/config2help.py Config.in > generated/help.h || exit 1
+  if [ -z "$PYTHON" ];
+  then
+    echo "Python 2.x required when CONFIG_TOYBOX_HELP is enabled"
+    exit 1
+  else
+    echo "Extract help text from Config.in."
+    "$PYTHON" scripts/config2help.py Config.in > generated/help.h || exit 1
+  fi
 fi
 
 # Extract a list of toys/*/*.c files to compile from the data in $KCONFIG_CONFIG