aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure29
-rw-r--r--src/Makefile.in8
2 files changed, 33 insertions, 4 deletions
diff --git a/configure b/configure
index b5b68b2..7df9bd1 100755
--- a/configure
+++ b/configure
@@ -609,6 +609,8 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+DEBUG_FALSE
+DEBUG_TRUE
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
@@ -700,6 +702,7 @@ ac_user_opts='
enable_option_checking
enable_silent_rules
enable_dependency_tracking
+enable_debug
'
ac_precious_vars='build_alias
host_alias
@@ -1339,6 +1342,7 @@ Optional Features:
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
+ --enable-debug Build with debug flags
Some influential environment variables:
CXX C++ compiler command
@@ -2776,6 +2780,7 @@ fi
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3623,6 +3628,26 @@ ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile src/Makefile"
+# Debug flag
+# Check whether --enable-debug was given.
+if test ${enable_debug+y}
+then :
+ enableval=$enable_debug; debug=$enableval
+else case e in #(
+ e) debug=no ;;
+esac
+fi
+
+
+ if test "$debug" = "yes"; then
+ DEBUG_TRUE=
+ DEBUG_FALSE='#'
+else
+ DEBUG_TRUE='#'
+ DEBUG_FALSE=
+fi
+
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -3756,6 +3781,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
+ as_fn_error $? "conditional \"DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
diff --git a/src/Makefile.in b/src/Makefile.in
index 06881b3..d2644e8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -87,6 +87,8 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = blc$(EXEEXT)
+@DEBUG_TRUE@am__append_1 = -O0 -g3 -fsanitize=address,undefined -fno-omit-frame-pointer
+@DEBUG_FALSE@am__append_2 = -O2 -DNDEBUG
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -252,10 +254,8 @@ blc_SOURCES = \
lexer.cpp \
parser.cpp
-AM_CXXFLAGS = \
- -std=c++17 \
- -I$(top_srcdir)/include
-
+AM_CXXFLAGS = -std=c++17 -I$(top_srcdir)/include -Wall -Wextra \
+ -Wpedantic $(am__append_1) $(am__append_2)
all: all-am
.SUFFIXES: