Skip to content

Commit

Permalink
Fix --disable-X for some options in configure
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson authored and fingolfin committed Oct 9, 2020
1 parent b918f50 commit 0f8f080
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,17 @@ dnl User setting: Debug mode (off by default)
dnl
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [enable debug mode])],
[AC_DEFINE([GAP_KERNEL_DEBUG], [1], [define if building in debug mode])
AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
[]
[enable_debug=no]
)
AC_MSG_CHECKING([whether to enable debug mode])
AC_MSG_RESULT([$enable_debug])

AS_IF([test "x$enable_debug" != "xno"],
[AC_DEFINE([GAP_KERNEL_DEBUG], [1], [define if building in debug mode])
AC_DEFINE([GAP_PRINT_BACKTRACE], [1], [to enable backtraces upon crashes])],
)

dnl
dnl Maintainer mode (on by default) controls whether our build system
dnl automatically regenerates `configure` if `configure.ac` or any of its
Expand All @@ -412,21 +416,29 @@ AC_SUBST([MAINTAINER_MODE], [$enable_maintainer_mode])
dnl
AC_ARG_ENABLE([memory-checking],
[AS_HELP_STRING([--enable-memory-checking], [enable memory checking])],
[AC_DEFINE([GAP_MEM_CHECK], [1], [define if building with memory checking])],
[],
[enable_memory_checking=no]
)
AC_MSG_CHECKING([whether to enable memory checking])
AC_MSG_RESULT([$enable_memory_checking])

AS_IF([test "x$enable_memory_checking" != "xno"],
[AC_DEFINE([GAP_MEM_CHECK], [1], [define if building with memory checking])]
)

dnl
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind], [enable valgrind extensions to GASMAN])],
[AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])],
[],
[enable_valgrind=no]
)
AC_MSG_CHECKING([whether to enable valgrind extensions to GASMAN])
AC_MSG_RESULT([$enable_valgrind])

AS_IF([test "x$enable_valgrind" != "xno"],
[AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])]
)

if test "x$enable_valgrind" != "xno" -a "x$enable_memory_checking" != "xno"; then
AC_MSG_ERROR([--enable-valgrind and --enable-memory-checking cannot be used at the same time])
fi
Expand Down

0 comments on commit 0f8f080

Please sign in to comment.