mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
configure.ac: Add more granular switches for --enable-assert and --enable-optimize.
This commit is contained in:
parent
ebcf5206e6
commit
7854dc51c1
1 changed files with 50 additions and 7 deletions
57
configure.ac
57
configure.ac
|
@ -151,12 +151,41 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging suite fo
|
||||||
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise])
|
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise])
|
||||||
], [
|
], [
|
||||||
AC_SUBST(DEBUG, 0)
|
AC_SUBST(DEBUG, 0)
|
||||||
CPPDEFINE([NDEBUG])
|
|
||||||
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release])
|
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release])
|
||||||
])
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]])
|
AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]])
|
||||||
|
|
||||||
|
dnl Explicit assert switch for still using assert() without --enable-debug
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(if you want to explicitly enable assertions)
|
||||||
|
AC_ARG_ENABLE(assert, AC_HELP_STRING([--enable-assert], [Enable assertions without --enable-debug]),
|
||||||
|
[
|
||||||
|
AC_SUBST(ASSERT, 1)
|
||||||
|
], [
|
||||||
|
AC_SUBST(ASSERT, $DEBUG)
|
||||||
|
])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([ASSERT], [[[[ "$ASSERT" = "1" ]]]])
|
||||||
|
|
||||||
|
AM_COND_IF(ASSERT,
|
||||||
|
[
|
||||||
|
], [
|
||||||
|
CPPDEFINE([NDEBUG])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl Explicit optimize switch for enabling optimization when using --enable-debug
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(if you want to explicitly enable optimized build)
|
||||||
|
AC_ARG_ENABLE(optimize, AC_HELP_STRING([--enable-optimize], [Enable optimization even with --enable-debug]),
|
||||||
|
[
|
||||||
|
AC_SUBST(OPTIMIZE, 1)
|
||||||
|
], [
|
||||||
|
AC_SUBST(OPTIMIZE, $DEBUG != "1")
|
||||||
|
])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([OPTIMIZE], [[[[ "$OPTIMIZE" = "1" ]]]])
|
||||||
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Profiling mode
|
dnl Profiling mode
|
||||||
|
@ -198,11 +227,8 @@ dnl
|
||||||
dnl Optimization
|
dnl Optimization
|
||||||
dnl
|
dnl
|
||||||
|
|
||||||
AM_COND_IF([DEBUG],
|
AM_COND_IF([OPTIMIZE],
|
||||||
[
|
[
|
||||||
CXXFLAGS+=" -O0"
|
|
||||||
CXXFLAGS+=" -ggdb"
|
|
||||||
], [
|
|
||||||
CXXFLAGS+=" -O3"
|
CXXFLAGS+=" -O3"
|
||||||
CXXFLAGS+=" -fweb"
|
CXXFLAGS+=" -fweb"
|
||||||
CXXFLAGS+=" -fdata-sections"
|
CXXFLAGS+=" -fdata-sections"
|
||||||
|
@ -225,6 +251,9 @@ AM_COND_IF([DEBUG],
|
||||||
|
|
||||||
dnl remember to axe this when lto is enabled
|
dnl remember to axe this when lto is enabled
|
||||||
CXXFLAGS+=" -ggdb"
|
CXXFLAGS+=" -ggdb"
|
||||||
|
], [
|
||||||
|
CXXFLAGS+=" -O0"
|
||||||
|
CXXFLAGS+=" -ggdb"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@ -1412,6 +1441,18 @@ else
|
||||||
debug="no"
|
debug="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $OPTIMIZE ]]; then
|
||||||
|
optimize="yes"
|
||||||
|
else
|
||||||
|
optimize="no"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $ASSERT ]]; then
|
||||||
|
assert="yes"
|
||||||
|
else
|
||||||
|
assert="no"
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Make it look sexay!
|
dnl Make it look sexay!
|
||||||
echo
|
echo
|
||||||
echo "Configured ........................ $PACKAGE_NAME $PACKAGE_VERSION"
|
echo "Configured ........................ $PACKAGE_NAME $PACKAGE_VERSION"
|
||||||
|
@ -1427,10 +1468,12 @@ echo "GNU MP support .................... $have_gmp"
|
||||||
echo "Sodium support .................... $have_sodium"
|
echo "Sodium support .................... $have_sodium"
|
||||||
echo "SSL support........................ $SSL_TYPE"
|
echo "SSL support........................ $SSL_TYPE"
|
||||||
echo "Magic support...................... $have_magic"
|
echo "Magic support...................... $have_magic"
|
||||||
|
echo "Linux AIO support ................. $aio"
|
||||||
|
echo "IPv6 support ...................... $ipv6"
|
||||||
echo "Precompiled headers ............... $build_pch"
|
echo "Precompiled headers ............... $build_pch"
|
||||||
echo "Developer debug ................... $debug"
|
echo "Developer debug ................... $debug"
|
||||||
echo "IPv6 support ...................... $ipv6"
|
echo "Developer assert .................. $assert"
|
||||||
echo "Linux AIO support ................. $aio"
|
echo "Optimized build ................... $optimize"
|
||||||
echo "Installing into ................... $prefix"
|
echo "Installing into ................... $prefix"
|
||||||
echo
|
echo
|
||||||
echo "* Ready to build $PACKAGE_NAME"
|
echo "* Ready to build $PACKAGE_NAME"
|
||||||
|
|
Loading…
Reference in a new issue