]> git.puffer.fish Git - mirror/frr.git/commitdiff
configure: Modify compiler options with dev build
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Aug 2017 12:56:44 +0000 (08:56 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Aug 2017 14:30:19 +0000 (10:30 -0400)
When building a dev build, modify the compiler options
to be "-g -O0" to allow for better debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac

index fb73583c28bc9387355d31e8eed83170958ad2ac..5f47ca7fb92a1d36633a9cf51a07912eba637845 100755 (executable)
@@ -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"])