Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 55233c3

Browse files
committed
Make configure check the version of Perl we're building with, and reject
versions < 5.8. Also, if there's no Perl, emit a warning informing the user that he won't be able to build from a CVS pull. This is exactly the same treatment we give Bison and Perl, and for the same reasons.
1 parent d15cb38 commit 55233c3

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

config/perl.m4

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
1-
# $PostgreSQL: pgsql/config/perl.m4,v 1.5 2009/09/08 18:15:55 tgl Exp $
1+
# $PostgreSQL: pgsql/config/perl.m4,v 1.6 2010/01/07 01:41:11 tgl Exp $
22

33

44
# PGAC_PATH_PERL
55
# --------------
66
AC_DEFUN([PGAC_PATH_PERL],
7-
[AC_PATH_PROG(PERL, perl)])
7+
[# Let the user override the search
8+
if test -z "$PERL"; then
9+
AC_PATH_PROG(PERL, perl)
10+
fi
11+
12+
if test "$PERL"; then
13+
pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl, v[a-z ]*//p'] | sed ['s/ .*//']`
14+
AC_MSG_NOTICE([using perl $pgac_perl_version])
15+
if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
16+
$AWK '{ if ([$]1 = 5 && [$]2 >= 8) exit 1; else exit 0;}'
17+
then
18+
AC_MSG_WARN([
19+
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
20+
*** Perl version 5.8 or later is required, but this is $pgac_perl_version.])
21+
PERL=""
22+
fi
23+
fi
24+
25+
if test -z "$PERL"; then
26+
AC_MSG_WARN([
27+
*** Without Perl you will not be able to build PostgreSQL from CVS.
28+
*** You can obtain Perl from any CPAN mirror site.
29+
*** (If you are using the official distribution of PostgreSQL then you do not
30+
*** need to worry about this, because the Perl output is pre-generated.)])
31+
fi
32+
])# PGAC_PATH_PERL
833

934

1035
# PGAC_CHECK_PERL_CONFIG(NAME)

configure

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6822,7 +6822,9 @@ fi
68226822

68236823

68246824

6825-
# Extract the first word of "perl", so it can be a program name with args.
6825+
# Let the user override the search
6826+
if test -z "$PERL"; then
6827+
# Extract the first word of "perl", so it can be a program name with args.
68266828
set dummy perl; ac_word=$2
68276829
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
68286830
$as_echo_n "checking for $ac_word... " >&6; }
@@ -6862,6 +6864,38 @@ $as_echo "no" >&6; }
68626864
fi
68636865

68646866

6867+
fi
6868+
6869+
if test "$PERL"; then
6870+
pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl, v[a-z ]*//p' | sed 's/ .*//'`
6871+
{ $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
6872+
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
6873+
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
6874+
$AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
6875+
then
6876+
{ $as_echo "$as_me:$LINENO: WARNING:
6877+
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
6878+
*** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
6879+
$as_echo "$as_me: WARNING:
6880+
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
6881+
*** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
6882+
PERL=""
6883+
fi
6884+
fi
6885+
6886+
if test -z "$PERL"; then
6887+
{ $as_echo "$as_me:$LINENO: WARNING:
6888+
*** Without Perl you will not be able to build PostgreSQL from CVS.
6889+
*** You can obtain Perl from any CPAN mirror site.
6890+
*** (If you are using the official distribution of PostgreSQL then you do not
6891+
*** need to worry about this, because the Perl output is pre-generated.)" >&5
6892+
$as_echo "$as_me: WARNING:
6893+
*** Without Perl you will not be able to build PostgreSQL from CVS.
6894+
*** You can obtain Perl from any CPAN mirror site.
6895+
*** (If you are using the official distribution of PostgreSQL then you do not
6896+
*** need to worry about this, because the Perl output is pre-generated.)" >&2;}
6897+
fi
6898+
68656899
if test "$with_perl" = yes; then
68666900

68676901
{ $as_echo "$as_me:$LINENO: checking for Perl archlibexp" >&5

0 commit comments

Comments
 (0)