diff options
author | toni <matzeton@googlemail.com> | 2016-07-04 13:29:45 +0200 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-07-04 13:29:45 +0200 |
commit | 3b40a0f20ce33de44f47fd56c818323185ad091d (patch) | |
tree | d5395d80374ff2568bf522ee16fb445622456ddb | |
parent | ac97850fb2b8c1e4efbaf782bf8afbc4b3d6a058 (diff) |
autoconf: debug mode
-rwxr-xr-x | compile.sh | 2 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | src/Makefile.am | 5 |
3 files changed, 18 insertions, 2 deletions
@@ -6,6 +6,6 @@ PWD=$(pwd) cd ${DIR} ./autogen.sh -./configure +./configure $* make cd ${PWD} diff --git a/configure.ac b/configure.ac index 740f02a..cef76e0 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_CONFIG_SRCDIR([src/aconfig.h.in]) AC_CONFIG_HEADER([src/aconfig.h]) AC_CONFIG_MACRO_DIR([m4]) AC_USE_SYSTEM_EXTENSIONS -CFLAGS="-Os" +CFLAGS="" LDFLAGS="" # Checks for programs. @@ -59,6 +59,17 @@ AC_FUNC_MKTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS([clock_gettime asprintf system printf fprintf mkfifo stat open close fork memmove memcpy memset strdup strndup strerror strstr strlen strnlen strtol openlog vsyslog closelog],,[AC_MSG_ERROR([*** Missing essential functions.])]) +AC_ARG_ENABLE(debug, +AS_HELP_STRING([--enable-debug], + [enable debugging, default: no]), +[case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; +esac], +[debug=false]) +AM_CONDITIONAL(DEBUG, test x"$debug" = x"true") + AC_DEFINE([HAVE_CONFIG], [1], [Do NOT change THIS!]) LDFLAGS="${LDFLAGS} -pthread -lrt -lncurses" AC_SUBST([AM_CFLAGS]) diff --git a/src/Makefile.am b/src/Makefile.am index e6f5c91..44d2220 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,8 @@ bin_PROGRAMS=naskpass naskpass_check naskpass_SOURCES=main.c log.c opt.c status.c ui_ani.c ui.c ui_elements.c ui_input.c ui_ipc.c ui_txtwindow.c ui_statusbar.c naskpass_check_SOURCES=check/check.c +if DEBUG +naskpass_CFLAGS=-O0 -g3 -DDEBUG +else +naskpass_CFLAGS=-Os +endif |