Reorganized debug flags

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@28717 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2009-09-20 10:34:39 +00:00
parent 9c885dc508
commit 12d2b6d9b8
7 changed files with 2635 additions and 3232 deletions

View file

@ -1,3 +1,19 @@
2009-09-20 Nicola Pero <nicola.pero@meta-innovation.com>
* configure.ac (--enable-debug-by-default): New option which
allows you to change if gnustep-make should build with debug=yes
or debug=no by default. Store the configuration choice in
GNUSTEP_DEFAULT_DEBUG. Make debug=no the default, so that normally
-g -O2 is the default set of compilation flags used.
* configure: Regenerated.
* common.make: If the 'debug' variable is empty, set it to
GNUSTEP_DEFAULT_DEBUG. If debug=yes, filter the -O% flags.
(ADDITIONAL_FLAGS): If debug=yes, only add -g if it is not already
present in OPTFLAG.
* config.make.in (GNUSTEP_DEFAULT_DEBUG): New variable.
* Documentation/releasenotes.texi: Updated release notes.
* RELEASENOTES: Regenerated.
2009-09-19 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/Documentation/texi.make ($(GNUSTEP_INSTANCE)_toc.html):
@ -9,7 +25,7 @@
2009-09-19 Nicola Pero <nicola.pero@meta-innovation.com>
* Documentation/releasenotes.texi: Updated release notes.
* RELEASENOTES: Regenerated.
* RELEASENOTES: Regenerated.
2009-09-19 Nicola Pero <nicola.pero@meta-innovation.com>

View file

@ -22,13 +22,16 @@ directory containing the html files was not being removed when doing a
'make clean'. Starting with version 2.2.1, 'make clean' removes the
directory too.
@item debug=yes no longer strips -O2
gnustep-make no longer strips the -Ox optimization flag when compiling
C/Objective-C/C++/Objective-C++ code with debug=yes; as a consequence,
on most platforms debug=yes (which is the default) now builds using -g
-O2 instead of just -g. If you do not want the -O2 flag, you can
override the OPTFLAG variable on the make command line (or in your
GNUmakefile) as in 'make OPTFLAG='.
@item debug=no made the default
gnustep-make now builds using debug=no by default. As a consequence,
on most platforms C/Objective-C/C++ code is now built by default using
-g -O2 instead of just -g. If you do not want the -O2 flag, you can
simply build using 'make debug=yes'. You can also use the new
./configure --enable-debug-by-default option to make 'debug=yes' the
default flag that is always used when compiling if nothing else is
specified. If you do not want the debugging symbols, remember that
you can use the 'make strip=yes' option to have them stripped out from
all object files when they are installed.
@end table

View file

@ -23,13 +23,17 @@ using a newer version of the make system.
doing a 'make clean'. Starting with version 2.2.1, 'make clean'
removes the directory too.
`debug=yes no longer strips -O2'
gnustep-make no longer strips the -Ox optimization flag when
compiling C/Objective-C/C++/Objective-C++ code with debug=yes; as
a consequence, on most platforms debug=yes (which is the default)
now builds using -g -O2 instead of just -g. If you do not want
the -O2 flag, you can override the OPTFLAG variable on the make
command line (or in your GNUmakefile) as in 'make OPTFLAG='.
`debug=no made the default'
gnustep-make now builds using debug=no by default. As a
consequence, on most platforms C/Objective-C/C++ code is now built
by default using -g -O2 instead of just -g. If you do not want
the -O2 flag, you can simply build using 'make debug=yes'. You
can also use the new ./configure -enable-debug-by-default option
to make 'debug=yes' the default flag that is always used when
compiling if nothing else is specified. If you do not want the
debugging symbols, remember that you can use the 'make strip=yes'
option to have them stripped out from all object files when they
are installed.
1.2 Version 2.2.0

View file

