Changeset 13230

Show
Ignore:
Timestamp:
12/04/07 11:58:53 (7 months ago)
Author:
warmerdam
Message:

added --enable-debug switch (#2014)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/configure

    r13224 r13230  
    10241024  --without-ld-shared   Disable shared library support 
    10251025  --with-unix-stdio-64=ARG Utilize 64 stdio api (yes/no) 
     1026  --enable-debug      Build with -g -DDEBUG for debugging, instead of -O 
    10261027  --with-hide-internal-symbols=ARG Try to hide internal symbols (ARG=yes/no) 
    10271028  --with-local=dir      Include /usr/local or other local tree for INCLUDE/LIBS 
     
    49884989  lt_cv_nm_interface="BSD nm" 
    49894990  echo "int some_variable = 0;" > conftest.$ac_ext 
    4990   (eval echo "\"\$as_me:4990: $ac_compile\"" >&5) 
     4991  (eval echo "\"\$as_me:4991: $ac_compile\"" >&5) 
    49914992  (eval "$ac_compile" 2>conftest.err) 
    49924993  cat conftest.err >&5 
    4993   (eval echo "\"\$as_me:4993: $NM \\\"conftest.$ac_objext\\\"\"" >&5) 
     4994  (eval echo "\"\$as_me:4994: $NM \\\"conftest.$ac_objext\\\"\"" >&5) 
    49944995  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) 
    49954996  cat conftest.err >&5 
    4996   (eval echo "\"\$as_me:4996: output\"" >&5) 
     4997  (eval echo "\"\$as_me:4997: output\"" >&5) 
    49974998  cat conftest.out >&5 
    49984999  if $GREP 'External.*some_variable' conftest.out > /dev/null; then 
     
    60436044*-*-irix6*) 
    60446045  # Find out which ABI we are using. 
    6045   echo '#line 6045 "configure"' > conftest.$ac_ext 
     6046  echo '#line 6046 "configure"' > conftest.$ac_ext 
    60466047  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 
    60476048  (eval $ac_compile) 2>&5 
     
    77267727   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    77277728   -e 's:$: $lt_compiler_flag:'` 
    7728    (eval echo "\"\$as_me:7728: $lt_compile\"" >&5) 
     7729   (eval echo "\"\$as_me:7729: $lt_compile\"" >&5) 
    77297730   (eval "$lt_compile" 2>conftest.err) 
    77307731   ac_status=$? 
    77317732   cat conftest.err >&5 
    7732    echo "$as_me:7732: \$? = $ac_status" >&5 
     7733   echo "$as_me:7733: \$? = $ac_status" >&5 
    77337734   if (exit $ac_status) && test -s "$ac_outfile"; then 
    77347735     # The compiler can only warn and ignore the option if not recognized 
     
    80488049   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    80498050   -e 's:$: $lt_compiler_flag:'` 
    8050    (eval echo "\"\$as_me:8050: $lt_compile\"" >&5) 
     8051   (eval echo "\"\$as_me:8051: $lt_compile\"" >&5) 
    80518052   (eval "$lt_compile" 2>conftest.err) 
    80528053   ac_status=$? 
    80538054   cat conftest.err >&5 
    8054    echo "$as_me:8054: \$? = $ac_status" >&5 
     8055   echo "$as_me:8055: \$? = $ac_status" >&5 
    80558056   if (exit $ac_status) && test -s "$ac_outfile"; then 
    80568057     # The compiler can only warn and ignore the option if not recognized 
     
    81538154   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    81548155   -e 's:$: $lt_compiler_flag:'` 
    8155    (eval echo "\"\$as_me:8155: $lt_compile\"" >&5) 
     8156   (eval echo "\"\$as_me:8156: $lt_compile\"" >&5) 
    81568157   (eval "$lt_compile" 2>out/conftest.err) 
    81578158   ac_status=$? 
    81588159   cat out/conftest.err >&5 
    8159    echo "$as_me:8159: \$? = $ac_status" >&5 
     8160   echo "$as_me:8160: \$? = $ac_status" >&5 
    81608161   if (exit $ac_status) && test -s out/conftest2.$ac_objext 
    81618162   then 
     
    82088209   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    82098210   -e 's:$: $lt_compiler_flag:'` 
    8210    (eval echo "\"\$as_me:8210: $lt_compile\"" >&5) 
     8211   (eval echo "\"\$as_me:8211: $lt_compile\"" >&5) 
    82118212   (eval "$lt_compile" 2>out/conftest.err) 
    82128213   ac_status=$? 
    82138214   cat out/conftest.err >&5 
    8214    echo "$as_me:8214: \$? = $ac_status" >&5 
     8215   echo "$as_me:8215: \$? = $ac_status" >&5 
    82158216   if (exit $ac_status) && test -s out/conftest2.$ac_objext 
    82168217   then 
     
    1099810999  lt_status=$lt_dlunknown 
    1099911000  cat > conftest.$ac_ext <<_LT_EOF 
    11000 #line 11000 "configure" 
     11001#line 11001 "configure" 
    1100111002#include "confdefs.h" 
    1100211003 
     
    1109811099  lt_status=$lt_dlunknown 
    1109911100  cat > conftest.$ac_ext <<_LT_EOF 
    11100 #line 11100 "configure" 
     11101#line 11101 "configure" 
    1110111102#include "confdefs.h" 
    1110211103 
     
    1312813129   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    1312913130   -e 's:$: $lt_compiler_flag:'` 
    13130    (eval echo "\"\$as_me:13130: $lt_compile\"" >&5) 
     13131   (eval echo "\"\$as_me:13131: $lt_compile\"" >&5) 
    1313113132   (eval "$lt_compile" 2>conftest.err) 
    1313213133   ac_status=$? 
    1313313134   cat conftest.err >&5 
    13134    echo "$as_me:13134: \$? = $ac_status" >&5 
     13135   echo "$as_me:13135: \$? = $ac_status" >&5 
    1313513136   if (exit $ac_status) && test -s "$ac_outfile"; then 
    1313613137     # The compiler can only warn and ignore the option if not recognized 
     
    1322713228   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    1322813229   -e 's:$: $lt_compiler_flag:'` 
    13229    (eval echo "\"\$as_me:13229: $lt_compile\"" >&5) 
     13230   (eval echo "\"\$as_me:13230: $lt_compile\"" >&5) 
    1323013231   (eval "$lt_compile" 2>out/conftest.err) 
    1323113232   ac_status=$? 
    1323213233   cat out/conftest.err >&5 
    13233    echo "$as_me:13233: \$? = $ac_status" >&5 
     13234   echo "$as_me:13234: \$? = $ac_status" >&5 
    1323413235   if (exit $ac_status) && test -s out/conftest2.$ac_objext 
    1323513236   then 
     
    1327913280   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ 
    1328013281   -e 's:$: $lt_compiler_flag:'` 
    13281    (eval echo "\"\$as_me:13281: $lt_compile\"" >&5) 
     13282   (eval echo "\"\$as_me:13282: $lt_compile\"" >&5) 
    1328213283   (eval "$lt_compile" 2>out/conftest.err) 
    1328313284   ac_status=$? 
    1328413285   cat out/conftest.err >&5 
    13285    echo "$as_me:13285: \$? = $ac_status" >&5 
     13286   echo "$as_me:13286: \$? = $ac_status" >&5 
    1328613287   if (exit $ac_status) && test -s out/conftest2.$ac_objext 
    1328713288   then 
     
    1843818439EXTRA_INCLUDES= 
    1843918440 
     18441 
     18442echo "$as_me:$LINENO: checking for --enable-debug" >&5 
     18443echo $ECHO_N "checking for --enable-debug... $ECHO_C" >&6 
     18444 
     18445 
     18446# Check whether --with-enable_debug or --without-enable_debug was given. 
     18447if test "${with_enable_debug+set}" = set; then 
     18448  withval="$with_enable_debug" 
     18449 
     18450fi; 
     18451 
     18452if test "x$enable_debug" = "xyes" ; then 
     18453 
     18454 
     18455  CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-O2 //"` 
     18456  CFLAGS=`echo "$CFLAGS " | sed "s/-O2 //"` 
     18457  CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-O //"` 
     18458  CFLAGS=`echo "$CFLAGS " | sed "s/-O //"` 
     18459 
     18460 
     18461  CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"` 
     18462  CFLAGS=`echo "$CFLAGS " | sed "s/-g //"` 
     18463 
     18464 
     18465  CXXFLAGS="$CXXFLAGS -g -DDEBUG" 
     18466  CFLAGS="$CFLAGS -g -DDEBUG" 
     18467 
     18468  echo "$as_me:$LINENO: result: yes, modified CFLAGS=$CFLAGS" >&5 
     18469echo "${ECHO_T}yes, modified CFLAGS=$CFLAGS" >&6 
     18470else 
     18471  echo "$as_me:$LINENO: result: no, CFLAGS=$CFLAGS" >&5 
     18472echo "${ECHO_T}no, CFLAGS=$CFLAGS" >&6 
     18473fi 
    1844018474 
    1844118475 
  • trunk/gdal/configure.in

    r13224 r13230  
    146146EXTRA_INCLUDES= 
    147147 
     148dnl --------------------------------------------------------------------------- 
     149dnl Check for --enable-debug 
     150dnl --------------------------------------------------------------------------- 
     151 
     152AC_MSG_CHECKING([for --enable-debug]) 
     153 
     154AC_ARG_WITH(enable_debug,[  --enable-debug      Build with -g -DDEBUG for debugging, instead of -O],,) 
     155 
     156if test "x$enable_debug" = "xyes" ; then 
     157 
     158  dnl Try to strip out optimization. 
     159 
     160  CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-O2 //"`  
     161  CFLAGS=`echo "$CFLAGS " | sed "s/-O2 //"`  
     162  CXXFLAGS=`echo "$CXXFLAGS" | sed "s/-O //"`  
     163  CFLAGS=`echo "$CFLAGS" | sed "s/-O //"`  
     164 
     165  dnl remove existing -g to avoid duplicates.  
     166 
     167  CXXFLAGS=`echo "$CXXFLAGS" | sed "s/-g //"`  
     168  CFLAGS=`echo "$CFLAGS" | sed "s/-g //"`  
     169 
     170  dnl add -g and -DDEBUG 
     171 
     172  CXXFLAGS="$CXXFLAGS -g -DDEBUG" 
     173  CFLAGS="$CFLAGS -g -DDEBUG" 
     174 
     175  AC_MSG_RESULT([yes, modified CFLAGS=]$CFLAGS) 
     176else 
     177  AC_MSG_RESULT([no, CFLAGS=]$CFLAGS) 
     178fi 
    148179 
    149180dnl ---------------------------------------------------------------------------