configure: Support ABIGAIL_NO_OPTIMIZATION_DEBUG environment variable

When working in development environments with compiler versions that
might be very bleeding edge (like the Fedora Rawhide distribution) it
might be worthwhile to disable all compiler optimization to have a
better debugging experience.  In practice, I bumped into this need
again and again.

So I am adding this ABIGAIL_NO_OPTIMIZATION_DEBUG environment variable
to basically allow the "-g -O0" combination, if need be.

This patch obviously doesn't change any existing behaviour if the user
doesn't set this newly introduced environment variable.

	* configure.ac: Set the CXXFLAGS and CFLAGS to "-g -O0 -Wall
	-Wextra -Werror" if the ABIGAIL_NO_OPTIMIZATION_DEBUG is set.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2020-10-13 18:15:05 +02:00
parent 470e10ff52
commit 8d7ffe3d06

View File

@ -626,6 +626,11 @@ if test x$ABIGAIL_DEBUG != x; then
CXXFLAGS="$CXXFLAGS -Og -g3 -ggdb"
fi
if test x$ABIGAIL_NO_OPTIMIZATION_DEBUG != x; then
CFLAGS="-g -O0 -Wall -Wextra -Werror"
CXXFLAGS="-g -O0 -Wall -Wextra -Werror"
fi
if test x$ENABLE_ASAN = xyes; then
CFLAGS="$CFLAGS -fsanitize=address"
CXXFLAGS="$CXXFLAGS -fsanitize=address"