add --with-default-dlog build option 16/262816/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 20 Aug 2021 06:14:17 +0000 (15:14 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 20 Aug 2021 06:14:17 +0000 (15:14 +0900)
The default value of this option is yes.
If this option sets no, the default log is stdout.

Change-Id: I93524bf590869b3118279210d77b4a3c61eefe2a

configure.ac
packaging/libwayland-tbm.spec
src/wayland-tbm-int.h

index 34ba00f..11eb79e 100644 (file)
@@ -17,6 +17,16 @@ AC_ARG_WITH(unittests, AS_HELP_STRING([--with-unittests=yes/no], [whether build/
 
 AM_CONDITIONAL(HAVE_UTEST, test "x$unittests" = "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 wayland-tbm])
index 8a21c23..8eaba34 100644 (file)
@@ -78,6 +78,7 @@ LDFLAGS+=" -lgcov"
 %endif
 
 %reconfigure --with-unittests=${UTEST} \
+            --with-default-dlog=yes \
              CFLAGS="${CFLAGS} -Wall -Werror" \
              CXXFLAGS="${CXXFLAGS} -Wall -Werror" \
              LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
index ea57219..7fa9281 100644 (file)
@@ -34,13 +34,16 @@ DEALINGS IN THE SOFTWARE.
 extern "C" {
 #endif
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <tbm_bufmgr.h>
 #include <wayland-util.h>
 #include <tbm_log.h>
 #include <wayland-tbm-client.h>
 
-#define HAVE_DLOG
-#ifdef HAVE_DLOG
+#ifdef ENABLE_DLOG
 #include <dlog.h>
 
 extern int bTrace;