aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 1b691b6..47d8ac8 100644
--- a/configure.in
+++ b/configure.in
@@ -2145,4 +2145,24 @@ fi
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
+# If gcc is built natively with shared library enabled, set
+# $RPATH_ENVVAR to make sure the newly built gcc shared librares are
+# used.
+SET_GCC_LIB_PATH=
+if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then
+ case "${enable_shared}" in
+ no | "") ;;
+ *)
+ eval "d=\$$RPATH_ENVVAR"
+ if test x"$d" != x; then
+ d="$pwd/gcc:$d"
+ else
+ d="$pwd/gcc"
+ fi
+ SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);"
+ ;;
+ esac
+fi
+AC_SUBST(SET_GCC_LIB_PATH)
+
AC_OUTPUT(Makefile)