[PATCH 2/3] configure: Add test for Python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The test tries to find the path to a suitable Python binary.
It also adds a --python=/path parameter to override the autodetection.

Signed-off-by: Dennis Stosberg <dennis@xxxxxxxxxxxx>
---
 config-lib.sh |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/config-lib.sh b/config-lib.sh
index 69999a8..50ad6e9 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -263,6 +263,7 @@ Installation directories:
 Miscellaneous options:
   --cc=COMPILER          use this C compiler to build MPlayer [gcc]
   --perl=PATH            path to perl binary [autodetect]
+  --python=PATH          path to python binary [autodetect]
   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)
   --with-install=PATH    use a custom install program (useful if your OS uses
                          a GNU-incompatible install utility by default and
@@ -299,6 +300,8 @@ EOF
 			_cc=`echo $ac_option | cut -d '=' -f 2` ;;
 		--perl=*)
 			_perl=`echo $ac_option | cut -d '=' -f 2` ;;
+		--python=*)
+			_python=`echo $ac_option | cut -d '=' -f 2` ;;
 		--target=*)
 			_target=`echo $ac_option | cut -d '=' -f 2` ;;
 		--with-install=*)
@@ -426,6 +429,24 @@ EOF
 		die "your perl version is too old"
 	fi
 	echores "$_perl_version"
+
+	echocheck "for python"
+	for __py_bin in python python2.4 python2.3; do
+		test "$_python" && continue
+
+		__candidate=`which $__py_bin`
+		test "$__candidate" || continue
+
+		$__candidate - <<EOF || continue
+import sys
+v = sys.version_info
+if v < (2, 3):
+    sys.exit(1)
+EOF
+		_python=$__candidate
+	done
+	test "$_python" || die "cannot find path to python"
+	echores "$_python"
 }
 
 write_config() {
@@ -437,6 +458,7 @@ # -------- Generated by configure ------
 
 CC = $_cc
 PERL_PATH = $_perl
+PYTHON_PATH = $_python
 INSTALL = $_install
 
 EOF
-- 
1.4.1


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]