diff mbox

Require bison 2.7 or newer for regenerating intl/plural.y

Message ID 1418319179-18894-1-git-send-email-will.newton@linaro.org
State New
Headers show

Commit Message

Will Newton Dec. 11, 2014, 5:32 p.m. UTC
The merge of the latest gettext code introduced changes to the yacc
parser source that are incompatible with versions of bison older
than 2.7. Add a configure check for the appropriate versions and
document the requirement in INSTALL.

ChangeLog:

2014-12-11  Will Newton  <will.newton@linaro.org>

	* INSTALL: Document that we require bison 2.7 or above.
	* configure: Regenerate.
	* configure.ac: Use AC_CHECK_PROG_VER instead of
	AC_PATH_PROG when checking for bison and check for
	version 2.7 or above.
---
 INSTALL      |  5 +++++
 configure    | 53 +++++++++++++++++++++++++++++++++++++----------------
 configure.ac |  5 ++++-
 3 files changed, 46 insertions(+), 17 deletions(-)

Comments

Joseph Myers Dec. 11, 2014, 5:35 p.m. UTC | #1
On Thu, 11 Dec 2014, Will Newton wrote:

> The merge of the latest gettext code introduced changes to the yacc
> parser source that are incompatible with versions of bison older
> than 2.7. Add a configure check for the appropriate versions and
> document the requirement in INSTALL.
> 
> ChangeLog:
> 
> 2014-12-11  Will Newton  <will.newton@linaro.org>
> 
> 	* INSTALL: Document that we require bison 2.7 or above.

INSTALL is a generated file.  You need to update manual/install.texi then 
regenerate INSTALL (with makeinfo 4.x).

> +AC_CHECK_PROG_VER(BISON, bison, --version,
> +		  [bison (GNU Bison) \([0-9]*\.[0-9.]*\)],
> +		  [2.7*|[3-9].*],

Should allow for versions with two or more digits to avoid failing for 
bison 10.
Will Newton Dec. 11, 2014, 6:02 p.m. UTC | #2
On 11 December 2014 at 17:35, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 11 Dec 2014, Will Newton wrote:
>
>> The merge of the latest gettext code introduced changes to the yacc
>> parser source that are incompatible with versions of bison older
>> than 2.7. Add a configure check for the appropriate versions and
>> document the requirement in INSTALL.
>>
>> ChangeLog:
>>
>> 2014-12-11  Will Newton  <will.newton@linaro.org>
>>
>>       * INSTALL: Document that we require bison 2.7 or above.
>
> INSTALL is a generated file.  You need to update manual/install.texi then
> regenerate INSTALL (with makeinfo 4.x).

Thanks for pointing that out. I tried rebuilding INSTALL but actually
it seems to require texinfo 4.7 (4.5 has no --plaintext option, 5.1
seems to reformat things a bit). I'll send a patch for that too.
Steve Ellcey Dec. 17, 2014, 10:05 p.m. UTC | #3
On Thu, 2014-12-11 at 17:32 +0000, Will Newton wrote:
> The merge of the latest gettext code introduced changes to the yacc
> parser source that are incompatible with versions of bison older
> than 2.7. Add a configure check for the appropriate versions and
> document the requirement in INSTALL.
> 
> ChangeLog:
> 
> 2014-12-11  Will Newton  <will.newton@linaro.org>
> 
> 	* INSTALL: Document that we require bison 2.7 or above.
> 	* configure: Regenerate.
> 	* configure.ac: Use AC_CHECK_PROG_VER instead of
> 	AC_PATH_PROG when checking for bison and check for
> 	version 2.7 or above.

This patch fixes the build problem I have on ubuntu 12.04 with bison
2.5.  Can someone approve it for checkin?

Steve Ellcey
sellcey@imgtec.com
Roland McGrath Dec. 17, 2014, 10:07 p.m. UTC | #4
That's fine.
Carlos O'Donell Dec. 17, 2014, 10:13 p.m. UTC | #5
On 12/17/2014 05:05 PM, Steve Ellcey wrote:
> On Thu, 2014-12-11 at 17:32 +0000, Will Newton wrote:
>> The merge of the latest gettext code introduced changes to the yacc
>> parser source that are incompatible with versions of bison older
>> than 2.7. Add a configure check for the appropriate versions and
>> document the requirement in INSTALL.
>>
>> ChangeLog:
>>
>> 2014-12-11  Will Newton  <will.newton@linaro.org>
>>
>> 	* INSTALL: Document that we require bison 2.7 or above.
>> 	* configure: Regenerate.
>> 	* configure.ac: Use AC_CHECK_PROG_VER instead of
>> 	AC_PATH_PROG when checking for bison and check for
>> 	version 2.7 or above.
> 
> This patch fixes the build problem I have on ubuntu 12.04 with bison
> 2.5.  Can someone approve it for checkin?

You can approve it yourself! This is a consensus-based project.

Review Will's patch, and between the two of you can decide if the
patch is simple enough, and obvious enough that two people agreeing
constitutes consensus for the fix.

We want to keep gettext in sync, and if that means bison 2.7, then that's
fine. Bison 2.7 has been around for two years and is quite stable.
The two of you could have come to that conclusion and checked in the change.

Please empower yourself to review code and help others checkin their changes.

Cheres,
Carlos.
Steve Ellcey Dec. 17, 2014, 10:21 p.m. UTC | #6
On Wed, 2014-12-17 at 17:13 -0500, Carlos O'Donell wrote:

> You can approve it yourself! This is a consensus-based project.
> 
> Review Will's patch, and between the two of you can decide if the
> patch is simple enough, and obvious enough that two people agreeing
> constitutes consensus for the fix.
> 
> We want to keep gettext in sync, and if that means bison 2.7, then that's
> fine. Bison 2.7 has been around for two years and is quite stable.
> The two of you could have come to that conclusion and checked in the change.
> 
> Please empower yourself to review code and help others checkin their changes.
> 
> Cheres,
> Carlos.

Huh, I don't think I ever noticed that glibc doesn't have official
maintainers like GCC does.

Steve Ellcey
sellcey@imgtec.com
Carlos O'Donell Dec. 30, 2014, 7:31 p.m. UTC | #7
On 12/17/2014 05:21 PM, Steve Ellcey wrote:
> On Wed, 2014-12-17 at 17:13 -0500, Carlos O'Donell wrote:
> 
>> You can approve it yourself! This is a consensus-based project.
>>
>> Review Will's patch, and between the two of you can decide if the
>> patch is simple enough, and obvious enough that two people agreeing
>> constitutes consensus for the fix.
>>
>> We want to keep gettext in sync, and if that means bison 2.7, then that's
>> fine. Bison 2.7 has been around for two years and is quite stable.
>> The two of you could have come to that conclusion and checked in the change.
>>
>> Please empower yourself to review code and help others checkin their changes.
>>
>> Cheres,
>> Carlos.
> 
> Huh, I don't think I ever noticed that glibc doesn't have official
> maintainers like GCC does.

We are a smaller community. You've been contributing long enough that
we know where to find you ;-)

