summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2015-03-10 16:37:53 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2015-03-10 16:37:53 +0000
commitfc30054eff136a33c545df9337dfb41ce93623a3 (patch)
tree97a44f4af7af6c36d2792d5d77bd9bc86eb73655 /configure.ac
parent0757674c837edede75a9c8a840c55190f971c004 (diff)
re PR bootstrap/25672 (cross build's libgcc picks up CFLAGS)
PR bootstrap/25672 * configure.ac: Do not initialize CFLAGS_FOR_TARGET from CFLAGS if cross-compiling. Similarly for CXX_FOR_TARGET. * configure: Regenerate. From-SVN: r221326
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 26 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 3fe423d5d8d..7104631b738 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2341,28 +2341,36 @@ AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
# gcc) are built with "-O2 -g", so include those options when setting
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
if test "x$CFLAGS_FOR_TARGET" = x; then
- CFLAGS_FOR_TARGET=$CFLAGS
- case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
- esac
- case " $CFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
- esac
+ if test "x${is_cross_compiler}" = xyes; then
+ CFLAGS_FOR_TARGET="-g -O2"
+ else
+ CFLAGS_FOR_TARGET=$CFLAGS
+ case " $CFLAGS " in
+ *" -O2 "*) ;;
+ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
+ esac
+ case " $CFLAGS " in
+ *" -g "* | *" -g3 "*) ;;
+ *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
+ esac
+ fi
fi
AC_SUBST(CFLAGS_FOR_TARGET)
if test "x$CXXFLAGS_FOR_TARGET" = x; then
- CXXFLAGS_FOR_TARGET=$CXXFLAGS
- case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
- esac
- case " $CXXFLAGS " in
- *" -g "* | *" -g3 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
- esac
+ if test "x${is_cross_compiler}" = xyes; then
+ CXXFLAGS_FOR_TARGET="-g -O2"
+ else
+ CXXFLAGS_FOR_TARGET=$CXXFLAGS
+ case " $CXXFLAGS " in
+ *" -O2 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
+ esac
+ case " $CXXFLAGS " in
+ *" -g "* | *" -g3 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
+ esac
+ fi
fi
AC_SUBST(CXXFLAGS_FOR_TARGET)