summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-11 23:30:52 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:16:46 +0200
commit14ff4026c28c217418c9c8214f81c4154d1e1755 (patch)
tree5e4b080ef92a6ad7cea8f0f61e6dea96d5385a13 /configure
parent44f851a3edd499c61cebedefac1bfce2dea914cb (diff)
downloadmpv-14ff4026c28c217418c9c8214f81c4154d1e1755.tar.bz2
mpv-14ff4026c28c217418c9c8214f81c4154d1e1755.tar.xz
configure: Separate compiler warning flags from other flags
This allows setting some warning flags for C but not for C++ and fixes a bunch of warnings that resulted from compiling C++ files with C-only warning flags. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32173 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32227 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure32
1 files changed, 19 insertions, 13 deletions
diff --git a/configure b/configure
index 5d729bdc30..3deaf7c94e 100755
--- a/configure
+++ b/configure
@@ -64,9 +64,9 @@ compile_check() {
echo >> "$TMPLOG"
cat "$source" >> "$TMPLOG"
echo >> "$TMPLOG"
- echo "$_cc $source $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
+ echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
rm -f "$TMPEXE"
- $_cc $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
+ $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
TMPRES="$?"
echo >> "$TMPLOG"
echo >> "$TMPLOG"
@@ -2422,11 +2422,13 @@ fi # if darwin && test "$cc_vendor" = "gnu" ; then
# Checking for CFLAGS
_install_strip="-s"
if test "$_profile" != "" || test "$_debug" != "" ; then
- CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
+ CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
+ WARNFLAGS="-W -Wall"
_install_strip=
elif test -z "$CFLAGS" ; then
if test "$cc_vendor" = "intel" ; then
- CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
+ CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
+ WARNFLAGS="-wd167 -wd556 -wd144"
elif test "$cc_vendor" = "sun" ; then
CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
elif test "$cc_vendor" = "clang"; then
@@ -2434,7 +2436,8 @@ elif test -z "$CFLAGS" ; then
elif test "$cc_vendor" != "gnu" ; then
CFLAGS="-O2 $_march $_mcpu $_pipe"
else
- CFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+ CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+ WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
extra_ldflags="$extra_ldflags -ffast-math"
fi
else
@@ -2442,12 +2445,15 @@ else
fi
if test "$cc_vendor" = "gnu" ; then
- cflag_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
- cflag_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
- cflag_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
- cflag_check -Wundef && CFLAGS="-Wundef $CFLAGS"
- cflag_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
- cflag_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
+ cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
+ # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
+ # that's the only variable specific to C now, and this option is not valid
+ # for C++.
+ cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
+ cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
+ cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
+ cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
+ cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
else
CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
fi
@@ -7768,8 +7774,8 @@ INSTALL = $_install
INSTALLSTRIP = $_install_strip
WINDRES = $_windres
-CFLAGS = $CFLAGS $extra_cflags
-CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
+CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
+CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
DEPFLAGS = $DEPFLAGS
CFLAGS_DHAHELPER = $cflags_dhahelper