mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Force --enable-debug to strip spurious optimization added by AC_PROG_CC (for gcc). But if the user has optimization in their CFLAGS, make sure it's respected.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15477 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
14
configure.in
14
configure.in
@@ -37,6 +37,15 @@ GNUCASH_MAJOR_VERSION=`echo $GNUCASH_VERSION_STRING | [ sed -e 's/^\([^\.]*\)\.\
|
||||
GNUCASH_MINOR_VERSION=`echo $GNUCASH_VERSION_STRING | [ sed -e 's/^\([^\.]*\)\.\([^.]*\)\.\(.*\)$/\2/' ]`
|
||||
GNUCASH_MICRO_VERSION=`echo $GNUCASH_VERSION_STRING | [ sed -e 's/^\([^\.]*\)\.\([^.]*\)\.\(.*\)$/\3/' ]`
|
||||
|
||||
# save any user/environment optimization flags before we muck with them in
|
||||
# --enable-debug:
|
||||
USER_OPTIMIZATION=""
|
||||
for flag in $CFLAGS; do
|
||||
if test -z $(echo $flag | sed -e 's,-O.,,'); then
|
||||
USER_OPTIMIZATION="$USER_OPTIMIZATION ${flag}"
|
||||
fi
|
||||
done
|
||||
|
||||
## Do this first, because the other tests depend on it:
|
||||
|
||||
# Check for gcc and intltool (somehow breaks the suggested content
|
||||
@@ -563,7 +572,10 @@ AC_SUBST(GNC_LIBEXECDIR)
|
||||
|
||||
AC_ARG_ENABLE( debug,
|
||||
[ --enable-debug compile with debugging flags set],
|
||||
CFLAGS="${CFLAGS} -g"
|
||||
# remove any optimization flags...
|
||||
CFLAGS=$(echo $CFLAGS | sed -e 's,-O.,,g')
|
||||
# ...except for those the user wants.
|
||||
CFLAGS="${CFLAGS} -g ${USER_OPTIMIZATION}"
|
||||
LDFLAGS="${LDFLAGS} -g"
|
||||
AC_DEFINE(DEBUG_MEMORY,1,Enable debug memory),
|
||||
AC_DEFINE(DEBUG_MEMORY,0,Enable debug memory) )
|
||||
|
||||
Reference in New Issue
Block a user