Changeset 478


Ignore:
Timestamp:
Apr 15, 2011, 6:45:49 PM (7 years ago)
Author:
Sam Hocevar
Message:

build: add --enable-debug and --enable-release configure flags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/configure.ac

    r160 r478  
    2424AC_SUBST(EXPDATADIR)
    2525
     26AC_ARG_ENABLE(debug,
     27  [  --enable-debug          build debug versions of the game (default no)])
     28AC_ARG_ENABLE(release,
     29  [  --enable-release        build final release of the game (default no)])
     30
    2631dnl Checks for libraries
    2732dnl Do we need to link against something for X shared memory support?
     
    4247LIBS="$LIBS $SDL_LIBS $X_LIBS"
    4348
     49if test "${enable_debug}" = "yes"; then
     50  AC_DEFINE(HAVE_DEBUG, 1, Define to 1 to activate debug)
     51  OPT="-O0"
     52else
     53  OPT="-O2 -fno-strength-reduce -fomit-frame-pointer"
     54fi
     55
     56if test "${enable_release}" = "yes"; then
     57  AC_DEFINE(HAVE_RELEASE, 1, Define to 1 to activate final release)
     58  REL=""
     59else
     60  REL="-g"
     61fi
     62
    4463# Optimizations
    45 CPPFLAGS="${CPPFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
     64CXXFLAGS="${CXXFLAGS} ${OPT} ${REL}"
    4665# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
    47 CPPFLAGS="${CPPFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Waggregate-return -Wsign-compare"
     66CXXFLAGS="${CXXFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Waggregate-return -Wsign-compare"
    4867
    4968dnl Checks for header files
Note: See TracChangeset for help on using the changeset viewer.