gcc/contrib
Jakub Jelinek 437eea66a4 intl: Unbreak intl build with bison 3 when no regeneration is needed [PR92008]
As Iain reported, my change broke the case when one has bison >= 3,
but make decides there is no reason to regenerate plural.c, unfortunately
that seems to be a scenario I haven't tested.  The problem is that
the pregenerated plural.c has been generated with bison 1.35, but when
config.h says HAVE_BISON3, the code assumes it is the bison3 variant.
What used to work fine is when one has bison >= 3 and plural.c has been
regenerated (e.g. do touch intl/plural.y and it will work), or when
one doesn't have any bison (then nothing is regenerated, but HAVE_BISON3
isn't defined either), or when one has bison < 3 and doesn't need to
regenerate, or when one has bison < 3 and it is regenerated.

The following patch fixes this, by killing the HAVE_BISON3 macro from
config.h, and instead remembering the fact whether plural.c has been created
with bison < 3 or bison >= 3 in a separate new plural-config.h header.
The way this works:
- user doesn't have bison
- user has bison >= 3, but intl/{plural-config.h,plural.c} aren't older than intl/plural.y
- user has bison < 3, but intl/{plural-config.h,plural.c} aren't older than intl/plural.y
	pregenerated !USE_BISON3 plural.c and plural-config.h from source
	dir is used, nothing in the objdir
- user has bison >= 3 and intl/plural.y is newer
	Makefile generates plural.c and USE_BISON3 plural-config.h in the
	objdir, which is then used in preference to srcdir copies
- user has bison < 3 and intl/plural.y is newer
	Makefile generates plural.c and !USE_BISON3 plural-config.h in the
	objdir, which is then used in preference to srcdir copies
I have tested all these cases and make all-yes worked in all the cases.
If one uses the unsupported ./configure where srcdir == objdir, I guess
(though haven't tested) that it should still work, just it would be nice
if such people didn't try to check in the plural{.c,-config.h} they have
regenerated.
What doesn't work, but didn't work before either (just tested gcc-9 branch
too) is when one doesn't have bison and plural.y is newer than plural.c.
Don't do that ;)

2020-04-16  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/92008
intl/
	* configure.ac: Remove HAVE_BISON3 AC_DEFINE.
	* Makefile.in (HEADERS): Add plural-config.h.
	(.y.c): Also create plural-config.h.
	(dcigettext.o loadmsgcat.o plural.o plural-exp.o): Also depend
	on plural-config.h.
	(plural-config.h): Depend on plural.c.
	* plural-exp.h: Include plural-config.h.  Use USE_BISON3 instead
	of HAVE_BISON3.
	* plural.y: Use USE_BISON3 instead of HAVE_BISON3.
	* configure: Regenerated.
	* plural.c: Regenerated.
	* config.h.in: Regenerated.
	* plural-config.h: Generated.
contrib/
	* gcc_update: Add intl/plural.y dependency for intl/plural-config.h.
2020-04-16 11:55:00 +02:00
..
header-tools
reghunt
regression
testsuite-management
unicode Byte vs column awareness for diagnostic-show-locus.c (PR 49973) 2019-12-09 20:03:47 +00:00
vim-gcc-dev
analyze_brprob_spec.py
analyze_brprob.py
bench-stringop
ChangeLog intl: Unbreak intl build with bison 3 when no regeneration is needed [PR92008] 2020-04-16 11:55:00 +02:00
ChangeLog.jit
ChangeLog.tree-ssa
check_GNU_style_lib.py
check_GNU_style.py
check_GNU_style.sh
check_makefile_deps.sh
check_warning_flags.sh
check-internal-format-escaping.py
check-params-in-docs.py
clang-format Tweak clang-format configuration. 2019-09-18 13:32:25 +00:00
compare_tests
compare_two_ftime_report_sets
compare-all-tests
compare-debug
compare-lto
compareSumTests3
config-list.mk MSP430: Add new msp430-elfbare target 2019-12-16 11:02:10 +00:00
dg-cmp-results.sh
dg-extract-results.py contrib: Add KPASS support to dg-extract-results.{sh,py} 2019-10-21 13:41:29 +01:00
dg-extract-results.sh contrib: Add KPASS support to dg-extract-results.{sh,py} 2019-10-21 13:41:29 +01:00
dglib.pm
download_prerequisites download_prerequisites: Use http instead of ftp for downloading. 2019-11-13 19:48:52 +02:00
filter_gcc_for_doxygen
filter_knr2ansi.pl
filter_params.py
filter-clang-warnings.py
gcc_build
gcc_update intl: Unbreak intl build with bison 3 when no regeneration is needed [PR92008] 2020-04-16 11:55:00 +02:00
gcc-git-customization.sh Improve svn-rev to search for pattern at line beginning. 2020-04-03 12:30:39 +02:00
gcc.doxy
gen_autofdo_event.py
gennews
git-add-user-branch.sh contrib: Change 'remote' for personal branches and add branch creation script 2020-01-24 14:38:16 +00:00
git-add-vendor-branch.sh contrib: script to create a new vendor branch 2020-01-22 10:06:50 +00:00
git-fetch-vendor.sh contrib: New remotes structure for vendor and personal refs 2020-01-20 10:37:29 +00:00
gthr_supp_vxw_5x.c
index-prop
jit-coverage-report.py
maintainers-verify.sh
make_sunver.pl
make-obstacks-texi.pl
mark_spam.py
mklog Make mklog more robust. 2019-11-08 08:39:17 +00:00
mklog.pl
paranoia.cc
patch_tester.sh
prepare_patch.sh
prerequisites.md5
prerequisites.sha512
repro_fail
test_installed
test_recheck
test_summary
texi2pod.pl Fix @multitable handling in texi2pod.pl 2019-12-07 09:57:04 +00:00
uninclude
unused_functions.py
update-copyright.py update-copyright.py: Add Mentor Graphics Corporation and Yoshinori Sato as external authors. 2020-01-01 12:26:53 +01:00
vimrc
warn_summary