Do not force -O0 with --disable-optimizations
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 1 May 2011 17:16:14 +0000 (20:16 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 1 May 2011 17:18:17 +0000 (20:18 +0300)
GCC takes the last -O* option, which defaults to -O0 anyway. With
./configure forcing -O0, there was no way to select a custom
optimization level via external CFLAGS.

configure.ac
m4/vlc.m4
vlc-config.in.in

index 4a8c046..b2547aa 100644 (file)
@@ -1083,14 +1083,6 @@ else
     fi
 fi
 
-AC_CACHE_CHECK([if \$CC accepts -O0],
-    [ac_cv_c_o0],
-    [CFLAGS="${CFLAGS_save} -O0"
-     AC_TRY_COMPILE([],,ac_cv_c_o0=yes, ac_cv_c_o0=no)])
-if test "${ac_cv_c_o0}" != "no"; then
-    CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O0"
-fi
-
 dnl Check for -ffast-math
 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
     [ac_cv_c_fast_math],
index f4e8778..61e309e 100644 (file)
--- a/m4/vlc.m4
+++ b/m4/vlc.m4
@@ -101,7 +101,6 @@ AC_DEFUN([VLC_OUTPUT_VLC_CONFIG_IN], [
           -e "s/@CFLAGS_TUNING@/${CFLAGS_TUNING}/" \
           -e "s/@CFLAGS_OPTIM_SPEED@/${CFLAGS_OPTIM_SPEED}/" \
           -e "s/@CFLAGS_OPTIM_NODEBUG@/${CFLAGS_OPTIM_NODEBUG}/" \
-          -e "s/@CFLAGS_NOOPTIM@/${CFLAGS_NOOPTIM}/" \
     > vlc-config.in
 
   dnl  Switch/case loop
index c1fd3d2..ac846a6 100644 (file)
@@ -23,7 +23,6 @@ libs=""
 cflags_tuning="@CFLAGS_TUNING@"
 cflags_optim_speed="@CFLAGS_OPTIM_SPEED@"
 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
-cflags_nooptim="@CFLAGS_NOOPTIM@"
 
 #
 #  Do not touch below this place unless you really know what you are doing
@@ -93,10 +92,6 @@ if [ "${optim}" = speed ]; then
     cxxflags="${cxxflags} ${cflags_optim_nodebug}"
     objcflags="${objcflags} ${cflags_optim_nodebug}"
   fi
-else
-  cflags="${cflags} ${cflags_nooptim}"
-  cxxflags="${cxxflags} ${cflags_nooptim}"
-  objcflags="${objcflags} ${cflags_nooptim}"
 fi
 
 #