From: Donald Sharp Date: Thu, 31 Aug 2017 12:56:44 +0000 (-0400) Subject: configure: Modify compiler options with dev build X-Git-Tag: frr-4.0-dev~275^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=37b5aaf8fd0a41d4ba1a343b20bc5bfea182bcd9;p=mirror%2Ffrr.git configure: Modify compiler options with dev build When building a dev build, modify the compiler options to be "-g -O0" to allow for better debugging. Signed-off-by: Donald Sharp --- diff --git a/configure.ac b/configure.ac index fb73583c28..5f47ca7fb9 100755 --- a/configure.ac +++ b/configure.ac @@ -185,14 +185,6 @@ CC="${CC% -std=c99}" AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"]) -dnl if the user specified any CFLAGS, we don't add "-g -Os/-O2" here -if test "z$orig_cflags" = "z"; then - AC_C_FLAG([-g]) - AC_C_FLAG([-Os], [ - AC_C_FLAG([-O2]) - ]) -fi - dnl always want these CFLAGS AC_C_FLAG([-fno-omit-frame-pointer]) AC_C_FLAG([-funwind-tables]) @@ -438,6 +430,16 @@ AM_CONDITIONAL([FPM], [test "x$enable_fpm" = "xyes"]) if test "x${enable_dev_build}" = "xyes"; then AC_DEFINE(DEV_BUILD,,Build for development) + AC_C_FLAG([-g]) + AC_C_FLAG([-O0]) +else + dnl if the user specified any CFLAGS, we don't add "-g -Os/-O2" here + if test "z$orig_cflags" = "z"; then + AC_C_FLAG([-g]) + AC_C_FLAG([-Os], [ + AC_C_FLAG([-O2]) + ]) + fi fi AM_CONDITIONAL([DEV_BUILD], [test "x$enable_dev_build" = "xyes"])