--- trunk/OOPSE/ac-tools/configure.in 2003/10/24 17:36:02 816 +++ trunk/OOPSE/ac-tools/configure.in 2003/10/27 16:20:59 822 @@ -11,32 +11,41 @@ AC_PREFIX_DEFAULT("/usr/local") AC_PREFIX_DEFAULT("/usr/local") -# what should I build? - -AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile OOPSE in debug mode]), [DEBUG=1]) - # set program name PROGNAME="oopse" AC_SUBST(PROGNAME) +# there are two ways to do debugging. One with the --enable-debug flag +# and one using the DEBUG environment variable + +debug=0 +AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile OOPSE in debug mode]), [debug=1]) if test "${DEBUG}"; then - AC_DEFINE(DEBUG, 1, [Code compiled in debug mode]) + AC_DEFINE(debug, 1, [Code compiled in debug mode]) msg="$msg, debug mode" fi -AC_SUBST(DEBUG) +AC_SUBST(debug) # who am i AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC([icc xlc gcc cc]) -ACX_PROG_CC_MAXOPT AC_PROG_CXX([icpc icc xlC CC g++ c++]) -ACX_PROG_CXX_MAXOPT AC_PROG_F90([ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95]) -ACX_PROG_F90_MAXOPT ACX_PROG_F90_PREPFLAG ACX_PROG_F90_PREPDEFFLAG + +case $debug in + 1) + ;; + *) + ACX_PROG_CC_MAXOPT + ACX_PROG_CXX_MAXOPT + ACX_PROG_F90_MAXOPT + ;; +esac + AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -162,21 +171,16 @@ OPTIMIZE=${OPTIMIZE-"-O"} FFLAGS=${FFLAGS-""} F90FLAGS=${F90FLAGS-""} LDFLAGS=${LDFLAGS-""} -OPTIMIZE=${OPTIMIZE-"-O"} DEBUG=${DEBUG-"-g"} case $debug in - true) + 1) CFLAGS="$DEBUG $CFLAGS" CXXFLAGS="$DEBUG $CXXFLAGS" FFLAGS="$DEBUG $FFLAGS" F90FLAGS="$DEBUG $F90FLAGS" ;; *) - CFLAGS="$OPTIMIZE $CFLAGS" - CXXFLAGS="$OPTIMIZE $CXXFLAGS" - FFLAGS="$OPTIMIZE $FFLAGS" - F90FLAGS="$OPTIMIZE $F90FLAGS" ;; esac