From 4fb95b414c9838e475be2a59ecf8c6f2ba26570c Mon Sep 17 00:00:00 2001 From: Alexey Indeev Date: Tue, 14 Oct 2014 13:43:10 -0700 Subject: [PATCH] #136 Separated debug and debug flag for testing into 2 variables --- Makefile.in | 1 + configure | 48 +++++++++++++++++-------------- configure.ac | 7 +++-- docs/Makefile.in | 1 + kernel/Makefile.in | 1 + kernel/linux/Makefile.in | 1 + kernel/linux/example/Makefile.in | 1 + kernel/linux/quick_tx/Makefile.in | 1 + lib/Makefile.in | 1 + libopts/Makefile.in | 1 + scripts/Makefile.in | 1 + src/Makefile.in | 1 + src/common/Makefile.in | 1 + src/fragroute/Makefile.in | 1 + src/tcpedit/Makefile.in | 1 + test/Makefile.am | 2 +- test/Makefile.in | 3 +- 17 files changed, 47 insertions(+), 26 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6b1b43315..54bfd99e2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -218,6 +218,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/configure b/configure index d1e231786..47c49ec3a 100755 --- a/configure +++ b/configure @@ -793,6 +793,7 @@ LPCAPINC DMALLOC_LIB timestamp_trace_flag extra_debug_flag +debug_run_time_flag debug_flag WORDS_BIGENDIAN_FALSE WORDS_BIGENDIAN_TRUE @@ -5344,13 +5345,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5347: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5348: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5350: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:5351: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5353: output\"" >&5) + (eval echo "\"\$as_me:5354: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -6556,7 +6557,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6559 "configure"' > conftest.$ac_ext + echo '#line 6560 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8082,11 +8083,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8085: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8086: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8089: \$? = $ac_status" >&5 + echo "$as_me:8090: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8421,11 +8422,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8424: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8425: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8428: \$? = $ac_status" >&5 + echo "$as_me:8429: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8526,11 +8527,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8529: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8530: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8533: \$? = $ac_status" >&5 + echo "$as_me:8534: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8581,11 +8582,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8584: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8585: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8588: \$? = $ac_status" >&5 + echo "$as_me:8589: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10965,7 +10966,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10968 "configure" +#line 10969 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11061,7 +11062,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11064 "configure" +#line 11065 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14366,11 +14367,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14369: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14370: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14373: \$? = $ac_status" >&5 + echo "$as_me:14374: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14465,11 +14466,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14468: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14469: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14472: \$? = $ac_status" >&5 + echo "$as_me:14473: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14517,11 +14518,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14520: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14521: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14524: \$? = $ac_status" >&5 + echo "$as_me:14525: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18614,7 +18615,8 @@ fi debug=no -debug_flag= +debug_flag=NDEBUG +debug_run_time_flag= # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; if test x$enableval = xyes; then @@ -18622,7 +18624,8 @@ if test "${enable_debug+set}" = set; then : CFLAGS="${USER_CFLAGS} -g -O0 -std=gnu99 -Wall $wextra $wfatal_errors $wno_variadic_macros $wno_format_contains_nul" # We may also want to add: # -Wformat-security -Wswitch-default -Wunused-paramter -Wpadded" - debug_flag=--dbug=1 + debug_flag=DEBUG + debug_run_time_flag=--dbug=1 $as_echo "#define DEBUG 1" >>confdefs.h @@ -18631,6 +18634,7 @@ fi + extra_debug=no extra_debug_flag=NEXTRA_DBUG # Check whether --enable-extra-debug was given. diff --git a/configure.ac b/configure.ac index 1de571cf2..03a1eafcf 100644 --- a/configure.ac +++ b/configure.ac @@ -242,7 +242,8 @@ AM_CONDITIONAL([WORDS_BIGENDIAN], [ test x$ac_cv_c_bigendian = xyes ]) dnl Enable debugging in code/compiler options debug=no -debug_flag= +debug_flag=NDEBUG +debug_run_time_flag= AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging code and support for the -d option]), [ if test x$enableval = xyes; then @@ -250,10 +251,12 @@ AC_ARG_ENABLE(debug, CFLAGS="${USER_CFLAGS} -g -O0 -std=gnu99 -Wall $wextra $wfatal_errors $wno_variadic_macros $wno_format_contains_nul" # We may also want to add: # -Wformat-security -Wswitch-default -Wunused-paramter -Wpadded" - debug_flag=--dbug=1 + debug_flag=DEBUG + debug_run_time_flag=--dbug=1 AC_DEFINE([DEBUG], [1], [Enable debugging code and support for the -d option]) fi]) AC_SUBST(debug_flag) +AC_SUBST(debug_run_time_flag) dnl Enable extra debugging in code/compiler options - may slow down performance extra_debug=no diff --git a/docs/Makefile.in b/docs/Makefile.in index 96de4f108..28380cfdb 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -162,6 +162,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/kernel/Makefile.in b/kernel/Makefile.in index 4fc5a1be0..13f260cd1 100644 --- a/kernel/Makefile.in +++ b/kernel/Makefile.in @@ -204,6 +204,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/kernel/linux/Makefile.in b/kernel/linux/Makefile.in index 3de3656dd..1e605f03a 100644 --- a/kernel/linux/Makefile.in +++ b/kernel/linux/Makefile.in @@ -204,6 +204,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/kernel/linux/example/Makefile.in b/kernel/linux/example/Makefile.in index cd5d5d066..ff7ae0834 100644 --- a/kernel/linux/example/Makefile.in +++ b/kernel/linux/example/Makefile.in @@ -189,6 +189,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/kernel/linux/quick_tx/Makefile.in b/kernel/linux/quick_tx/Makefile.in index 1415c576f..fbdd19946 100644 --- a/kernel/linux/quick_tx/Makefile.in +++ b/kernel/linux/quick_tx/Makefile.in @@ -213,6 +213,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/lib/Makefile.in b/lib/Makefile.in index f9133c59e..d8ffd0620 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -189,6 +189,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/libopts/Makefile.in b/libopts/Makefile.in index dfdbba866..a48a68b47 100644 --- a/libopts/Makefile.in +++ b/libopts/Makefile.in @@ -209,6 +209,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 8e5a913d5..0fef14894 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -162,6 +162,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/src/Makefile.in b/src/Makefile.in index 8fda26d92..4c4c06aed 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -332,6 +332,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/src/common/Makefile.in b/src/common/Makefile.in index aa47fad0b..da2310a83 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -202,6 +202,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/src/fragroute/Makefile.in b/src/fragroute/Makefile.in index 58f595252..3cd9284ec 100644 --- a/src/fragroute/Makefile.in +++ b/src/fragroute/Makefile.in @@ -207,6 +207,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/src/tcpedit/Makefile.in b/src/tcpedit/Makefile.in index 2dea7b99a..bfa7f08b1 100644 --- a/src/tcpedit/Makefile.in +++ b/src/tcpedit/Makefile.in @@ -300,6 +300,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ diff --git a/test/Makefile.am b/test/Makefile.am index ea74f3d96..86b3075a8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -7,7 +7,7 @@ BUILD = @build@ nic1 = @nic1@ nic2 = @nic2@ -ENABLE_DEBUG = @debug_flag@ +ENABLE_DEBUG = @debug_run_time_flag@ TCPPREP=../src/tcpprep --no-arg-comment TCPREPLAY=../src/tcpreplay TCPREWRITE=../src/tcprewrite diff --git a/test/Makefile.in b/test/Makefile.in index 19fcd7b96..10fb4b034 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -163,6 +163,7 @@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ debug_flag = @debug_flag@ +debug_run_time_flag = @debug_run_time_flag@ depmod = @depmod@ docdir = @docdir@ dvidir = @dvidir@ @@ -218,7 +219,7 @@ MAKEFLAGS = -s -k HOST = @host@ TARGET = @target@ BUILD = @build@ -ENABLE_DEBUG = @debug_flag@ +ENABLE_DEBUG = @debug_run_time_flag@ TCPPREP = ../src/tcpprep --no-arg-comment TCPREPLAY = ../src/tcpreplay TCPREWRITE = ../src/tcprewrite