@ -645,21 +645,48 @@ ifeq ($(profile), yes)
endif
endif
# The default set of compilation flags are set in config.make in the
# OPTFLAGS variable. They should default to -g -O2. These should be
# an "average" set of flags, midway between debugging and performance;
# they are used, unchanged, when we build with debug=no (the default
# unless --enable-debug-by-default was used when configuring
# gnustep-make). Using the set of GCC flags -g -O2 as default is
# recommended by the GNU Coding Standards and is common practice. If
# you specify debug=yes, you want to do a debug build, so we remove
# the optimization flag that makes it harder to debug. If you specify
# strip=yes, you do not want debugging symbols, so we strip all
# executables before installing them. This gives you three main
# options to use in a default setup:
#
# make (some optimization, and some debugging symbols are used)
# make debug=yes (removes optimization flags)
# make strip=yes (removes debugging symbols)
#
# By default we build using debug=no (unless --enable-debug-by-default
# was specified when configuring gnustep-make) - so that the default
# compilation flags should be -g -O2. This is according to the GNU
# Coding Standards.
ifeq ($(debug),)
debug = $(GNUSTEP_DEFAULT_DEBUG)
endif
ifeq ($(debug), yes)
# Optimisation must be removed to permit debugging
# Optimization flags are filtered out as they make debugging harder.
OPTFLAG := $(filter-out -O%, $(OPTFLAG))
endif
# If OPTFLAG does not already include -g, add it here.
ifneq ($(filter -g, $(OPTFLAG)), -g)
ADDITIONAL_FLAGS += -g
endif
# Add standard debug compiler flags.
ADDITIONAL_FLAGS += -Wall -DDEBUG -fno-omit-frame-pointer
# Enable debug by default. This is according to the GNU Coding
# Standards.
ifneq ($(debug), no)
debug = yes
endif
ifeq ($(debug), yes)
ADDITIONAL_FLAGS += -g -Wall -DDEBUG -fno-omit-frame-pointer
# The following is for Java.
INTERNAL_JAVACFLAGS += -g -deprecation
else
# The default OPTFLAG set in config.make are used to compile.
# The following is for Java.
INTERNAL_JAVACFLAGS += -O
endif

View file

@ -44,6 +44,12 @@ CPP = @CPP@
CXX = @CXX@
CCFLAGS = @CXXFLAGS@
# If the 'debug' variable is not specified on the command-line or in
# the environment, we set it to the GNUSTEP_DEFAULT_DEBUG value. This
# is normally 'no,', but can be changed to 'yes' when gnustep-make is
# configured.
GNUSTEP_DEFAULT_DEBUG = @GNUSTEP_DEFAULT_DEBUG@
ifeq ($(OBJC_RUNTIME_LIB), gnugc)
ifeq ($(OBJC_LIB_FLAG),)
OBJC_LIB_FLAG = -lobjc_gc

5727
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1483,6 +1483,40 @@ AC_SUBST(INCLUDES)
AC_SUBST(LIB_DIR)
AC_SUBST(OBJCFLAGS)
#--------------------------------------------------------------------
# Check if we need to enable debug=yes builds by default
#--------------------------------------------------------------------
AC_MSG_CHECKING(if we should enable 'make debug=yes' by default)
AC_ARG_ENABLE(debug-by-default, [
--enable-debug-by-default
Enable building with 'make debug=yes' by default. When you use
gnustep-make to build software, you have a choice of using
debug=yes or debug=no. The debug=no will use the default compiler
flags determined when gnustep-make was configured (usually -g -O2),
while debug=yes will remove the optimization flags and add a
number of debugging compiler flags. If you do not specify the
--enable-debug-by-default option, gnustep-make will default to
building with debug=no when nothing is specified. If you
specify the --enable-debug-by-default option, gnustep-make will
default to building with debug=yes instead, which can be handy if you
always want to compile software with debug=yes and want to avoid
having to type debug=yes each time you compile (an alternative
is to define the variable debug=yes in your shell). If you are
unsure, you should stick with the default and ignore this option.
],
ac_cv_debug_by_default=$enableval,
ac_cv_debug_by_default="undefined")
if test "$ac_cv_debug_by_default" = "yes"; then
GNUSTEP_DEFAULT_DEBUG=yes;
AC_MSG_RESULT(yes);
else
GNUSTEP_DEFAULT_DEBUG=no;
AC_MSG_RESULT(no);
fi
AC_SUBST(GNUSTEP_DEFAULT_DEBUG)
#--------------------------------------------------------------------
# Check for $(info ...) function in GNU make
#--------------------------------------------------------------------