From 67cf46365ec82684d609c1c917d198e576227172 Mon Sep 17 00:00:00 2001 From: Scott Wichser Date: Wed, 16 Sep 2020 06:29:27 -0500 Subject: [PATCH] Reset CFLAGS and CXXFLAGS to a previous value to fix the large release builds. This prevents -g from being added when we aren't building in debug mode. --- configure.ac | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 07666711a3..d585785776 100644 --- a/configure.ac +++ b/configure.ac @@ -794,10 +794,6 @@ fi if test x$enable_debug = xyes ; then CONF_CFLAGS="$CONF_CFLAGS -Werror -g -O0" CONF_CXXFLAGS="$CONF_CXXFLAGS -Werror -g -O0" - # revert automatic setting of CFLAGS and CXXFLAGS to prevent - # override of "-g -O0" put into CONF_CFLAGS and CONF_CXXFLAGS above - CFLAGS="$user_CFLAGS" - CXXFLAGS="$user_CXXFLAGS" AC_DEFINE(DEBUG, 1, [Debugging enabled]) else if test "$GCC" = yes ; then @@ -812,9 +808,17 @@ else ;; esac fi + CONF_CFLAGS="$CONF_CFLAGS -O2" + CONF_CXXFLAGS="$CONF_CXXFLAGS -O2" AC_DEFINE(NDEBUG, 1, [Debugging disabled]) fi +# revert automatic setting of CFLAGS and CXXFLAGS to prevent +# override of debug or optimization settings in CONF_CFLAGS +# and CONF_CXXFLAGS above +CFLAGS="$user_CFLAGS" +CXXFLAGS="$user_CXXFLAGS" + dnl check for -search_paths_first linker flag when making dynamic libraries search_paths_first_flag="-Wl,-search_paths_first -mdynamic-no-pic" AC_MSG_CHECKING([if the compiler understands $search_paths_first_flag])