aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-05-02 11:18:11 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-05-02 11:18:11 -0400
commit28e02b8fde7356fb917e36a20d9ddeb19aded53a (patch)
tree9154b7b723193c4b16ebd35062bba69f21842e44
parent7ee15c05d2fbe7a9dde07867aead93583fbd14ce (diff)
downloadpostgresql-28e02b8fde7356fb917e36a20d9ddeb19aded53a.tar.gz
postgresql-28e02b8fde7356fb917e36a20d9ddeb19aded53a.zip
Fix configure's incorrect version tests for flex and perl.
awk's equality-comparison operator is "==" not "=". We got this right in many places, but not in configure's checks for supported version numbers of flex and perl. It hadn't been noticed because unsupported versions are so old as to be basically extinct in the wild, and because the only consequence is whether or not a WARNING flies by during configure. Daniel Gustafsson noted the problem with respect to the test for flex, I found the other by reviewing other awk calls.
-rw-r--r--config/perl.m42
-rw-r--r--config/programs.m42
-rwxr-xr-xconfigure4
3 files changed, 4 insertions, 4 deletions
diff --git a/config/perl.m4 b/config/perl.m4
index d602a5bb1b0..48ae2703b48 100644
--- a/config/perl.m4
+++ b/config/perl.m4
@@ -13,7 +13,7 @@ if test "$PERL"; then
pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']`
AC_MSG_NOTICE([using perl $pgac_perl_version])
if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
- $AWK '{ if ([$]1 = 5 && [$]2 >= 8) exit 1; else exit 0;}'
+ $AWK '{ if ([$]1 == 5 && [$]2 >= 8) exit 1; else exit 0;}'
then
AC_MSG_WARN([
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
diff --git a/config/programs.m4 b/config/programs.m4
index 57bbe962c39..c9f0740800a 100644
--- a/config/programs.m4
+++ b/config/programs.m4
@@ -69,7 +69,7 @@ else
echo '%%' > conftest.l
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
- if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 = 2 && ([$]2 > 5 || ([$]2 = 5 && [$]3 >= 31))) exit 0; else exit 1;}'
+ if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 == 2 && ([$]2 > 5 || ([$]2 == 5 && [$]3 >= 31))) exit 0; else exit 1;}'
then
pgac_cv_path_flex=$pgac_candidate
break 2
diff --git a/configure b/configure
index e9b3975da9a..2d67fadd07a 100755
--- a/configure
+++ b/configure
@@ -7164,7 +7164,7 @@ else
echo '%%' > conftest.l
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
- if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 = 2 && ($2 > 5 || ($2 = 5 && $3 >= 31))) exit 0; else exit 1;}'
+ if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 31))) exit 0; else exit 1;}'
then
pgac_cv_path_flex=$pgac_candidate
break 2
@@ -7262,7 +7262,7 @@ if test "$PERL"; then
{ $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
- $AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
+ $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
then
{ $as_echo "$as_me:$LINENO: WARNING:
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.