add --with-default-dlog build option 54/261854/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 27 Jul 2021 09:23:00 +0000 (18:23 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 27 Jul 2021 23:24:17 +0000 (08:24 +0900)
The default value of this option is yes.
If this option sets no, the default log is stdout.

Change-Id: Id710203804368e9397149e3dcf4b8a8be33db423

common/tdm_log.c
configure.ac
packaging/libtdm.spec

index 975eb19..68621bf 100644 (file)
 #undef LOG_TAG
 #define LOG_TAG "TDM"
 
+#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 = TDM_LOG_LEVEL_NONE;
index c0bf70a..d1f3dcc 100644 (file)
@@ -37,6 +37,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_PATH_PROG([wayland_scanner], [wayland-scanner])
 if test x$wayland_scanner = x; then
    AC_MSG_ERROR([wayland-scanner is needed to compile])
index da6212e..98a2a55 100644 (file)
@@ -85,6 +85,7 @@ LDFLAGS+=" -lgcov"
 %endif
 
 %reconfigure --disable-static --with-haltests=${HALTESTS} --bindir=%{_bindir}/hal \
+             --with-default-dlog=yes \
              --with-tdm-data-path=%{TZ_SYS_RO_SHARE}/tdm \
              CFLAGS="${CFLAGS} -Wall -Werror" \
              CXXFLAGS="${CXXFLAGS} -Wall -Werror" \