Fix --enable-logging flag in autotools configure script.

We also never really tested this, because we run make distcheck, which
does another configure with default flags instead of the ones we passed.

Fixes #317.
This commit is contained in:
iphydf 2016-12-11 20:38:26 +00:00
parent 029c4fb83f
commit 2dc2ac52b9
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 9 additions and 22 deletions

View File

@ -34,7 +34,6 @@ BUILD_TESTING="yes"
TOX_LOGGER="no"
TOX_DEBUG="no"
LOGGING_OUTNAM="libtoxcore.log"
NCURSES_FOUND="no"
LIBCONFIG_FOUND="no"
@ -88,9 +87,7 @@ AC_ARG_ENABLE([logging],
if test "x$enableval" = "xyes"; then
TOX_LOGGER="yes"
AC_DEFINE([TOX_LOGGER], [], [If logging enabled])
AC_DEFINE([LOGGER_LEVEL], [LOG_DEBUG], [LOG_LEVEL value])
AC_DEFINE_UNQUOTED([LOGGER_OUTPUT_FILE], ["$LOGGING_OUTNAM"], [Output of logger])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_DEBUG], [LOG_LEVEL value])
fi
]
)
@ -114,19 +111,19 @@ AC_ARG_WITH(log-level,
AC_MSG_WARN([Logging disabled!])
else
if test "x$withval" = "xTRACE"; then
AC_DEFINE([LOGGER_LEVEL], [LOG_TRACE], [LOG_LEVEL value])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_TRACE], [LOG_LEVEL value])
elif test "x$withval" = "xDEBUG"; then
AC_DEFINE([LOGGER_LEVEL], [LOG_DEBUG], [LOG_LEVEL value])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_DEBUG], [LOG_LEVEL value])
elif test "x$withval" = "xINFO"; then
AC_DEFINE([LOGGER_LEVEL], [LOG_INFO], [LOG_LEVEL value])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_INFO], [LOG_LEVEL value])
elif test "x$withval" = "xWARNING"; then
AC_DEFINE([LOGGER_LEVEL], [LOG_WARNING], [LOG_LEVEL value])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_WARNING], [LOG_LEVEL value])
elif test "x$withval" = "xERROR"; then
AC_DEFINE([LOGGER_LEVEL], [LOG_ERROR], [LOG_LEVEL value])
AC_DEFINE([MIN_LOGGER_LEVEL], [LOG_ERROR], [LOG_LEVEL value])
else
AC_MSG_WARN([Invalid logger level: $withval. Using default 'DEBUG'])
fi
@ -134,18 +131,6 @@ AC_ARG_WITH(log-level,
]
)
AC_ARG_WITH(log-path,
AC_HELP_STRING([--with-log-path=DIR],
[Path of logger output]),
[
if test "x$TOX_LOGGER" = "xno"; then
AC_MSG_WARN([Logging disabled!])
else
AC_DEFINE_UNQUOTED([LOGGER_OUTPUT_FILE], ["$withval""/""$LOGGING_OUTNAM"], [Output of logger])
fi
]
)
PKG_PROG_PKG_CONFIG
AC_ARG_ENABLE([av],

View File

@ -7,9 +7,11 @@
--with-libsodium-headers=$CACHE_DIR/include \
--enable-daemon \
--enable-logging \
--enable-ntox
--enable-ntox \
--with-log-level=TRACE
# We use make instead of RUN $MAKE here, because the autotools build will only
# ever run natively on the Linux container, never on a Windows cross compilation
# docker instance or an OSX machine.
make -j$NPROC -k
make distcheck -j$NPROC -k