This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2


Hello,

According to a comment in configure/configure.ac:
# We want to ensure that TARGET libraries (which we know are built with
# gcc) are built with "-O2 -g", so include those options when setting
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.

but the current code does not ensure this.

I propose the patch below to fix this.

2012-03-29 Christophe Lyon <christophe.lyon@st.com>

    * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Make sure
    they contain -O2.
        * configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac    (revision 2515)
+++ configure.ac    (working copy)
@@ -2223,7 +2223,7 @@ if test "x$CFLAGS_FOR_TARGET" = x; then
   esac
   case " $CFLAGS " in
     *" -g "* | *" -g3 "*) ;;
-    *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
+    *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
   esac
 fi
 AC_SUBST(CFLAGS_FOR_TARGET)
@@ -2236,7 +2236,7 @@ if test "x$CXXFLAGS_FOR_TARGET" = x; the
   esac
   case " $CXXFLAGS " in
     *" -g "* | *" -g3 "*) ;;
-    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
+    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
   esac
 fi
 AC_SUBST(CXXFLAGS_FOR_TARGET)
Index: configure
===================================================================
--- configure    (revision 2515)
+++ configure    (working copy)
@@ -6739,7 +6739,7 @@ if test "x$CFLAGS_FOR_TARGET" = x; then
   esac
   case " $CFLAGS " in
     *" -g "* | *" -g3 "*) ;;
-    *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
+    *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
   esac
 fi

@@ -6752,7 +6751,7 @@ if test "x$CXXFLAGS_FOR_TARGET" = x; the
   esac
   case " $CXXFLAGS " in
     *" -g "* | *" -g3 "*) ;;
-    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
+    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
   esac
 fi



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]