From 0113b33d66bbfb3a1938990e83a079ddfcc2ac35 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 8 Jan 2012 01:04:05 +0000 Subject: [PATCH] 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. --- aegisub/Makefile.inc.in | 1 - aegisub/configure.in | 30 +++++++++--------------------- aegisub/libaegisub/Makefile | 2 +- aegisub/src/Makefile | 2 +- aegisub/tests/Makefile | 2 +- 5 files changed, 12 insertions(+), 25 deletions(-) diff --git a/aegisub/Makefile.inc.in b/aegisub/Makefile.inc.in index 222e37f06..825d643ff 100644 --- a/aegisub/Makefile.inc.in +++ b/aegisub/Makefile.inc.in @@ -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@ diff --git a/aegisub/configure.in b/aegisub/configure.in index 9213ef108..a958e69f4 100644 --- a/aegisub/configure.in +++ b/aegisub/configure.in @@ -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 diff --git a/aegisub/libaegisub/Makefile b/aegisub/libaegisub/Makefile index 07d1cfd4d..e5cbcbc3b 100644 --- a/aegisub/libaegisub/Makefile +++ b/aegisub/libaegisub/Makefile @@ -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) diff --git a/aegisub/src/Makefile b/aegisub/src/Makefile index 120e23ffc..3015b45ce 100644 --- a/aegisub/src/Makefile +++ b/aegisub/src/Makefile @@ -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) diff --git a/aegisub/tests/Makefile b/aegisub/tests/Makefile index ba9415351..fb962af55 100644 --- a/aegisub/tests/Makefile +++ b/aegisub/tests/Makefile @@ -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)