diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-16 10:12:30 +0200 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-02-10 15:26:56 +0000 |
commit | 830c5a1ffb0ee5f064b0ba0b07cb111aa7f85141 (patch) | |
tree | f81621bb4c7ef99b3c7477966c6f01638d39dc89 /intl/configure | |
parent | a52d653e9170d361e354ddaf2876aaa09aece207 (diff) | |
download | gdb-830c5a1ffb0ee5f064b0ba0b07cb111aa7f85141.zip gdb-830c5a1ffb0ee5f064b0ba0b07cb111aa7f85141.tar.gz gdb-830c5a1ffb0ee5f064b0ba0b07cb111aa7f85141.tar.bz2 |
intl: Allow building both with old bison and bison >= 3 [PR92008]
bison 3 apparently made a backwards incompatible change, dropped
YYLEX_PARAM/YYPARSE_PARAM support and instead needs %param or %lex-param
and %parse-param. Furthermore, there is no easy way to conditionalize
on bison version in the *.y files.
While e.g. glibc bumped bison requirement and just has the bison 3
compatible version, Richi said there are still systems with older bison
where we want to build gcc.
So, this patch instead determines during configure bison version, and
depending on that when building plural.c (if building it at all) tweaks
what is passed over to bison if needed.
Tested with both bison 3 and bison 1.35, in each case with reconfiguring
intl and building with make all-yes (as in my setup intl isn't normally
used).
intl/ChangeLog
2020-04-16 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/92008
* configure.ac: Add check for bison >= 3, AC_DEFINE HAVE_BISON3
and AC_SUBST BISON3_YES and BISON3_NO.
* Makefile.in (.y.c): Prefix $(YACC) invocation with @BISON3_NO@,
add @BISON3_YES@ prefixed rule to adjust the *.y source using sed
and adjust output afterwards.
* plural-exp.h (PLURAL_PARSE): If HAVE_BISON3 is defined, use
struct parse_args * type for arg instead of void *.
* plural.y: Add magic /* BISON3 ... */ comments with bison >= 3
directives.
(YYLEX_PARAM, YYPARSE_PARAM): Don't define if HAVE_BISON3 is defined.
(yylex, yyerror): Adjust prototypes and definitions if HAVE_BISON3
is defined.
* plural.c: Regenerated.
* config.h.in: Regenerated.
* configure: Regenerated.
Diffstat (limited to 'intl/configure')
-rwxr-xr-x | intl/configure | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/intl/configure b/intl/configure index 870b29f..58cee29 100755 --- a/intl/configure +++ b/intl/configure @@ -622,6 +622,8 @@ ac_unique_file="gettext.c" ac_header_list= ac_subst_vars='LTLIBOBJS LIBOBJS +BISON3_NO +BISON3_YES INCINTL LIBINTL_DEP MAINT @@ -6791,6 +6793,31 @@ case $USE_INCLUDED_LIBINTL in ;; esac +BISON3_YES='#' +BISON3_NO= +if test "$INTLBISON" != :; then + ac_bison3=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking bison 3 or later" >&5 +$as_echo_n "checking bison 3 or later... " >&6; } + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + [3-9].*) + ac_prog_version="$ac_prog_version, bison3"; ac_bison3=yes;; + *) ac_prog_version="$ac_prog_version, old";; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } + if test $ac_bison3 = yes; then + +$as_echo "#define HAVE_BISON3 1" >>confdefs.h + + BISON3_YES= + BISON3_NO='#' + fi +fi + + + ac_config_files="$ac_config_files Makefile config.intl" cat >confcache <<\_ACEOF |