summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-07 09:39:15 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-29 10:01:19 -0400
commit09329dbcf73c7c2beab7ce4968dc3ad8eb1410fb (patch)
treec51f2b01a23cc90c3df5247db48441d21a62d615
parentc00ad29fc4a75ba64f42999c7a3aa8fc60b52c81 (diff)
configure: Have --enable-dev-build turn on better debugging.
Turn on '-g3 and -O0' for compilation. Additionally document the --enable-dev-build flag in our documentation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rwxr-xr-xconfigure.ac32
-rw-r--r--doc/install.texi4
2 files changed, 21 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 2faaa7fc8e..cae5061122 100755
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,23 @@ CC="${CC% -std=c99}"
AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
+dnl if the user has specified any CFLAGS, override our settings
+if test "x${enable_dev_build}" = "xyes"; then
+ AC_DEFINE(DEV_BUILD,,Build for development)
+ if test "z$orig_cflags" = "z"; then
+ AC_C_FLAG([-g3])
+ AC_C_FLAG([-O0])
+ fi
+else
+ 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"])
+
dnl always want these CFLAGS
AC_C_FLAG([-fno-omit-frame-pointer])
AC_C_FLAG([-funwind-tables])
@@ -428,21 +445,6 @@ fi
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"])
-
#
# Python for clippy
#
diff --git a/doc/install.texi b/doc/install.texi
index 9a98f46733..1930af95e6 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -97,6 +97,10 @@ Controls backtrace support for the crash handlers. This is autodetected by
default. Using the switch will enforce the requested behaviour, failing with
an error if support is requested but not available. On BSD systems, this
needs libexecinfo, while on glibc support for this is part of libc itself.
+@item --enable-dev-build
+Turn on some options for compiling FRR within a development environment in
+mind. Specifically turn on -g3 -O0 for compiling options and add inclusion
+of grammar sandbox.
@end table
You may specify any combination of the above options to the configure