Skip to content

Commit

Permalink
Backport Jakub Jelinek's GCC 7+ "major version only" patch
Browse files Browse the repository at this point in the history
This is part of my (tkchia's) effort to port gcc-ia16 to
DJGPP/MS-DOS.  MS-DOS (when run without long file name
support) does not like directory names with two dots in
them, e.g. "6.3.0".

Original commit message:

	PR other/79046
	* configure: Regenerated.
config/
	* acx.m4 (GCC_BASE_VER): New m4 function.
	(ACX_TOOL_DIRS): Require GCC_BASE_VER, for
	--with-gcc-major-version-only use just major number from BASE-VER.
gcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	(CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s).
	(gcc.o): Depend on $(BASEVER).
	* common.opt (dumpfullversion): New option.
	* gcc.c (driver_handle_option): Handle OPT_dumpfullversion.
	* doc/invoke.texi: Document -dumpfullversion.
	* doc/install.texi: Document --with-gcc-major-version-only.
	* configure: Regenerated.
libatomic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgomp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
libssp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
liboffloadmic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libquadmath/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libmpx/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libada/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
lto-plugin/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libitm/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
fixincludes/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libcilkrts/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libcc1/
	* configure.ac: Add GCC_BASE_VER.  For --with-gcc-major-version-only
	use just major number from BASE-VER.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libobjc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libstdc++-v3/
	* configure.ac: Add GCC_BASE_VER.
	* fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* po/Makefile.in: Regenerated.
	* libsupc++/Makefile.in: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* include/Makefile.in: Regenerated.
	* doc/Makefile.in: Regenerated.
	* python/Makefile.in: Regenerated.
	* src/c++11/Makefile.in: Regenerated.
	* src/c++98/Makefile.in: Regenerated.
	* src/filesystem/Makefile.in: Regenerated.
libvtv/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libsanitizer/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* libbacktrace/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* configure: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
libgfortran/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244521 138bc75d-0d04-0410-961f-82ee72b054a4
(cherry picked from commit 0812bb0)
  • Loading branch information
tkchia committed Apr 28, 2018
1 parent 381b693 commit 5853ef6
Show file tree
Hide file tree
Showing 99 changed files with 658 additions and 108 deletions.
28 changes: 27 additions & 1 deletion config/acx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,28 @@ fi
])


dnl ####
dnl # GCC_BASE_VER
dnl # Determine GCC version number to use in compiler directories.

AC_DEFUN([GCC_BASE_VER],
[
get_gcc_base_ver="cat"
AC_ARG_WITH(gcc-major-version-only,
[AS_HELP_STRING([--with-gcc-major-version-only], [use only GCC major number in filesystem paths])],
[if test x$with_gcc_major_version_only = xyes ; then
changequote(,)dnl
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
changequote([,])dnl
fi
])
AC_SUBST(get_gcc_base_ver)
])


