{"thread":{"id":"4784","subject":"[PATCH 2/3] configure: Add test for Python","startedAt":"2006-07-06T12:40:38Z","lastAt":"2006-07-06T12:40:38Z","messageCount":1,"participants":["Dennis Stosberg"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"23312","messageId":"20060706124038.G20591f4b@leonov.stosberg.net","threadId":"4784","inReplyTo":null,"subject":"[PATCH 2/3] configure: Add test for Python","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-07-06T12:40:38Z","receivedAt":"2006-07-06T12:40:38Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"The test tries to find the path to a suitable Python binary.\nIt also adds a --python=/path parameter to override the autodetection.\n\nSigned-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\n config-lib.sh |   22 ++++++++++++++++++++++\n 1 files changed, 22 insertions(+), 0 deletions(-)\n\ndiff --git a/config-lib.sh b/config-lib.sh\nindex 69999a8..50ad6e9 100755\n--- a/config-lib.sh\n+++ b/config-lib.sh\n@@ -263,6 +263,7 @@ Installation directories:\n Miscellaneous options:\n   --cc=COMPILER          use this C compiler to build MPlayer [gcc]\n   --perl=PATH            path to perl binary [autodetect]\n+  --python=PATH          path to python binary [autodetect]\n   --target=PLATFORM      target platform (i386-linux, arm-linux, etc)\n   --with-install=PATH    use a custom install program (useful if your OS uses\n                          a GNU-incompatible install utility by default and\n@@ -299,6 +300,8 @@ EOF\n \t\t\t_cc=`echo $ac_option | cut -d '=' -f 2` ;;\n \t\t--perl=*)\n \t\t\t_perl=`echo $ac_option | cut -d '=' -f 2` ;;\n+\t\t--python=*)\n+\t\t\t_python=`echo $ac_option | cut -d '=' -f 2` ;;\n \t\t--target=*)\n \t\t\t_target=`echo $ac_option | cut -d '=' -f 2` ;;\n \t\t--with-install=*)\n@@ -426,6 +429,24 @@ EOF\n \t\tdie \"your perl version is too old\"\n \tfi\n \techores \"$_perl_version\"\n+\n+\techocheck \"for python\"\n+\tfor __py_bin in python python2.4 python2.3; do\n+\t\ttest \"$_python\" && continue\n+\n+\t\t__candidate=`which $__py_bin`\n+\t\ttest \"$__candidate\" || continue\n+\n+\t\t$__candidate - <<EOF || continue\n+import sys\n+v = sys.version_info\n+if v < (2, 3):\n+    sys.exit(1)\n+EOF\n+\t\t_python=$__candidate\n+\tdone\n+\ttest \"$_python\" || die \"cannot find path to python\"\n+\techores \"$_python\"\n }\n \n write_config() {\n@@ -437,6 +458,7 @@ # -------- Generated by configure ------\n \n CC = $_cc\n PERL_PATH = $_perl\n+PYTHON_PATH = $_python\n INSTALL = $_install\n \n EOF\n-- \n1.4.1\n"}]}