aboutsummaryrefslogtreecommitdiff
path: root/config/acx.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/acx.m4')
-rw-r--r--config/acx.m428
1 files changed, 27 insertions, 1 deletions
diff --git a/config/acx.m4 b/config/acx.m4
index ab42972..aa1d34b 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"