AC_DEFUN([ACX_TOOL_DIRS], [
AC_REQUIRE([ACX_PATH_SEP])
AC_REQUIRE([GCC_BASE_VER])
if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
gcc_cv_tool_prefix=$ac_default_prefix
Expand All @@ -251,7 +271,13 @@ fi
# case, if there is no compiler in the tree nobody should use
# AS_FOR_TARGET and LD_FOR_TARGET.
if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
gcc_version=`cat $srcdir/gcc/BASE-VER`
if test x$with_gcc_major_version_only = xyes ; then
changequote(,)dnl
gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/gcc/BASE-VER`
changequote([,])dnl
else
gcc_version=`cat $srcdir/gcc/BASE-VER`
fi
gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
Expand Down
24 changes: 23 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ CXXFLAGS_FOR_TARGET
CFLAGS_FOR_TARGET
DEBUG_PREFIX_CFLAGS_FOR_TARGET
SYSROOT_CFLAGS_FOR_TARGET
get_gcc_base_ver
extra_host_zlib_configure_flags
extra_host_libiberty_configure_flags
stage1_languages
Expand Down Expand Up @@ -787,6 +788,7 @@ enable_linker_plugin_configure_flags
enable_linker_plugin_flags
enable_stage1_languages
enable_objc_gc
with_gcc_major_version_only
with_build_sysroot
with_debug_prefix_map
with_build_config
Expand Down Expand Up @@ -1556,6 +1558,8 @@ Optional Packages:
--with-isl-lib=PATH/lib
--with-isl-include=PATH Specify directory for installed isl include files
--with-isl-lib=PATH Specify the directory for the installed isl library
--with-gcc-major-version-only
use only GCC major number in filesystem paths
--with-build-sysroot=SYSROOT
use sysroot as the system root during the build
--with-debug-prefix-map='A=B C=D ...'
Expand Down Expand Up @@ -6716,6 +6720,20 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi


get_gcc_base_ver="cat"

# Check whether --with-gcc-major-version-only was given.
if test "${with_gcc_major_version_only+set}" = set; then :
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
fi

fi






if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
Expand All @@ -6731,7 +6749,11 @@ fi
# case, if there is no compiler in the tree nobody should use
# AS_FOR_TARGET and LD_FOR_TARGET.
if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
gcc_version=`cat $srcdir/gcc/BASE-VER`
if test x$with_gcc_major_version_only = xyes ; then
gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/gcc/BASE-VER`
else
gcc_version=`cat $srcdir/gcc/BASE-VER`
fi
gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
Expand Down
2 changes: 1 addition & 1 deletion fixincludes/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ target = @target@
target_noncanonical:=@target_noncanonical@

# The version of GCC in this tree
gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)

# Directory in which the compiler finds libraries etc.
libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
Expand Down
55 changes: 55 additions & 0 deletions fixincludes/configure
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ ac_includes_default="\

ac_subst_vars='LTLIBOBJS
LIBOBJS
get_gcc_base_ver
MAINT
TARGET
target_noncanonical
Expand Down Expand Up @@ -664,6 +665,7 @@ enable_werror_always
with_local_prefix
enable_twoprocess
enable_maintainer_mode
with_gcc_major_version_only
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1298,6 +1300,8 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-local-prefix=DIR specifies directory to put local include
--with-gcc-major-version-only
use only GCC major number in filesystem paths
Some influential environment variables:
CC C compiler command
Expand Down Expand Up @@ -4561,6 +4565,12 @@ $as_echo "$ac_cv_path_SED" >&6; }
# Figure out what compiler warnings we can enable.
# See config/warnings.m4 for details.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
WARN_CFLAGS=
save_CFLAGS="$CFLAGS"
for real_option in -W -Wall -Wwrite-strings -Wstrict-prototypes \
Expand Down Expand Up @@ -4607,6 +4617,18 @@ $as_echo "$ac_res" >&6; }
fi
done
CFLAGS="$save_CFLAGS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
WARN_PEDANTIC=
# Do the check with the no- prefix removed from the warning options
Expand Down Expand Up @@ -4645,10 +4667,22 @@ if test $acx_cv_prog_cc_pedantic__Wlong_long = yes; then :
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Only enable with --enable-werror-always until existing warnings are
# corrected.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
WERROR=
# Check whether --enable-werror-always was given.
if test "${enable_werror_always+set}" = set; then :
Expand All @@ -4661,6 +4695,12 @@ if test $enable_werror_always = yes; then :
WERROR="$WERROR${WERROR:+ }-Werror"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Determine the noncanonical target name, for directory use.
Expand Down Expand Up @@ -5354,6 +5394,21 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
# Determine what GCC version number to use in filesystem paths.
get_gcc_base_ver="cat"
# Check whether --with-gcc-major-version-only was given.
if test "${with_gcc_major_version_only+set}" = set; then :
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
fi
fi
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile mkheaders.almost:mkheaders.in"
Expand Down
3 changes: 3 additions & 0 deletions fixincludes/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ AC_SUBST(MAINT)
AC_DEFINE_UNQUOTED([SED_PROGRAM], "${SED}",
[Defined to the best working sed program on the host system])

# Determine what GCC version number to use in filesystem paths.
GCC_BASE_VER

AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)
AC_OUTPUT
5 changes: 3 additions & 2 deletions gcc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ else
REVISION_c := $(shell cat $(REVISION))
endif

version := $(BASEVER_c)
version := $(shell @get_gcc_base_ver@ $(BASEVER))

