From 15635523464d5557c98fe21da361e6b834a785cf Mon Sep 17 00:00:00 2001 From: cosmosninja Date: Sat, 12 Jan 2008 23:08:27 +0000 Subject: [PATCH] Passing --enable-debug to the configure script now causes that the program is compiled with -g(enable debugger info) and -pg(enable profiling info), and #defines DEBUG for the code. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1384 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- configure.ac | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 5cbb95a6c..6009520bb 100644 --- a/configure.ac +++ b/configure.ac @@ -13,6 +13,15 @@ dnl ================================================ AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(supertuxkart, SVN) + +dnl ===================================================== +dnl Set the default CFLAGS/CXXFLAGS +dnl If these were not set, the AC_PROG_CC and AC_PROG_CXX +dnl scripts set them to "-g -O2". +dnl ===================================================== +CFLAGS="$CFLAGS -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes" +CXXFLAGS="$CXXFLAGS -O2 -Wall" + dnl =================== dnl Check for compilers dnl =================== @@ -20,11 +29,18 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_CXX -dnl ================== -dnl Set compiler flags -dnl ================== -CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes" -CXXFLAGS="$CXXFLAGS -Wall" +dnl ============================================= +dnl Define debug which enables some cheats +dnl This should be DISABLED when doing a release! +dnl ============================================= +SUMMARY="\nSummary of optional components:\n===============================" +AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging info], +[AC_DEFINE([DEBUG], [], [Enable debugging cheats and shortcuts]) +CFLAGS="$CFLAGS -g -pg" +CXXFLAGS="$CXXFLAGS -g -pg" +SUMMARY="$SUMMARY\nEnabled debugging, please disable for a release!!" +] +) dnl =================== dnl Checks for programs. @@ -115,7 +131,6 @@ if test x$have_al_lib = xyes; then esac fi -SUMMARY="\nSummary of optional components:\n===============================" case "${host}" in *) dnl default unix style machines @@ -371,13 +386,6 @@ esac AC_SUBST(BULLETTREE) -dnl ============================================= -dnl Define debug which enables some cheats -dnl This should be DISABLED when doing a release! -dnl ============================================= -AC_DEFINE([DEBUG], [], [Enable debugging cheats and shortcuts]) -SUMMARY="$SUMMARY\nEnabled cheats for debugging, please disable for a release!!" - dnl ================ dnl Create makefiles dnl ================