git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] configure: Add test for Perl
@ 2006-07-06 12:40 Dennis Stosberg
  2006-07-06 13:03 ` Randal L. Schwartz
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Dennis Stosberg @ 2006-07-06 12:40 UTC (permalink / raw)
  To: git

This patch adds two tests to the configuration script. The first
one tries to find a perl binary in the path.  The second one checks
whether the found perl is of a sufficient version.

It also adds a --perl=/path parameter to override the autodetection
of the perl binary.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---
 config-lib.sh |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/config-lib.sh b/config-lib.sh
index 68fecc5..69999a8 100755
--- a/config-lib.sh
+++ b/config-lib.sh
@@ -262,6 +262,7 @@ Installation directories:
 
 Miscellaneous options:
   --cc=COMPILER          use this C compiler to build MPlayer [gcc]
+  --perl=PATH            path to perl 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
@@ -296,6 +297,8 @@ EOF
 
 		--cc=*)
 			_cc=`echo $ac_option | cut -d '=' -f 2` ;;
+		--perl=*)
+			_perl=`echo $ac_option | cut -d '=' -f 2` ;;
 		--target=*)
 			_target=`echo $ac_option | cut -d '=' -f 2` ;;
 		--with-install=*)
@@ -409,8 +412,21 @@ int main(void) { return 0; }
 EOF
 	{ cc_check && tmp_run; } || die "unusable compiler or produced binary"
 	echores yes
-}
 
+	echocheck "for perl"
+	if test -z "$_perl" ; then
+		_perl=`which perl`
+		test "$_perl" || die "cannot find path to perl"
+	fi
+	echores "$_perl"
+
+	echocheck "perl version"
+	_perl_version=`"$_perl" -e 'require 5.6.0;printf "%vd", $^V'`
+	if test -z "$_perl_version" ; then
+		die "your perl version is too old"
+	fi
+	echores "$_perl_version"
+}
 
 write_config() {
 	echo "Creating config.mak.autogen"
@@ -420,6 +436,7 @@ write_config() {
 # -------- Generated by configure -----------
 
 CC = $_cc
+PERL_PATH = $_perl
 INSTALL = $_install
 
 EOF
-- 
1.4.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-07-07 11:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 12:40 [PATCH 1/3] configure: Add test for Perl Dennis Stosberg
2006-07-06 13:03 ` Randal L. Schwartz
2006-07-06 13:10 ` Timo Hirvonen
2006-07-06 13:29   ` Dennis Stosberg
2006-07-06 13:58   ` Matthias Lederhofer
2006-07-06 14:17     ` Gerrit Pape
2006-07-06 14:25       ` Dennis Stosberg
2006-07-06 14:27     ` Timo Hirvonen
2006-07-06 15:34       ` Dennis Stosberg
2006-07-07 11:06   ` Petr Baudis
2006-07-07 11:20     ` Junio C Hamano
2006-07-07 11:23     ` Timo Hirvonen
2006-07-06 15:40 ` Alex Riesen
2006-07-06 15:44   ` 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).