From 8244b3e5afc774c5ed43edef7de74bc15e6c6931 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 28 Jul 2021 19:00:18 +0900 Subject: [PATCH] add --with-default-dlog build option The default value of this option is yes. If this option sets no, the default log is stdout. Change-Id: I806691bec7c604ff2954f7004907ac0670c43588 --- configure.ac | 10 ++++++++++ packaging/libtbm.spec | 1 + src/tbm_log.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 4016e6c..2cf19e4 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,16 @@ AC_ARG_WITH(haltests, AS_HELP_STRING([--with-haltests=yes/no], [whether build/ru AM_CONDITIONAL(HAVE_HALTESTS, test "x$haltests" = "xyes") +AC_ARG_WITH(default-dlog, AS_HELP_STRING([--with-default-dlog=yes/no], [whether use dlog as a default log or not]), + [ use_dlog="$withval" ], + [ use_dlog="yes" ]) + +AM_CONDITIONAL(ENABLE_DLOG, test "x$use_dlog" = "xyes") + +if test "x$use_dlog" = "xyes"; then + AC_DEFINE([ENABLE_DLOG], 1, "Use dlog as a default log") +fi + #AC_DEFINE(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr]) AC_DEFINE_UNQUOTED(BUFMGR_MODULE_DIR, "${BUFMGR_MODULE_PATH}", [Directory for the modules of tbm_bufmgr]) diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 224bcce..efd59b4 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -82,6 +82,7 @@ LDFLAGS+=" -lgcov" %if %{with wayland} %reconfigure --prefix=%{_prefix} --with-tbm-platform=WAYLAND --with-haltests=${HALTESTS} --bindir=%{_bindir}/hal \ + --with-default-dlog=yes \ CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" %else %reconfigure --prefix=%{_prefix} --with-tbm-platform=X11 --with-haltests=${HALTESTS} --bindir=%{_bindir}/hal \ diff --git a/src/tbm_log.c b/src/tbm_log.c index 3fea718..599d883 100644 --- a/src/tbm_log.c +++ b/src/tbm_log.c @@ -47,7 +47,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #undef LOG_TAG #define LOG_TAG "TBM" +#if ENABLE_DLOG static unsigned int dlog_enable = 1; +#else +static unsigned int dlog_enable = 0; +#endif static unsigned int color_enable = 1; static unsigned int assert_level = TBM_LOG_LEVEL_NONE; -- 2.7.4