Allow to build libgccjit with a soname bound to the GCC major version

When configuring GCC with --program-suffix=-$(BASE_VERSION) to allow
installation multiple GCC versions in parallel, the executable of the
driver (gcc-$(BASE_VERSION)) gets recorded in the libgccjit.so.0
library.  Assuming, that you only install the libgccjit.so.0 library
from the newest GCC, you have a libgccjit installed, which always calls
back to the newest installed version of GCC.  I'm not saying that the
ABI is changing, but I'd like to see the libgccjit calling out to the
corresponding compiler, and therefore installing a libgccjit with a
soname that matches the GCC major version.

The downside is having to rebuild packages built against libgccjit with
each major GCC version, but looking at the reverse dependencies, at
least for package builds, only emacs is using libgccjit.

My plan to use this feature is to build a libgccjit0 using the default
GCC (e.g. gcc-14), and a libgccjit15, when building a newer GCC. When
changing the GCC default to 15, building a libgccjit0 from gcc-15, and a
libgccjit14 from gcc-14.

When configuring without --enable-versioned-jit, the behavior is unchanged.

2025-03-13  Matthias Klose  <doko@ubuntu.com>

gcc/
	* configure.ac: Add option --enable-versioned-jit.
	* configure: Regenerate.
	* Makefile.in: Move from jit/Make-lang.in, setting value from
	configure.ac.
	* doc/install.texi: Document option --enable-versioned-jit.

gcc/jit/
	* Make-lang.in (LIBGCCJIT_VERSION_NUM): Move to ../Makefile.in.
5 files changed