From c165c9b1594c21748fcf282f5dc5f48db379469a Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 26 Aug 2020 15:27:41 -0230 Subject: [PATCH] Add '--enable-release' to configure script, which for now sets the Makefile to use LTO. --- Makefile | 5 +++++ configure | 14 +++++++++++--- debian/rules | 2 +- src/unix/stella.spec | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 08cfc640c..168ae178d 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,11 @@ else endif endif +ifdef RELEASE + CXXFLAGS += -flto + LDFLAGS += -flto +endif + ####################################################################### # Misc stuff - you should never have to edit this # ####################################################################### diff --git a/configure b/configure index 4fb2cf08d..31281ec4c 100755 --- a/configure +++ b/configure @@ -26,6 +26,7 @@ _build_sqlite=no _build_static=no _build_profile=no _build_debug=no +_build_release=no # more defaults _ranlib=ranlib @@ -261,8 +262,10 @@ for ac_option in $@; do --disable-static) _build_static=no ;; --enable-profile) _build_profile=yes ;; --disable-profile) _build_profile=no ;; - --enable-debug) _build_debug=yes ;; - --disable-debug) _build_debug=false ;; + --enable-debug) _build_debug=yes ;; + --disable-debug) _build_debug=no ;; + --enable-release) _build_release=yes ;; + --disable-release) _build_release=no ;; --with-sdl-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` _sdlpath="$arg:$arg/bin" @@ -277,7 +280,7 @@ for ac_option in $@; do ZLIB_CFLAGS="-I$_prefix/include" ZLIB_LIBS="-L$_prefix/lib" ;; - --with-sqlite-prefix=*) + --with-sqlite-prefix=*) _prefix=`echo $ac_option | cut -d '=' -f 2` SQLITE_CFLAGS="-I$_prefix/include" SQLITE_LIBS="-L$_prefix/lib" @@ -925,6 +928,10 @@ if test "$_build_debug" = no ; then _build_debug= fi +if test "$_build_release" = no ; then + _build_release= +fi + echo "Creating config.mak" cat > config.mak << EOF # -------- Generated by configure ----------- @@ -958,6 +965,7 @@ DOCDIR := $_docdir DATADIR := $_datadir PROFILE := $_build_profile DEBUG := $_build_debug +RELEASE := $_build_release $_make_def_HAVE_GCC $_make_def_HAVE_CLANG diff --git a/debian/rules b/debian/rules index 35b3c2ff4..2e9b442c1 100755 --- a/debian/rules +++ b/debian/rules @@ -20,7 +20,7 @@ endif config.status: configure dh_testdir - CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr + CXXFLAGS="$(CXXFLAGS)" ./configure --prefix=/usr --enable-release build: build-stamp diff --git a/src/unix/stella.spec b/src/unix/stella.spec index c54cf259a..ad6819995 100644 --- a/src/unix/stella.spec +++ b/src/unix/stella.spec @@ -33,7 +33,7 @@ on your PC. %build export CXXFLAGS=$RPM_OPT_FLAGS -%configure \ +%configure --enable-release \ %if %enable_sound --enable-sound \ %else