Skip to content

Commit

Permalink
ADD: support for valgrind debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
byterazor committed Apr 15, 2018
1 parent e7a3a1c commit 0646184
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AC_CONFIG_FILES([

# Checks for programs.
AC_PROG_CC

CFLAGS=-Wall

AC_SEARCH_LIBS([pthread_create], [pthread], [], [
AC_MSG_ERROR([unable to find pthread library])
Expand All @@ -41,4 +41,26 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strtol])


AC_ARG_ENABLE(valgrind,
AC_HELP_STRING([--enable-valgrind],
[Run libmoolticute-c using valgrind]))

AC_MSG_CHECKING([valgrind])
valgrind_status="yes"

AM_CONDITIONAL(WITH_VALGRIND, test "$enable_valgrind" = "run")

# Build valgrind support into code
if test "$enable_valgrind" = "yes"; then
CFLAGS="$CFLAGS -O0 -ggdb3"
AC_MSG_RESULT(yes)
# No valgrind
else
AC_MSG_RESULT(no)
valgrind_status="no"
fi



AC_OUTPUT

0 comments on commit 0646184

Please sign in to comment.