summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-10 16:37:53 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-10 16:37:53 +0000
commitf5fad380f9f8ab15869d44c30e439b597fd74aa7 (patch)
tree97a44f4af7af6c36d2792d5d77bd9bc86eb73655 /configure
parent57583407540893387f6eb0f26b435a4d4d5cf0b3 (diff)
downloadgcc-f5fad380f9f8ab15869d44c30e439b597fd74aa7.tar.gz
PR bootstrap/25672
* configure.ac: Do not initialize CFLAGS_FOR_TARGET from CFLAGS if cross-compiling. Similarly for CXX_FOR_TARGET. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221326 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure44
1 files changed, 26 insertions, 18 deletions
diff --git a/configure b/configure
index 6c971cd52cc..098ed9fa89c 100755
--- a/configure
+++ b/configure
@@ -6695,28 +6695,36 @@ fi
# 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
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