PATCHLEVEL_c := \
$(shell echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/')
Expand Down Expand Up @@ -2035,7 +2035,8 @@ DRIVER_DEFINES = \
$(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \
-DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\""

CFLAGS-gcc.o += $(DRIVER_DEFINES)
CFLAGS-gcc.o += $(DRIVER_DEFINES) -DBASEVER=$(BASEVER_s)
gcc.o: $(BASEVER)

specs.h : s-specs ; @true
s-specs : Makefile
Expand Down
3 changes: 3 additions & 0 deletions gcc/common.opt
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ Driver
dumpversion
Driver

dumpfullversion
Driver

e
Driver Joined Separate

Expand Down
23 changes: 21 additions & 2 deletions gcc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ INCINTL
LIBINTL_DEP
LIBINTL
USE_NLS
get_gcc_base_ver
extra_opt_files
extra_modes_file
NATIVE_SYSTEM_HEADER_DIR
Expand Down Expand Up @@ -915,6 +916,7 @@ with_multilib_list
enable_rpath
with_libiconv_prefix
enable_sjlj_exceptions
with_gcc_major_version_only
enable_secureplt
enable_leading_mingw64_underscores
enable_cld
Expand Down Expand Up @@ -1717,6 +1719,8 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix don't search for libiconv in includedir and libdir
--with-gcc-major-version-only
use only GCC major number in filesystem paths
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
Expand Down Expand Up @@ -11885,6 +11889,21 @@ static struct plugin_gcc_version gcc_version = {basever, datestamp,
configuration_arguments};
EOF

# Determine what GCC version number to use in filesystem paths.

get_gcc_base_ver="cat"

# Check whether --with-gcc-major-version-only was given.
if test "${with_gcc_major_version_only+set}" = set; then :
withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
get_gcc_base_ver="sed -e 's/^\([0-9]*\).*\$\$/\1/'"
fi

fi




# Internationalization
# If we haven't got the data from the intl directory,
# assume NLS is disabled.
Expand Down Expand Up @@ -18460,7 +18479,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18463 "configure"
#line 18482 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -18566,7 +18585,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18569 "configure"
#line 18588 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down
3 changes: 3 additions & 0 deletions gcc/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,9 @@ static struct plugin_gcc_version gcc_version = {basever, datestamp,
EOF
changequote([,])dnl

# Determine what GCC version number to use in filesystem paths.
GCC_BASE_VER

# Internationalization
ZW_GNU_GETTEXT_SISTER_DIR

Expand Down
4 changes: 4 additions & 0 deletions gcc/doc/install.texi
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ ideas of what it is for. People use it as if it specified where to
install part of GCC@. Perhaps they make this assumption because
installing GCC creates the directory.

@item --with-gcc-major-version-only
Specifies that GCC should use only the major number rather than
@var{major}.@var{minor}.@var{patchlevel} in filesystem paths.

@item --with-native-system-header-dir=@var{dirname}
Specifies that @var{dirname} is the directory that contains native system
header files, rather than @file{/usr/include}. This option is most useful
Expand Down
16 changes: 13 additions & 3 deletions gcc/doc/invoke.texi
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ Objective-C and Objective-C++ Dialects}.
@item Developer Options
@xref{Developer Options,,GCC Developer Options}.
@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
-fchecking -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
-dumpfullversion -fchecking -fdbg-cnt-list @gol
-fdbg-cnt=@var{counter-value-list} @gol
-fdisable-ipa-@var{pass_name} @gol
-fdisable-rtl-@var{pass_name} @gol
-fdisable-rtl-@var{pass-name}=@var{range-list} @gol
Expand Down Expand Up @@ -12730,8 +12731,17 @@ Print the compiler's target machine (for example,

@item -dumpversion
@opindex dumpversion
Print the compiler version (for example, @code{3.0})---and don't do
anything else.
Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
anything else. This is the compiler version used in filesystem paths,
specs, can be depending on how the compiler has been configured just
a single number (major version), two numbers separated by dot (major and
minor version) or three numbers separated by dots (major, minor and patchlevel
version).

@item -dumpfullversion
@opindex dumpfullversion
Print the full compiler version, always 3 numbers separated by dots,
major, minor and patchlevel version.

@item -dumpspecs
@opindex dumpspecs
Expand Down
4 changes: 4 additions & 0 deletions gcc/gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3735,6 +3735,10 @@ driver_handle_option (struct gcc_options *opts,
printf ("%s\n", spec_machine);
exit (0);

case OPT_dumpfullversion:
printf ("%s\n", BASEVER);
exit (0);

case OPT__version:
print_version = 1;

Expand Down
Loading

3 comments on commit 5853ef6

@mirabilos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-level configure.ac patch missing?

@tkchia
Copy link
Owner Author

@tkchia tkchia commented on 5853ef6 Mar 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helo @mirabilos, apparently Jelinek's patch did not need to alter the top-level configure.ac. The --with-gcc-major-version-only option is added in config/acx.m4, which configure.ac uses. Thank you!

@mirabilos
Copy link

@mirabilos mirabilos commented on 5853ef6 Mar 8, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.