Revamp the way --enable-release / --enable-debug work. They are now no longer mutually exclusive. Also, ports can override whether we default to (non-)release resp. (non-)debug builds
svn-id: r45036
This commit is contained in:
parent
f5b73061e4
commit
0df369767d
1 changed files with 24 additions and 7 deletions
31
configure
vendored
31
configure
vendored
|
@ -125,6 +125,8 @@ _fluidsynth=auto
|
|||
_16bit=auto
|
||||
_readline=auto
|
||||
# Default option behaviour yes/no
|
||||
_debug_build=auto
|
||||
_release_build=auto
|
||||
_text_console=no
|
||||
_mt32emu=yes
|
||||
_build_hq_scalers=yes
|
||||
|
@ -658,8 +660,6 @@ EOF
|
|||
fi
|
||||
done # for parm in ...
|
||||
|
||||
DEBFLAGS="-g"
|
||||
|
||||
for ac_option in $@; do
|
||||
case "$ac_option" in
|
||||
--disable-16bit) _16bit=no ;;
|
||||
|
@ -750,16 +750,19 @@ for ac_option in $@; do
|
|||
_backend=`echo $ac_option | cut -d '=' -f 2`
|
||||
;;
|
||||
--enable-debug)
|
||||
# debug is enabled by default
|
||||
_debug_build=yes
|
||||
;;
|
||||
--disable-debug)
|
||||
DEBFLAGS=""
|
||||
_debug_build=no
|
||||
;;
|
||||
--enable-Werror)
|
||||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
;;
|
||||
--enable-release)
|
||||
DEBFLAGS="-O2 -Wuninitialized"
|
||||
_release_build=yes
|
||||
;;
|
||||
--disable-release)
|
||||
_release_build=no
|
||||
;;
|
||||
--enable-profiling)
|
||||
CXXFLAGS="$CXXFLAGS -pg"
|
||||
|
@ -812,8 +815,6 @@ for ac_option in $@; do
|
|||
esac;
|
||||
done;
|
||||
|
||||
CXXFLAGS="$CXXFLAGS $DEBFLAGS"
|
||||
|
||||
guessed_host=`$_srcdir/config.guess`
|
||||
get_system_exe_extension $guessed_host
|
||||
NATIVEEXEEXT=$_exeext
|
||||
|
@ -923,6 +924,22 @@ else
|
|||
_windres=$_host_alias-windres
|
||||
fi
|
||||
|
||||
#
|
||||
# Determine extra build flags for debug and/or release builds
|
||||
#
|
||||
|
||||
if test "$_debug_build" != no; then
|
||||
# debug mode not explicitly disabled -> compile with -g
|
||||
CXXFLAGS="$CXXFLAGS -g"
|
||||
fi
|
||||
|
||||
if test "$_release_build" = yes; then
|
||||
# Release mode enabled: enable optimizations. This also
|
||||
# makes it possible to use -Wuninitialized, so let's do that.
|
||||
CXXFLAGS="$CXXFLAGS -O2 -Wuninitialized"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Determine extension used for executables
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue