From ea7c19322d68b9a886ff74add46bc357190458fd Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 14 Oct 2008 04:07:11 +0000 Subject: [PATCH] Added new perl check into configure --- CHANGES.txt | 3 +++ configure | 29 +++++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9d386e9ed5..879e8dc663 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,9 @@ support for it. 10/08/08: Bug Fix: Added some more HTML entity escaping to case management values (such as description). Reported by Daniel Medianero. +10/13/08: Update: Added perl version check back into configure, but used +perl $] variable to do checking. Based on patch by Joerg Friedrich. + --------------------------- Version 2.10 -------------------------------- 2/20/08: Bug Fix: Added 'tsk' to the path for sorter to find the 'images' config file. Reported by Russell Reynolds. diff --git a/configure b/configure index 831c541a18..6a640cad7d 100755 --- a/configure +++ b/configure @@ -61,12 +61,17 @@ found=0; for d in $dirs do if (test -x ${d}perl) then if (test -n "`${d}perl -v 2> /dev/null | awk '/This is perl/ {print $0}'`") then - ver=`${d}perl -v 2> /dev/null | awk '/This is perl,/ {print $4}'`; - echo "perl found: ${d}perl (version $ver)"; - echo "#!${d}perl -wT" > ./config.tmp; - echo "#!${d}perl" > ./config2.tmp; - found=1; - break; + ver=`${d}perl -e 'print $];'`; + if (`${d}perl -e 'exit( $] >= 5.008);'`) then + echo "old version of perl found: ${d}perl (version $ver) -- continuing"; + else + echo "perl found: ${d}perl (version $ver)"; + echo "#!${d}perl -wT" > ./config.tmp; + echo "#!${d}perl" > ./config2.tmp; + perlexe="${d}perl"; + found=1; + break; + fi; fi; fi; done @@ -79,13 +84,13 @@ if (test $found -eq 0) then read perlexe; if (test -x "$perlexe") then if (test -n "`$perlexe -v 2> /dev/null | awk '/This is perl/ {print $0}'`") then - ver=`$perlexe -v 2> /dev/null | awk '/This is perl,/ {print $4}'`; - if (test "$ver" '<' "v5.8.0") then + ver=`$perlexe -e 'print $];'`; + if (`$perlexe -e 'exit( $] >= 5.008);'`) then echo "This version of Perl is too old, 5.8.0 or older needed"; - else + else echo "Correct version found"; - echo "#!${d}perl -wT" > ./config.tmp; - echo "#!${d}perl" > ./config2.tmp; + echo "#!${perlexe} -wT" > ./config.tmp; + echo "#!${perlexe}" > ./config2.tmp; found=1; break; fi; @@ -99,7 +104,7 @@ if (test $found -eq 0) then fi # Check if this version of Perl supports large files -if (test -z "`${d}perl -V 2> /dev/null | awk '/USE_LARGE_FILES/ {print $0}'`") then +if (test -z "`$perlexe -V 2> /dev/null | awk '/USE_LARGE_FILES/ {print $0}'`") then echo '' echo ' NOTE: It appears that your Perl does not support large files.'; echo ' You therefore will not be able to analyze images larger than 2GB.';