git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] configure: Add test for Python
@ 2006-07-06 12:40 Dennis Stosberg
  0 siblings, 0 replies; only message in thread
From: Dennis Stosberg @ 2006-07-06 12:40 UTC (permalink / raw)
  To: git

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@stosberg.net>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-06 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 12:40 [PATCH 2/3] configure: Add test for Python Dennis Stosberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).