Add '--enable-release' to configure script, which for now sets the Makefile to use LTO.

This commit is contained in:
Stephen Anthony 2020-08-26 15:27:41 -02:30
parent a73c92904f
commit c165c9b159
4 changed files with 18 additions and 5 deletions

View File

@ -80,6 +80,11 @@ else
endif endif
endif endif
ifdef RELEASE
CXXFLAGS += -flto
LDFLAGS += -flto
endif
####################################################################### #######################################################################
# Misc stuff - you should never have to edit this # # Misc stuff - you should never have to edit this #
####################################################################### #######################################################################

14
configure vendored
View File

@ -26,6 +26,7 @@ _build_sqlite=no
_build_static=no _build_static=no
_build_profile=no _build_profile=no
_build_debug=no _build_debug=no
_build_release=no
# more defaults # more defaults
_ranlib=ranlib _ranlib=ranlib
@ -261,8 +262,10 @@ for ac_option in $@; do
--disable-static) _build_static=no ;; --disable-static) _build_static=no ;;
--enable-profile) _build_profile=yes ;; --enable-profile) _build_profile=yes ;;
--disable-profile) _build_profile=no ;; --disable-profile) _build_profile=no ;;
--enable-debug) _build_debug=yes ;; --enable-debug) _build_debug=yes ;;
--disable-debug) _build_debug=false ;; --disable-debug) _build_debug=no ;;
--enable-release) _build_release=yes ;;
--disable-release) _build_release=no ;;
--with-sdl-prefix=*) --with-sdl-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2` arg=`echo $ac_option | cut -d '=' -f 2`
_sdlpath="$arg:$arg/bin" _sdlpath="$arg:$arg/bin"
@ -277,7 +280,7 @@ for ac_option in $@; do
ZLIB_CFLAGS="-I$_prefix/include" ZLIB_CFLAGS="-I$_prefix/include"
ZLIB_LIBS="-L$_prefix/lib" ZLIB_LIBS="-L$_prefix/lib"
;; ;;
--with-sqlite-prefix=*) --with-sqlite-prefix=*)
_prefix=`echo $ac_option | cut -d '=' -f 2` _prefix=`echo $ac_option | cut -d '=' -f 2`
SQLITE_CFLAGS="-I$_prefix/include" SQLITE_CFLAGS="-I$_prefix/include"
SQLITE_LIBS="-L$_prefix/lib" SQLITE_LIBS="-L$_prefix/lib"
@ -925,6 +928,10 @@ if test "$_build_debug" = no ; then
_build_debug= _build_debug=
fi fi
if test "$_build_release" = no ; then
_build_release=
fi
echo "Creating config.mak" echo "Creating config.mak"
cat > config.mak << EOF cat > config.mak << EOF
# -------- Generated by configure ----------- # -------- Generated by configure -----------
@ -958,6 +965,7 @@ DOCDIR := $_docdir
DATADIR := $_datadir DATADIR := $_datadir
PROFILE := $_build_profile PROFILE := $_build_profile
DEBUG := $_build_debug DEBUG := $_build_debug
RELEASE := $_build_release
$_make_def_HAVE_GCC $_make_def_HAVE_GCC
$_make_def_HAVE_CLANG $_make_def_HAVE_CLANG

2
debian/rules vendored
View File

@ -20,7 +20,7 @@ endif
config.status: configure config.status: configure
dh_testdir dh_testdir
CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr --enable-release
build: build-stamp build: build-stamp

View File

@ -33,7 +33,7 @@ on your PC.
%build %build
export CXXFLAGS=$RPM_OPT_FLAGS export CXXFLAGS=$RPM_OPT_FLAGS
%configure \ %configure --enable-release \
%if %enable_sound %if %enable_sound
--enable-sound \ --enable-sound \
%else %else