Always build with -g and optionally strip the debugging symbols on install so that crash backtraces aren't completely meaningless

Originally committed to SVN as r6201.
This commit is contained in:
Thomas Goyne 2012-01-08 01:04:05 +00:00
parent 5702dd60a1
commit 0113b33d66
5 changed files with 12 additions and 25 deletions

View file

@ -43,7 +43,6 @@ AEGISUB_VERSION_DATA = @AEGISUB_VERSION_DATA@
BUILD_DATE = @BUILD_DATE@
PACKAGE_DEBUG = @PACKAGE_DEBUG@
SVN_REVISION = @SVN_REVISION@
DEBUG_FLAGS = @DEBUG_FLAGS@
# OS X
BUNDLE_STRING = @BUNDLE_STRING@
DARWIN_ARCH = @DARWIN_ARCH@

View file

@ -214,12 +214,14 @@ AS_IF([test x$enable_compiler_flags != xno], [
AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-std=gnu99])
AC_C_FLAG([-pipe])
AC_C_FLAG([-g])
AC_CXX_FLAG([-Wall])
AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])])
AC_CXX_FLAG([-Wno-unused-parameter])
AC_CXX_FLAG([-Wno-long-long])
AC_CXX_FLAG([-fno-strict-aliasing])
AC_CXX_FLAG([-pipe])
AC_CXX_FLAG([-g])
# -O* messes with debugging.
AS_IF([test x$enable_debug = xyes], [
@ -509,31 +511,17 @@ AC_SUBST(enable_gcc_prec)
######################################################
# Debugging support
# This is added last so it doesn't slow down configure
# If you want it earlier add it to your CXXFLAGS.
######################################################
AC_ARG_VAR([DEBUG_FLAGS], [Debug flag to use with --enable-debug [-g]])
AC_MSG_CHECKING([whether to turn on debugging])
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging [no]]))
AC_MSG_RESULT([${enable_debug:=no}])
AS_IF([test x$enable_debug = xyes], [
DEBUG_FLAGS=${DEBUG_FLAGS:--g}
# This turns on some internal (to aegisub) debugging features.
# A debug version of wxWidgets is required.
AS_IF([test x$enable_debug = xyes],
[PACKAGE_DEBUG="-debug"
AS_IF([$WX_CONFIG_PATH --debug],[AC_CXX_FLAG([-D_DEBUG])])])
AC_MSG_RESULT([yes ($DEBUG_FLAGS)])
msg_debug="($DEBUG_FLAGS)"
# This turns on some internal (to aegisub) debugging features.
# A debug version of wxWidgets is required.
AS_IF([$WX_CONFIG_PATH --debug], AC_CXX_FLAG([-D_DEBUG]))
], [
DEBUG_FLAGS=""
enable_debug="no"
AC_MSG_RESULT([no])
])
AC_SUBST(DEBUG_FLAGS)
AS_IF([test x$enable_debug = xyes], [PACKAGE_DEBUG="-debug"])
AC_SUBST(PACKAGE_DEBUG)
AC_MSG_CHECKING([whether to use exception handling in debug mode])
@ -711,7 +699,7 @@ AC_MSG_RESULT([
Configure settings
Install prefix: $prefix
SVN Revision: $SVN_REVISION
Debug $enable_debug $msg_debug
Debug $enable_debug
CFLAGS $CFLAGS
CXXFLAGS $CXXFLAGS
CPPFLAGS $CPPFLAGS

View file

@ -6,7 +6,7 @@ LIB_SHARED = libaegisub-3.0.so
LIB_SHARED_INSTALL = yes
LIB_VERSION = 3
CXXFLAGS += -Iinclude -I../src -I.. -DLAGI -fPIC -Wno-variadic-macros $(DEBUG_FLAGS)
CXXFLAGS += -Iinclude -I../src -I.. -DLAGI -fPIC -Wno-variadic-macros
PRECOMPILED_HEADER_NAME = lagi_pre.h
lagi_pre.h.gch: CXXFLAGS := $(CXXFLAGS)

View file

@ -5,7 +5,7 @@ PROGRAM_INSTALL = yes
PRECOMPILED_HEADER_NAME=agi_pre.h
AEGISUB_CFLAGS = -I. -I.. -Iinclude -I../libaegisub/include -DAEGISUB $(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(DEBUG_FLAGS) $(CFLAGS_PROFILE)
AEGISUB_CFLAGS = -I. -I.. -Iinclude -I../libaegisub/include -DAEGISUB $(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_PROFILE)
CFLAGS += $(AEGISUB_CFLAGS)
CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)

View file

@ -7,7 +7,7 @@ LIBS += -L../libaegisub -laegisub-3.0 -lgtest -L../universalchardet -luniversal
LDFLAGS += -Wl,-rpath $(CURDIR)/../libaegisub $(LDFLAGS_ICONV)
CPPFLAGS += -I../src/include -I../libaegisub/include $(CFLAGS_ICONV)
CXXFLAGS += -Wno-unused-value $(DEBUG_FLAGS)
CXXFLAGS += -Wno-unused-value
ifdef $(BUILD_DARWIN)