[v2] configure: add ABIGAIL_DEBUG options

Message ID 20200515091955.28349-1-maennich@google.com
State Committed
Headers
Series [v2] configure: add ABIGAIL_DEBUG options |

Commit Message

Matthias Männich May 15, 2020, 9:19 a.m. UTC
  When exporting ABIGAIL_DEBUG=1, the binaries compiled are especially
suitable for debugging. The CFLAGS and CXXFLAGS that are added reduce
optimization to a reasonable amount and increase debug information levels.

	* configure.ac: add ABIGAIL_DEBUG environment variable for
	improved debugging capabilities

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Dodji Seketeli May 18, 2020, 7:38 a.m. UTC | #1
Matthias Maennich <maennich@google.com> a écrit:

> When exporting ABIGAIL_DEBUG=1, the binaries compiled are especially
> suitable for debugging. The CFLAGS and CXXFLAGS that are added reduce
> optimization to a reasonable amount and increase debug information levels.
>
> 	* configure.ac: add ABIGAIL_DEBUG environment variable for
> 	improved debugging capabilities
>
> Signed-off-by: Matthias Maennich <maennich@google.com>
Acked-by: Dodji Seketeli <dodji@seketeli.org>

Applied to master, thanks!

Cheers,
  

Patch

diff --git a/configure.ac b/configure.ac
index bb48ebc70b8d..1d6fe56bb757 100644
--- a/configure.ac
+++ b/configure.ac
@@ -621,6 +621,11 @@  if test x$ABIGAIL_DEVEL != x; then
    CXXFLAGS="-g -Wall -Wextra -Werror"
 fi
 
+if test x$ABIGAIL_DEBUG != x; then
+    CFLAGS="$CFLAGS -Og -g3 -ggdb"
+    CXXFLAGS="$CXXFLAGS -Og -g3 -ggdb"
+fi
+
 if test x$ENABLE_ASAN = xyes; then
     CFLAGS="$CFLAGS -fsanitize=address"
     CXXFLAGS="$CXXFLAGS -fsanitize=address"