Cheers,
Carlos.
diff mbox

Patch

diff --git a/INSTALL b/INSTALL
index dac6178..7338678 100644
--- a/INSTALL
+++ b/INSTALL
@@ -386,6 +386,11 @@  and if you change any of the message translation files you will need
 
    * GNU `gettext' 0.10.36 or later
 
+If you wish to regenerate the yacc parser code in the `intl'
+subdirectory you will need
+
+   * GNU `bison' 2.7 or later
+
 You may also need these packages if you upgrade your source tree using
 patches, although we try to avoid this.
 
diff --git a/configure b/configure
index 0cb54ec..d37638c 100755
--- a/configure
+++ b/configure
@@ -5318,27 +5318,26 @@  $as_echo "no" >&6; }
 fi
 
 
-# Extract the first word of "bison", so it can be a program name with args.
-set dummy bison; ac_word=$2
+for ac_prog in bison
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BISON+:} false; then :
+if ${ac_cv_prog_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $BISON in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PATH:/usr/local/bin:/usr/bin:/bin"
-for as_dir in $as_dummy
+  if test -n "$BISON"; then
+  ac_cv_prog_BISON="$BISON" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_BISON="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5346,11 +5345,9 @@  done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_BISON" && ac_cv_path_BISON="no"
-  ;;
-esac
 fi
-BISON=$ac_cv_path_BISON
+fi
+BISON=$ac_cv_prog_BISON
 if test -n "$BISON"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
 $as_echo "$BISON" >&6; }
@@ -5360,6 +5357,30 @@  $as_echo "no" >&6; }
 fi
 
 
+  test -n "$BISON" && break
+done
+
+if test -z "$BISON"; then
+  ac_verc_fail=yes
+else
+  # Found it, now check the version.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $BISON" >&5
+$as_echo_n "checking version of $BISON... " >&6; }
+  ac_prog_version=`$BISON --version 2>&1 | sed -n 's/^.*bison (GNU Bison) \([0-9]*\.[0-9.]*\).*$/\1/p'`
+  case $ac_prog_version in
+    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+    2.7*|[3-9].*)
+       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
+$as_echo "$ac_prog_version" >&6; }
+fi
+if test $ac_verc_fail = yes; then
+  BISON=no
+fi
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libc-friendly stddef.h" >&5
 $as_echo_n "checking for libc-friendly stddef.h... " >&6; }
diff --git a/configure.ac b/configure.ac
index b2c4b1f..934b067 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,7 +1041,10 @@  if test "$PERL" != no &&
 fi
 AC_PATH_PROG(INSTALL_INFO, install-info, no,
 	     $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)
-AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin)
+AC_CHECK_PROG_VER(BISON, bison, --version,
+		  [bison (GNU Bison) \([0-9]*\.[0-9.]*\)],
+		  [2.7*|[3-9].*],
+		  BISON=no)
 
 AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl
 AC_TRY_COMPILE(dnl