configure: --enable-debug make this a user accessible config

This should help with automated CI testing as well, where a suite
can be run and debug enabled and checked, just via a specific
CI setup.
This commit is contained in:
Darryl L. Miles 2024-10-17 11:00:28 +01:00 committed by R. Timothy Edwards
parent dd49ca21d2
commit 49caa3267b
2 changed files with 14 additions and 2 deletions

View File

@ -207,6 +207,17 @@ if test "x$enable_assertions" = "xyes" ; then
NDEBUG_defs=""
fi
dnl Control assertions in codebase from configure
AC_ARG_ENABLE(debug,
[ --enable-debug build with fatal debug enabled],
[],
[enable_debug=no])
DEBUG_defs=""
if test "x$enable_debug" = "xyes" ; then
DEBUG_defs="-DDEBUG"
fi
dnl Allow file compression (zlib) to be disabled
AC_ARG_ENABLE(compression,
[ --disable-compression disable file compression],
@ -1823,6 +1834,7 @@ AC_SUBST(SCRIPTS)
AC_SUBST(extra_libs)
AC_SUBST(extra_defs)
AC_SUBST(stub_defs)
AC_SUBST(DEBUG_defs)
AC_SUBST(NDEBUG_defs)
AC_SUBST(ld_extra_libs)
AC_SUBST(ld_extra_objs)

View File

@ -94,9 +94,9 @@ CXX = @CXX@
CPPFLAGS = -I${MAGICDIR} @CPPFLAGS@
DFLAGS_MAGICVERSION = -DMAGIC_VERSION=\"${MAGIC_VERSION}\" -DMAGIC_REVISION=\"${MAGIC_REVISION}\" -DMAGIC_COMMIT=\"${MAGIC_COMMIT}\" "-DMAGIC_BUILDDATE=\"${MAGIC_BUILDDATE}\""
DFLAGS = @extra_defs@ @stub_defs@ @DEFS@ ${DFLAGS_MAGICVERSION} -DGCORE=\"@GCORE@\"
DFLAGS += -DSHDLIB_EXT=\"@SHDLIB_EXT@\" @NDEBUG_defs@
DFLAGS += -DSHDLIB_EXT=\"@SHDLIB_EXT@\" @NDEBUG_defs@ @DEBUG_defs@
DFLAGS_NOSTUB = @extra_defs@ @DEFS@ ${DFLAGS_MAGICVERSION} -DGCORE=\"@GCORE@\"
DFLAGS_NOSTUB += -DSHDLIB_EXT=\"@SHDLIB_EXT@\" @NDEBUG_defs@
DFLAGS_NOSTUB += -DSHDLIB_EXT=\"@SHDLIB_EXT@\" @NDEBUG_defs@ @DEBUG_defs@
CFLAGS = @CFLAGS@ @SHLIB_CFLAGS@ @INC_SPECS@
READLINE_DEFS = @rl_defs@