From 3a0f40afb485c2fb07b0038bfc824c77bc8efa59 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 Aug 2012 20:01:03 +0200 Subject: configure: disable optimization if --enable-debug is used Enabling optimization _still_ causes annoyances when using a debugger, and it increaes compilation times too. Now --enable-debug basically replaces the -O2 flag with -g. --- configure | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 90c7bc4f35..e2162d0ffc 100755 --- a/configure +++ b/configure @@ -429,6 +429,8 @@ _pkg_config=auto _windres=auto _cc=auto test "$CC" && _cc="$CC" +_debug= +_opt=-O2 _cross_compile=no _prefix="/usr/local" ffmpeg=auto @@ -603,9 +605,11 @@ for ac_option do ;; --enable-debug) _debug='-g' + _opt= ;; --enable-debug=*) _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2) + _opt= ;; --disable-debug) _debug= @@ -1143,16 +1147,16 @@ if test "$_profile" != "" || test "$_debug" != "" ; then fi if test -z "$CFLAGS" ; then if test "$cc_vendor" = "intel" ; then - CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer" + CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer" WARNFLAGS="-wd167 -wd556 -wd144" elif test "$cc_vendor" = "clang"; then - CFLAGS="-O2 $_debug $_profile $_march $_pipe" + CFLAGS="$_opt $_debug $_profile $_march $_pipe" WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes" ERRORFLAGS="-Werror=implicit-function-declaration" elif test "$cc_vendor" != "gnu" ; then - CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe" + CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe" else - CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer" + CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer" WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls" ERRORFLAGS="-Werror-implicit-function-declaration" extra_ldflags="$extra_ldflags -ffast-math" -- cgit v1.2.3