Allows us to easily disable compiler optimizations without directly dealing with C{,XX}FLAGS
Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index 1414ce8..4d96ba0 100644 --- a/configure.ac +++ b/configure.ac @@ -356,6 +356,28 @@ if test "x$enable_debug" = xyes; then fi fi +AC_ARG_ENABLE([optimizations], + [AS_HELP_STRING([--disable-optimizations], + [set compiler optimization level to -O0 @<:@default=enabled@:>@])], + [disable_optimizations="$enableval"], + [disable_optimizations=no] +) +if test "x$disable_optimizations" = xyes; then + if test "x$GCC_FOR_BUILD" = xyes; then + CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -O0" + fi + if test "x$GXX_FOR_BUILD" = xyes; then + CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -O0" + fi + + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -O0" + fi + if test "x$GXX" = xyes; then + CXXFLAGS="$CXXFLAGS -O0" + fi +fi + dnl dnl library names dnl -- 1.8.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev