diff --git a/config/acx.m4 b/config/acx.m4 index 9ff31eb85f3d4..30de5c6d93d2c 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -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 @@ -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" diff --git a/configure b/configure index 35f231ea92bda..f4781c33b7cc9 100755 --- a/configure +++ b/configure @@ -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 @@ -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 @@ -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 ...' @@ -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 @@ -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" diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in index 5dc1b23bc868c..1937dcaa32d5f 100644 --- a/fixincludes/Makefile.in +++ b/fixincludes/Makefile.in @@ -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) diff --git a/fixincludes/configure b/fixincludes/configure index 4836cd886537e..ab97983f327d4 100755 --- a/fixincludes/configure +++ b/fixincludes/configure @@ -590,6 +590,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +get_gcc_base_ver MAINT TARGET target_noncanonical @@ -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 @@ -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 @@ -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 \ @@ -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 @@ -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 : @@ -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. @@ -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" diff --git a/fixincludes/configure.ac b/fixincludes/configure.ac index f8f352fb71534..190f53828744d 100644 --- a/fixincludes/configure.ac +++ b/fixincludes/configure.ac @@ -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 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 13d0d1ba0017f..fa894f40fcc55 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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/') @@ -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 diff --git a/gcc/common.opt b/gcc/common.opt index 67048db7c9baf..f81660a4984fc 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -823,6 +823,9 @@ Driver dumpversion Driver +dumpfullversion +Driver + e Driver Joined Separate diff --git a/gcc/configure b/gcc/configure index 954673c1c4361..fdf3e0cf7b126 100755 --- a/gcc/configure +++ b/gcc/configure @@ -733,6 +733,7 @@ INCINTL LIBINTL_DEP LIBINTL USE_NLS +get_gcc_base_ver extra_opt_files extra_modes_file NATIVE_SYSTEM_HEADER_DIR @@ -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 @@ -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] @@ -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. @@ -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 @@ -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 diff --git a/gcc/configure.ac b/gcc/configure.ac index 4c65d441e72fb..8c9cde557f58c 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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 diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index a77adc5e27859..98885037a63cc 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -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 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 02ff58e8d1261..84942a8e8405e 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 @@ -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 diff --git a/gcc/gcc.c b/gcc/gcc.c index 0f042b0f12f76..c78f81e960960 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -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; diff --git a/libada/Makefile.in b/libada/Makefile.in index 89c566b11cd42..e8211cabc8c8b 100644 --- a/libada/Makefile.in +++ b/libada/Makefile.in @@ -67,7 +67,7 @@ host_subdir = @host_subdir@ GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc target_noncanonical:=@target_noncanonical@ -version := $(shell cat $(srcdir)/../gcc/BASE-VER) +version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR)) diff --git a/libada/configure b/libada/configure index 2296096d4d242..7f759da4a35eb 100755 --- a/libada/configure +++ b/libada/configure @@ -553,6 +553,7 @@ PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS +get_gcc_base_ver have_getipinfo default_gnatlib_target LN_S @@ -633,6 +634,7 @@ enable_maintainer_mode enable_multilib enable_shared with_system_libunwind +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1261,6 +1263,8 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-libsubdir=DIR Directory where to find libraries for build system --with-system-libunwind use installed libunwind + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -3008,6 +3012,21 @@ if test x$have_unwind_getipinfo = xyes; then fi +# 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 + + + + # Output: create a Makefile. ac_config_files="$ac_config_files Makefile" diff --git a/libada/configure.ac b/libada/configure.ac index 04e06fe282167..b2274deb5fc60 100644 --- a/libada/configure.ac +++ b/libada/configure.ac @@ -144,6 +144,9 @@ if test x$have_unwind_getipinfo = xyes; then fi AC_SUBST(have_getipinfo) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + # Output: create a Makefile. AC_CONFIG_FILES([Makefile]) diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am index b35124428509c..cf9c2b9900fdd 100644 --- a/libatomic/Makefile.am +++ b/libatomic/Makefile.am @@ -26,7 +26,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) config_path= @config_path@ search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) \ diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index a083d8702e44b..f6eeab312ea2a 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -259,6 +259,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -298,7 +299,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) \ $(top_srcdir) $(top_builddir) diff --git a/libatomic/configure b/libatomic/configure index 8526abff90f2b..0b8b60fe81f60 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -601,6 +601,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver ARCH_X86_64_FALSE ARCH_X86_64_TRUE ARCH_I386_FALSE @@ -763,6 +764,7 @@ with_gnu_ld enable_libtool_lock enable_maintainer_mode enable_symvers +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1415,6 +1417,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -9083,7 +9087,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11111,7 +11115,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11114 "configure" +#line 11118 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11217,7 +11221,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11220 "configure" +#line 11224 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15256,6 +15260,21 @@ else fi +# 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 + + + + if test ${multilib} = yes; then multilib_arg="--enable-multilib" else diff --git a/libatomic/configure.ac b/libatomic/configure.ac index cf40ea19a999f..c4445b1f0d356 100644 --- a/libatomic/configure.ac +++ b/libatomic/configure.ac @@ -254,6 +254,9 @@ AM_CONDITIONAL(ARCH_I386, AM_CONDITIONAL(ARCH_X86_64, [test "$ARCH" = x86 && test x$libat_cv_wordsize = x8]) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + if test ${multilib} = yes; then multilib_arg="--enable-multilib" else diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in index 34f83e0c915c2..f0928b2f3dcc7 100644 --- a/libatomic/testsuite/Makefile.in +++ b/libatomic/testsuite/Makefile.in @@ -174,6 +174,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in index 79d39d3f46a2e..21fb1536d89b4 100644 --- a/libcc1/Makefile.in +++ b/libcc1/Makefile.in @@ -236,6 +236,7 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gcc_version = @gcc_version@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libcc1/configure b/libcc1/configure index bf112bb4671ca..d6f480fe930d3 100755 --- a/libcc1/configure +++ b/libcc1/configure @@ -610,6 +610,7 @@ WERROR WARN_FLAGS CONFIG_STATUS_DEPENDENCIES gcc_version +get_gcc_base_ver visibility CXXCPP am__fastdepCXX_FALSE @@ -747,6 +748,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only enable_werror_always enable_plugin ' @@ -1403,6 +1405,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -10540,7 +10544,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10543 "configure" +#line 10547 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10646,7 +10650,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10649 "configure" +#line 10653 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14305,7 +14309,25 @@ cat >>confdefs.h <<_ACEOF _ACEOF -gcc_version=`cat $srcdir/../gcc/BASE-VER` + + 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$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 CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/../gcc/BASE-VER' diff --git a/libcc1/configure.ac b/libcc1/configure.ac index e2e3fdae0b4e3..e4ae20a37e732 100644 --- a/libcc1/configure.ac +++ b/libcc1/configure.ac @@ -48,7 +48,15 @@ AC_SUBST(visibility) AC_CHECK_DECLS([basename]) -gcc_version=`cat $srcdir/../gcc/BASE-VER` +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 AC_SUBST(gcc_version) AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/../gcc/BASE-VER']) diff --git a/libcilkrts/Makefile.am b/libcilkrts/Makefile.am index 4f944dd1a6248..543c3fc4600e8 100644 --- a/libcilkrts/Makefile.am +++ b/libcilkrts/Makefile.am @@ -51,7 +51,7 @@ AM_CPPFLAGS = $(GENERAL_FLAGS) AM_LDFLAGS = $(XLDFLAGS) # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Target list. nodist_toolexeclib_HEADERS = libcilkrts.spec diff --git a/libcilkrts/Makefile.in b/libcilkrts/Makefile.in index a25d1c6f50ea0..bfcec1649707f 100644 --- a/libcilkrts/Makefile.in +++ b/libcilkrts/Makefile.in @@ -143,9 +143,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ - $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ - $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -325,6 +326,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -381,7 +383,7 @@ AM_CPPFLAGS = $(GENERAL_FLAGS) AM_LDFLAGS = $(XLDFLAGS) # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Target list. nodist_toolexeclib_HEADERS = libcilkrts.spec diff --git a/libcilkrts/aclocal.m4 b/libcilkrts/aclocal.m4 index a46868106bae2..71023b2c723e0 100644 --- a/libcilkrts/aclocal.m4 +++ b/libcilkrts/aclocal.m4 @@ -992,6 +992,7 @@ m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) m4_include([../config/multi.m4]) m4_include([../config/override.m4]) +m4_include([../config/acx.m4]) m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) diff --git a/libcilkrts/configure b/libcilkrts/configure index 4e1d459f8125d..9b89da3b1562e 100644 --- a/libcilkrts/configure +++ b/libcilkrts/configure @@ -604,6 +604,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver link_cilkrts XLDFLAGS XCFLAGS @@ -749,6 +750,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1404,6 +1406,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -9036,7 +9040,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11064,7 +11068,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11067 "configure" +#line 11071 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11170,7 +11174,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11173 "configure" +#line 11177 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13522,7 +13526,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -14530,6 +14534,20 @@ else fi +# 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 + + + # Must be last cat >confcache <<\_ACEOF diff --git a/libcilkrts/configure.ac b/libcilkrts/configure.ac index 8ad647ea8e77a..cad61747ff1bd 100644 --- a/libcilkrts/configure.ac +++ b/libcilkrts/configure.ac @@ -231,6 +231,8 @@ else fi AC_SUBST(link_cilkrts) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER # Must be last AC_OUTPUT diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index f09b39b0e85fd..47f071a2396f8 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -214,7 +214,7 @@ export slibdir export toolexecdir export toolexeclibdir -version := $(shell cat $(srcdir)/../gcc/BASE-VER) +version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) ifeq ($(decimal_float),yes) ifeq ($(enable_decimal_float),bid) diff --git a/libgcc/configure b/libgcc/configure index e7d6c75a6f76e..3b1384c4b5086 100644 --- a/libgcc/configure +++ b/libgcc/configure @@ -558,6 +558,7 @@ LIBOBJS asm_hidden_op extra_parts cpu_type +get_gcc_base_ver thread_header tm_defines tm_file @@ -673,6 +674,7 @@ with_system_libunwind enable_explicit_exception_frame_registration with_glibc_version enable_tls +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1327,6 +1329,8 @@ Optional Packages: --with-system-libunwind use installed libunwind --with-glibc-version=M.N assume GCC used with glibc version M.N or later + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -5081,6 +5085,21 @@ esac +# 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 + + + + # Substitute configuration variables diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 269997f23e25e..24a5a0dff32ec 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -544,6 +544,9 @@ AC_SUBST(tm_defines) # Map from thread model to thread header. GCC_AC_THREAD_HEADER([$target_thread_file]) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + # Substitute configuration variables AC_SUBST(cpu_type) AC_SUBST(extra_parts) diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index 39d3e11d223ca..a8ecf851c1c3e 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) ## Symbol versioning (copied from libssp). if LIBGFOR_USE_SYMVER diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 7ed080cf7b0d4..e5c1688a33be7 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -543,6 +543,7 @@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ extra_ldflags_libgfortran = @extra_ldflags_libgfortran@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -584,7 +585,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) @LIBGFOR_USE_SYMVER_FALSE@version_arg = @LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.map-sun diff --git a/libgfortran/configure b/libgfortran/configure index f746f6f5d1d67..731e76ff6833f 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -605,6 +605,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver IEEE_FLAGS IEEE_SUPPORT IEEE_SUPPORT_FALSE @@ -776,6 +777,7 @@ with_gnu_ld enable_libtool_lock enable_largefile enable_libquadmath_support +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1434,6 +1436,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -10308,7 +10312,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -12363,7 +12367,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12366 "configure" +#line 12370 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12469,7 +12473,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12472 "configure" +#line 12476 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14157,7 +14161,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -26172,6 +26176,21 @@ $as_echo "#define HAVE_CRLF 1" >>confdefs.h fi +# 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 + + + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 8f377bb4b50c2..5c68a2d422be5 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -607,6 +607,9 @@ LIBGFOR_CHECK_UNLINK_OPEN_FILE # Check whether line terminator is LF or CRLF LIBGFOR_CHECK_CRLF +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CACHE_SAVE if test ${multilib} = yes; then diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am index a3e1c2b2c0f47..d34682739634f 100644 --- a/libgomp/Makefile.am +++ b/libgomp/Makefile.am @@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) config_path = @config_path@ search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) \ diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in index 88c8517fddd66..082582e94d480 100644 --- a/libgomp/Makefile.in +++ b/libgomp/Makefile.in @@ -17,7 +17,7 @@ # Plugins for offload execution, Makefile.am fragment. # -# Copyright (C) 2014-2016 Free Software Foundation, Inc. +# Copyright (C) 2014-2017 Free Software Foundation, Inc. # # Contributed by Mentor Embedded. # @@ -359,6 +359,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -402,7 +403,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) \ $(top_srcdir)/../include diff --git a/libgomp/configure b/libgomp/configure index 8d03eb6cddce9..bbebc959b0c29 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -601,6 +601,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver OMP_NEST_LOCK_25_KIND OMP_LOCK_25_KIND OMP_NEST_LOCK_25_ALIGN @@ -798,6 +799,7 @@ with_hsa_kmt_lib enable_linux_futex enable_tls enable_symvers +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1477,6 +1479,8 @@ Optional Packages: specify directory for the installed HSA run-time library --with-hsa-kmt-lib=PATH specify directory for installed HSA KMT library. + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -11145,7 +11149,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11148 "configure" +#line 11152 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11251,7 +11255,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11254 "configure" +#line 11258 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16747,6 +16751,21 @@ fi CFLAGS="$save_CFLAGS" +# 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_files="$ac_config_files omp.h omp_lib.h omp_lib.f90 libgomp_f.h" ac_config_files="$ac_config_files Makefile testsuite/Makefile libgomp.spec" diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 2e41ca8aee53a..09831980e244a 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -366,6 +366,9 @@ AC_SUBST(OMP_LOCK_25_KIND) AC_SUBST(OMP_NEST_LOCK_25_KIND) CFLAGS="$save_CFLAGS" +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h) AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec) AC_CONFIG_FILES([testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in]) diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in index 4dbb406545078..ca7ab98ec301a 100644 --- a/libgomp/testsuite/Makefile.in +++ b/libgomp/testsuite/Makefile.in @@ -202,6 +202,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libitm/Makefile.am b/libitm/Makefile.am index 1dce82d62f13c..5b4aad8836b08 100644 --- a/libitm/Makefile.am +++ b/libitm/Makefile.am @@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) abi_version = -fabi-version=4 diff --git a/libitm/Makefile.in b/libitm/Makefile.in index 138eeb1c9da1b..2c7ed470a6928 100644 --- a/libitm/Makefile.in +++ b/libitm/Makefile.in @@ -292,6 +292,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -331,7 +332,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = testsuite -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) abi_version = -fabi-version=4 search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/finclude diff --git a/libitm/configure b/libitm/configure index 55332bb9de833..ba713185ebc73 100644 --- a/libitm/configure +++ b/libitm/configure @@ -601,6 +601,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver ARCH_FUTEX_FALSE ARCH_FUTEX_TRUE ARCH_X86_AVX_FALSE @@ -776,6 +777,7 @@ enable_maintainer_mode enable_linux_futex enable_tls enable_symvers +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1431,6 +1433,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -9762,7 +9766,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11790,7 +11794,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11793 "configure" +#line 11797 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11896,7 +11900,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11899 "configure" +#line 11903 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14248,7 +14252,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -17636,6 +17640,21 @@ else fi +# 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_files="$ac_config_files Makefile testsuite/Makefile libitm.spec" cat >confcache <<\_ACEOF diff --git a/libitm/configure.ac b/libitm/configure.ac index 3875aa0b47df1..7c0bbb0dab8b7 100644 --- a/libitm/configure.ac +++ b/libitm/configure.ac @@ -286,5 +286,8 @@ AM_CONDITIONAL([ARCH_X86], [test "$ARCH" = x86]) AM_CONDITIONAL([ARCH_X86_AVX], [test "$libitm_cv_as_avx" = yes]) AM_CONDITIONAL([ARCH_FUTEX], [test $enable_linux_futex = yes]) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_FILES(Makefile testsuite/Makefile libitm.spec) AC_OUTPUT diff --git a/libitm/testsuite/Makefile.in b/libitm/testsuite/Makefile.in index 4d797813caaa5..a9967e5cdd128 100644 --- a/libitm/testsuite/Makefile.in +++ b/libitm/testsuite/Makefile.in @@ -184,6 +184,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libmpx/Makefile.am b/libmpx/Makefile.am index bd0a8b6f93ccd..9ec6ec7db61c8 100644 --- a/libmpx/Makefile.am +++ b/libmpx/Makefile.am @@ -9,7 +9,7 @@ nodist_toolexeclib_HEADERS = libmpx.spec endif ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libmpx/Makefile.in b/libmpx/Makefile.in index d644af365269b..9b1d7a6c31f44 100644 --- a/libmpx/Makefile.in +++ b/libmpx/Makefile.in @@ -255,7 +255,7 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config @LIBMPX_SUPPORTED_TRUE@SUBDIRS = mpxrt $(am__append_1) @LIBMPX_SUPPORTED_TRUE@nodist_toolexeclib_HEADERS = libmpx.spec -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libmpx/configure b/libmpx/configure index 16d0dd85d3d70..675e5f8e138d8 100644 --- a/libmpx/configure +++ b/libmpx/configure @@ -9202,7 +9202,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11585,6 +11585,9 @@ else multilib_arg= fi +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + ac_config_files="$ac_config_files Makefile libmpx.spec" ac_config_headers="$ac_config_headers config.h" diff --git a/libmpx/configure.ac b/libmpx/configure.ac index 18ba6872035b1..baa882b16b048 100644 --- a/libmpx/configure.ac +++ b/libmpx/configure.ac @@ -125,6 +125,9 @@ else multilib_arg= fi +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_FILES([Makefile libmpx.spec]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt mpxwrap], [DIR/Makefile ]), diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in index b61823c582770..e89eaa951aba8 100644 --- a/libobjc/Makefile.in +++ b/libobjc/Makefile.in @@ -31,7 +31,7 @@ VPATH = @glibcpp_srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ target_noncanonical = @target_noncanonical@ -gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) host_subdir = @host_subdir@ top_srcdir = @top_srcdir@ multi_basedir = @multi_basedir@ diff --git a/libobjc/configure b/libobjc/configure index 55fcc33dbe2dd..e664203e16f87 100755 --- a/libobjc/configure +++ b/libobjc/configure @@ -600,6 +600,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +get_gcc_base_ver SET_MAKE CPP OTOOL64 @@ -721,6 +722,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_tls +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1365,6 +1367,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -8543,7 +8547,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10598,7 +10602,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10601 "configure" +#line 10605 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10704,7 +10708,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10707 "configure" +#line 10711 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11499,6 +11503,21 @@ $as_echo "#define HAVE_BITFIELD_TYPE_MATTERS 1" >>confdefs.h fi +# 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 + + + + # ------ # Output # ------ diff --git a/libobjc/configure.ac b/libobjc/configure.ac index 9dbc16cb9a882..1c0a33c5cbb83 100644 --- a/libobjc/configure.ac +++ b/libobjc/configure.ac @@ -214,6 +214,9 @@ GCC_CHECK_TLS gt_BITFIELD_TYPE_MATTERS +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + # ------ # Output # ------ diff --git a/liboffloadmic/Makefile.am b/liboffloadmic/Makefile.am index b1454513a0986..0df694477ce9e 100644 --- a/liboffloadmic/Makefile.am +++ b/liboffloadmic/Makefile.am @@ -42,7 +42,7 @@ libgomp_dir = $(build_dir)/../libgomp source_dir = $(top_srcdir)/runtime # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include # Target list. diff --git a/liboffloadmic/Makefile.in b/liboffloadmic/Makefile.in index 74fb3d27180a0..b2cd7d510f52d 100644 --- a/liboffloadmic/Makefile.in +++ b/liboffloadmic/Makefile.in @@ -93,9 +93,10 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/override.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ - $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ - $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/../config/acx.m4 $(top_srcdir)/../libtool.m4 \ + $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ + $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -355,6 +356,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -408,7 +410,7 @@ libgomp_dir = $(build_dir)/../libgomp source_dir = $(top_srcdir)/runtime # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include @LIBOFFLOADMIC_HOST_FALSE@nodist_toolexeclib_HEADERS = liboffloadmic_target.spec diff --git a/liboffloadmic/aclocal.m4 b/liboffloadmic/aclocal.m4 index a46868106bae2..71023b2c723e0 100644 --- a/liboffloadmic/aclocal.m4 +++ b/liboffloadmic/aclocal.m4 @@ -992,6 +992,7 @@ m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) m4_include([../config/multi.m4]) m4_include([../config/override.m4]) +m4_include([../config/acx.m4]) m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) diff --git a/liboffloadmic/configure b/liboffloadmic/configure index bcec118fb748a..01c7648ffa296 100644 --- a/liboffloadmic/configure +++ b/liboffloadmic/configure @@ -602,6 +602,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver link_offloadmic_target link_offloadmic_host lt_cv_dlopen_libs @@ -744,6 +745,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1398,6 +1400,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -9076,7 +9080,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11104,7 +11108,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11107 "configure" +#line 11111 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11210,7 +11214,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11213 "configure" +#line 11217 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13562,7 +13566,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -14481,6 +14485,21 @@ fi +# 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 + + + + # Must be last cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17076,7 +17095,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.ac"; then + elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else diff --git a/liboffloadmic/configure.ac b/liboffloadmic/configure.ac index 81fae8f9441c0..64728f1a1a7fb 100644 --- a/liboffloadmic/configure.ac +++ b/liboffloadmic/configure.ac @@ -128,5 +128,8 @@ fi AC_SUBST(link_offloadmic_host) AC_SUBST(link_offloadmic_target) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + # Must be last AC_OUTPUT diff --git a/libquadmath/Makefile.am b/libquadmath/Makefile.am index 5c4d3e2ece1e9..ec23c66f6b19c 100644 --- a/libquadmath/Makefile.am +++ b/libquadmath/Makefile.am @@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config AM_CPPFLAGS = -I $(top_srcdir)/../include ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) ## Symbol versioning (copied from libssp). if LIBQUAD_USE_SYMVER diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in index 94e8014d175a5..428e0158aca30 100644 --- a/libquadmath/Makefile.in +++ b/libquadmath/Makefile.in @@ -300,6 +300,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -340,7 +341,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.8 foreign @BUILD_LIBQUADMATH_TRUE@ACLOCAL_AMFLAGS = -I .. -I ../config @BUILD_LIBQUADMATH_TRUE@AM_CPPFLAGS = -I $(top_srcdir)/../include -@BUILD_LIBQUADMATH_TRUE@gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +@BUILD_LIBQUADMATH_TRUE@gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) @BUILD_LIBQUADMATH_TRUE@@LIBQUAD_USE_SYMVER_FALSE@version_arg = @BUILD_LIBQUADMATH_TRUE@@LIBQUAD_USE_SYMVER_GNU_TRUE@@LIBQUAD_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/quadmath.map @BUILD_LIBQUADMATH_TRUE@@LIBQUAD_USE_SYMVER_SUN_TRUE@@LIBQUAD_USE_SYMVER_TRUE@version_arg = -Wl,-M,quadmath.map-sun diff --git a/libquadmath/configure b/libquadmath/configure index 851302e722b07..eccb8b17d0450 100755 --- a/libquadmath/configure +++ b/libquadmath/configure @@ -601,6 +601,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver GENINSRC_FALSE GENINSRC_TRUE BUILD_LIBQUADMATH_FALSE @@ -750,6 +751,7 @@ enable_libtool_lock enable_maintainer_mode enable_symvers enable_generated_files_in_srcdir +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1406,6 +1408,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -8513,7 +8517,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10568,7 +10572,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10571 "configure" +#line 10575 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10674,7 +10678,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10677 "configure" +#line 10681 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12918,6 +12922,20 @@ else fi +# 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_files="$ac_config_files Makefile" diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac index eb4fe8c8dfce1..6d03c78f7985c 100644 --- a/libquadmath/configure.ac +++ b/libquadmath/configure.ac @@ -364,6 +364,8 @@ AS_HELP_STRING([--enable-generated-files-in-srcdir], AC_MSG_RESULT($enable_generated_files_in_srcdir) AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am index 6b0c571c46efa..6afb2b0e048eb 100644 --- a/libsanitizer/Makefile.am +++ b/libsanitizer/Makefile.am @@ -24,7 +24,7 @@ endif endif ## May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in index b362a897fd101..7be5f1b2ea241 100644 --- a/libsanitizer/Makefile.in +++ b/libsanitizer/Makefile.in @@ -244,6 +244,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -290,7 +291,7 @@ nodist_saninclude_HEADERS = $(am__append_1) @SANITIZER_SUPPORTED_TRUE@SUBDIRS = sanitizer_common $(am__append_2) \ @SANITIZER_SUPPORTED_TRUE@ $(am__append_3) lsan asan ubsan \ @SANITIZER_SUPPORTED_TRUE@ $(am__append_4) -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in index 881d1d394d5be..b8e37ddf961c9 100644 --- a/libsanitizer/asan/Makefile.in +++ b/libsanitizer/asan/Makefile.in @@ -253,6 +253,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/configure b/libsanitizer/configure index 040ded0abc60b..6aff1e6218e43 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -604,6 +604,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver TSAN_TARGET_DEPENDENT_OBJECTS LIBBACKTRACE_SUPPORTED_FALSE LIBBACKTRACE_SUPPORTED_TRUE @@ -772,6 +773,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1426,6 +1428,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -12028,7 +12032,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12031 "configure" +#line 12035 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12134,7 +12138,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12137 "configure" +#line 12141 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16532,6 +16536,21 @@ fi +# 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 + + + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index 063b1d64c257a..48aacd181ee5c 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -400,4 +400,7 @@ fi AC_SUBST([TSAN_TARGET_DEPENDENT_OBJECTS]) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_OUTPUT diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in index c7ccb51a177fa..240eb1a8638a1 100644 --- a/libsanitizer/interception/Makefile.in +++ b/libsanitizer/interception/Makefile.in @@ -203,6 +203,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/libbacktrace/Makefile.in b/libsanitizer/libbacktrace/Makefile.in index 57eaaf0f3cf28..00d6f9d70f26d 100644 --- a/libsanitizer/libbacktrace/Makefile.in +++ b/libsanitizer/libbacktrace/Makefile.in @@ -245,6 +245,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in index 4802ed43971ba..10c3ecad953a1 100644 --- a/libsanitizer/lsan/Makefile.in +++ b/libsanitizer/lsan/Makefile.in @@ -244,6 +244,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in index 765efd186d38a..bae5c37ec0fda 100644 --- a/libsanitizer/sanitizer_common/Makefile.in +++ b/libsanitizer/sanitizer_common/Makefile.in @@ -232,6 +232,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in index 14a4202e32775..7974e6a853239 100644 --- a/libsanitizer/tsan/Makefile.in +++ b/libsanitizer/tsan/Makefile.in @@ -259,6 +259,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in index f5b06d06d41b9..aaca35673a819 100644 --- a/libsanitizer/ubsan/Makefile.in +++ b/libsanitizer/ubsan/Makefile.in @@ -242,6 +242,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/libssp/Makefile.am b/libssp/Makefile.am index 5a2ecac1f45a1..261b9a15172e8 100644 --- a/libssp/Makefile.am +++ b/libssp/Makefile.am @@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config MAINT_CHARSET = latin1 # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) if LIBSSP_USE_SYMVER if LIBSSP_USE_SYMVER_GNU diff --git a/libssp/Makefile.in b/libssp/Makefile.in index 4509e301ebee1..96b03ae124812 100644 --- a/libssp/Makefile.in +++ b/libssp/Makefile.in @@ -235,6 +235,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -278,7 +279,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config MAINT_CHARSET = latin1 # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) @LIBSSP_USE_SYMVER_FALSE@version_arg = @LIBSSP_USE_SYMVER_GNU_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map @LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,-M,ssp.map-sun diff --git a/libssp/configure b/libssp/configure index 44b00bad10f06..19b7237688fc2 100755 --- a/libssp/configure +++ b/libssp/configure @@ -602,6 +602,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver toolexeclibdir toolexecdir enable_static @@ -742,6 +743,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1387,6 +1389,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -8612,7 +8616,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10667,7 +10671,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10670 "configure" +#line 10674 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10773,7 +10777,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10776 "configure" +#line 10780 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11071,6 +11075,21 @@ else multilib_arg= fi +# 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_files="$ac_config_files Makefile ssp/ssp.h" cat >confcache <<\_ACEOF diff --git a/libssp/configure.ac b/libssp/configure.ac index 93dfa8da47042..9e4a22a24d47e 100644 --- a/libssp/configure.ac +++ b/libssp/configure.ac @@ -195,5 +195,8 @@ else multilib_arg= fi +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_FILES([Makefile ssp/ssp.h]) AC_OUTPUT diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 3159b714a1a47..d1e05a1fe65de 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -260,6 +260,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -316,7 +317,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 19173eb74f38c..723a6228b80dd 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -602,6 +602,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver WARN_FLAGS OPTIMIZE_CXXFLAGS TOPLEVEL_INCLUDES @@ -896,6 +897,7 @@ enable_libstdcxx_threads enable_libstdcxx_filesystem_ts with_gxx_include_dir enable_version_specific_runtime_libs +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1615,6 +1617,8 @@ Optional Packages: set the std::string ABI to use by default --with-gxx-include-dir=DIR installation directory for include files + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -11596,7 +11600,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11599 "configure" +#line 11603 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11702,7 +11706,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11705 "configure" +#line 11709 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15388,7 +15392,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15391 "configure" +#line 15395 "configure" int main() { typedef bool atomic_type; @@ -15423,7 +15427,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15426 "configure" +#line 15430 "configure" int main() { typedef short atomic_type; @@ -15458,7 +15462,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15461 "configure" +#line 15465 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15494,7 +15498,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15497 "configure" +#line 15501 "configure" int main() { typedef long long atomic_type; @@ -15575,7 +15579,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15578 "configure" +#line 15582 "configure" int main() { _Decimal32 d1; @@ -15617,7 +15621,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15620 "configure" +#line 15624 "configure" template struct same { typedef T2 type; }; @@ -15651,7 +15655,7 @@ $as_echo "$enable_int128" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15654 "configure" +#line 15658 "configure" template struct same { typedef T2 type; }; @@ -81429,6 +81433,21 @@ $as_echo "$gxx_include_dir" >&6; } +# 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_files="$ac_config_files Makefile" ac_config_files="$ac_config_files scripts/testsuite_flags" diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 9e19e9927fd1b..ac63b63373845 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -498,6 +498,9 @@ GLIBCXX_EXPORT_INSTALL_INFO GLIBCXX_EXPORT_INCLUDES GLIBCXX_EXPORT_FLAGS +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros, dnl which can all be called multiple times as needed, plus one (different) dnl AC_OUTPUT macro. This one lists the files to be created: diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index 3e729c130e76c..86e9c1c43d5fb 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -234,6 +234,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -298,7 +299,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/fragment.am b/libstdc++-v3/fragment.am index 03eb753536dfc..b380020eaaa41 100644 --- a/libstdc++-v3/fragment.am +++ b/libstdc++-v3/fragment.am @@ -2,7 +2,7 @@ ## This is used in all Makefile.am's. Set defaults here. # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 751f16b037e7d..a41ee563b4df9 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -232,6 +232,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -288,7 +289,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index f3648ac475c37..187b4e1602d84 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -303,6 +303,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -359,7 +360,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index 13993c85819e2..02a96b3f9ba4c 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -232,6 +232,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -288,7 +289,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in index 25b2ed487b258..c722b3d8a8861 100644 --- a/libstdc++-v3/python/Makefile.in +++ b/libstdc++-v3/python/Makefile.in @@ -262,6 +262,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -318,7 +319,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 75a207a5e7d9c..03361fe5f10d9 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -295,6 +295,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -351,7 +352,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in index 5a24cb0a6cba8..003e742c2a3bc 100644 --- a/libstdc++-v3/src/c++11/Makefile.in +++ b/libstdc++-v3/src/c++11/Makefile.in @@ -265,6 +265,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -321,7 +322,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in index 3c3bbbd17f72f..ad14e56c5e9f9 100644 --- a/libstdc++-v3/src/c++98/Makefile.in +++ b/libstdc++-v3/src/c++98/Makefile.in @@ -266,6 +266,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -322,7 +323,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/filesystem/Makefile.in index bbc45a873104b..ec939c1616e1d 100644 --- a/libstdc++-v3/src/filesystem/Makefile.in +++ b/libstdc++-v3/src/filesystem/Makefile.in @@ -274,6 +274,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -330,7 +331,7 @@ toplevel_builddir = @toplevel_builddir@ toplevel_srcdir = @toplevel_srcdir@ # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 963f35d52f320..b278069631546 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -232,6 +232,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ glibcxx_MOFILES = @glibcxx_MOFILES@ glibcxx_PCHFLAGS = @glibcxx_PCHFLAGS@ glibcxx_POFILES = @glibcxx_POFILES@ @@ -291,7 +292,7 @@ RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir EXPECT = expect # May be used by various substitution variables. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} diff --git a/libvtv/Makefile.am b/libvtv/Makefile.am index 8c47d1afadefe..84c0ed91a6d93 100644 --- a/libvtv/Makefile.am +++ b/libvtv/Makefile.am @@ -28,7 +28,7 @@ endif ACLOCAL_AMFLAGS = -I .. -I ../config # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) DEFS = @DEFS@ AM_CPPFLAGS = -I$(top_srcdir)/../include diff --git a/libvtv/Makefile.in b/libvtv/Makefile.in index 05539277d920e..59d0b11bdd062 100644 --- a/libvtv/Makefile.in +++ b/libvtv/Makefile.in @@ -273,6 +273,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -320,7 +321,7 @@ toplevel_srcdir = @toplevel_srcdir@ ACLOCAL_AMFLAGS = -I .. -I ../config # May be used by toolexeclibdir. -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) AM_CPPFLAGS = -I$(top_srcdir)/../include AM_CFLAGS = $(XCFLAGS) AM_CCASFLAGS = $(XCFLAGS) diff --git a/libvtv/configure b/libvtv/configure index ea1a17f6c7b51..40fb0f08dc987 100755 --- a/libvtv/configure +++ b/libvtv/configure @@ -602,6 +602,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver VTV_NO_OBSTACK_FALSE VTV_NO_OBSTACK_TRUE VTV_CYGMIN_FALSE @@ -759,6 +760,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1409,6 +1411,8 @@ Optional Packages: --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] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -12062,7 +12066,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12065 "configure" +#line 12069 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12168,7 +12172,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12171 "configure" +#line 12175 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15505,6 +15509,21 @@ else fi +# 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 + + + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure diff --git a/libvtv/configure.ac b/libvtv/configure.ac index 19c65083ee1e8..33b1e7913c648 100644 --- a/libvtv/configure.ac +++ b/libvtv/configure.ac @@ -190,4 +190,7 @@ AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes) AC_CHECK_FUNCS([_obstack_begin]) AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_OUTPUT diff --git a/libvtv/testsuite/Makefile.in b/libvtv/testsuite/Makefile.in index e19e13e7e5ff1..7688f3c88c8df 100644 --- a/libvtv/testsuite/Makefile.in +++ b/libvtv/testsuite/Makefile.in @@ -174,6 +174,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am index a90a5da23bd7a..28dc21014b2e8 100644 --- a/lto-plugin/Makefile.am +++ b/lto-plugin/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I .. -I ../config AUTOMAKE_OPTIONS = no-dependencies -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) target_noncanonical := @target_noncanonical@ libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix) diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in index 06ef5f30ca47e..c69cc32bc5381 100644 --- a/lto-plugin/Makefile.in +++ b/lto-plugin/Makefile.in @@ -214,6 +214,7 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gcc_build_dir = @gcc_build_dir@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -254,7 +255,7 @@ top_srcdir = @top_srcdir@ with_libiberty = @with_libiberty@ ACLOCAL_AMFLAGS = -I .. -I ../config AUTOMAKE_OPTIONS = no-dependencies -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix) AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) AM_CFLAGS = @ac_lto_plugin_warn_cflags@ diff --git a/lto-plugin/configure b/lto-plugin/configure index 36201e63636ae..cdea9eac3eeb8 100755 --- a/lto-plugin/configure +++ b/lto-plugin/configure @@ -619,6 +619,7 @@ LD FGREP SED LIBTOOL +get_gcc_base_ver real_target_noncanonical accel_dir_suffix gcc_build_dir @@ -733,6 +734,7 @@ enable_maintainer_mode with_libiberty enable_dependency_tracking enable_largefile +with_gcc_major_version_only enable_shared enable_static with_pic @@ -1386,6 +1388,8 @@ Optional Packages: --with-build-libsubdir=DIR Directory where to find libraries for build system --with-libiberty=PATH specify the directory where to find libiberty [../libiberty] + --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] @@ -5376,6 +5380,21 @@ fi +# 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 + + + + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -9422,7 +9441,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -11450,7 +11469,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11453 "configure" +#line 11472 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11556,7 +11575,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11559 "configure" +#line 11578 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac index b6dc5343b067a..aa68632a66ff4 100644 --- a/lto-plugin/configure.ac +++ b/lto-plugin/configure.ac @@ -45,6 +45,9 @@ fi AC_SUBST(accel_dir_suffix) AC_SUBST(real_target_noncanonical) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AM_PROG_LIBTOOL ACX_LT_HOST_FLAGS AC_SUBST(target_noncanonical)