add --with-default-dlog build option 97/261897/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 28 Jul 2021 10:00:18 +0000 (19:00 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 28 Jul 2021 10:00:18 +0000 (19:00 +0900)
The default value of this option is yes.
If this option sets no, the default log is stdout.

Change-Id: I806691bec7c604ff2954f7004907ac0670c43588

configure.ac
packaging/libtbm.spec
src/tbm_log.c

index 4016e6c89178156d7b996abe78b2ad7fb3b08711..2cf19e438f33be4cbe6442a938574083c50e20de 100644 (file)
@@ -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])
 
index 224bcceae2a405439266c130d67d1fc05090cd2b..efd59b42b2a49a82addcde335ce94f4073af3f83 100644 (file)
@@ -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 \
index 3fea7187fe9f9e583cd937aa887633671773817c..599d883e6a074547b3a29e6c355425ea5db06e0f 100644 (file)
@@ -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;