libmessageport_dbus_glue_la_CPPFLAGS = \
-I$(top_builddir) \
- $(GLIB_CFLAGS) $(GIO_CFLAGS) $(GIOUNIX_CFLAGS) \
+ $(GLIB_CFLAGS) $(GIO_CFLAGS) $(GIOUNIX_CFLAGS) $(DLOG_CFLAGS) \
$(NULL)
libmessageport_dbus_glue_la_LIBADD = \
- $(GLIB_LIBS) $(GIO_LIBS) $(GIOUNIX_LIBS) \
+ $(GLIB_LIBS) $(GIO_LIBS) $(GIOUNIX_LIBS) $(DLOG_LIBS) \
$(NULL)
#define _MSGPORT_LOG_H
#include <glib.h>
+#include "config.h"
-#define LOG(log_func, frmt, args...) log_func("%s +%d:"frmt, __FILE__, __LINE__, ##args)
+#ifdef HAVE_DLOG
-#define DBG(frmt, args...) LOG(g_debug, frmt, ##args)
-#define WARN(frmt, args...) LOG(g_warning, frmt, ##args)
-#define ERR(frmt, args...) LOG(g_error, frmt, ##args)
+# include <dlog.h>
+
+# define __LOG(prio, frmt, args...) print_log(prio, LOG_TAG, "%s +%d:"frmt, __FILE__, __LINE__, ##args)
+
+# define DBG(frmt, args...) __LOG(DLOG_DEBUG, frmt, ##args)
+# define WARN(frmt, args...) __LOG(DLOG_WARN, frmt, ##args)
+# define ERR(frmt, args...) __LOG(DLOG_ERROR, frmt, ##args)
+
+#else /* USE_DLOG */
+
+# define __LOG(log_func, frmt, args...) log_func("%s +%d:"frmt, __FILE__, __LINE__, ##args)
+
+# define DBG(frmt, args...) __LOG(g_debug, frmt, ##args)
+# define WARN(frmt, args...) __LOG(g_warning, frmt, ##args)
+# define ERR(frmt, args...) __LOG(g_error, frmt, ##args)
+
+#endif /* USE_DLOG */
#endif /* _MSGPORT_LOG_H */
AC_SUBST(BUNDLE_CFLAGS)
AC_SUBST(BUNDLE_LIBS)
+PKG_CHECK_MODULES([DLOG], [dlog], [AC_DEFINE([HAVE_DLOG], [1], [Use DLOG])])
+AC_SUBST(DLOG_CFLAGS)
+AC_SUBST(DLOG_LIBS)
+
AC_DEFINE(MESSAGEPORT_BUS_ADDRESS,
["unix:path=%s/.message-port", g_get_user_runtime_dir()],
[messageport daemon server socket address])
messageportd_CPPFLAGS = \
-I$(top_builddir) \
- $(GLIB_CLFAGS) $(GIO_CFLAGS) $(AUL_CFLAGS) $(PKGMGRINFO_CFLAGS)\
+ -DLOG_TAG=\"MESSAGEPORT/DAEMON\" \
+ $(GLIB_CLFAGS) $(GIO_CFLAGS) $(AUL_CFLAGS) $(PKGMGRINFO_CFLAGS) $(DLOG_CFLAGS) \
$(NULL)
messageportd_LDADD = \
../common/libmessageport-common.la \
- $(GLIB_LIBS) $(GIO_LIBS) $(AUL_LIBS) $(PKGMGRINFO_LIBS) \
+ $(GLIB_LIBS) $(GIO_LIBS) $(AUL_LIBS) $(PKGMGRINFO_LIBS) $(DLOG_LIBS) \
$(NULL)
CLEANFILES =
bin_PROGRAMS = msgport-example-app msgport-example-app-cpp
msgport_example_app_SOURCES = test-app.c
-msgport_example_app_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS)
-msgport_example_app_CPPFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS)
+msgport_example_app_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS)
+msgport_example_app_CPPFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS)
msgport_example_app_cpp_SOURCES = test-app.cpp
-msgport_example_app_cpp_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS)
-msgport_example_app_cpp_CXXFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS)
+msgport_example_app_cpp_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS)
+msgport_example_app_cpp_CXXFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS)
libmessage_port_la_CPPFLAGS = \
-I . \
-I $(top_builddir) \
- -I $(top_builddir)/daemon \
- $(GLIB_CFLAGS) $(GIO_CFLAGS) $(BUNDLE_CFLAGS) \
+ -DLOG_TAG=\"MESSAGEPORT/LIB\" \
+ $(GLIB_CFLAGS) $(GIO_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS) \
-Wall -error
$(NULL)
libmessage_port_la_LIBADD = \
../common/libmessageport-common.la \
- $(GLIB_LIBS) $(GIO_LIBS) $(BUNDLE_LIBS)
+ $(GLIB_LIBS) $(GIO_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS) \
+ $(NULL)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = message-port.pc
Description: Message port client library for WRT plugin
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
-Requires: glib-2.0 >= 2.30 gio-2.0 gio-unix-2.0 bundle
-Libs: -L${libdir}
+Requires: glib-2.0 >= 2.30 gio-2.0 gio-unix-2.0 bundle dlog
+Libs: -L${libdir} -lmessage-port
Cflags: -I${includedir}
Source: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(aul)
+BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0) >= 2.30