logging: move logging into its own subdir

Some stuff we build (the DHCP manager) gets built independently
so that we can use it for unit tests.  For that, we need to build
the logging bits separately too, since the independent DHCP
library can't use them if they are embedded in NM.
This commit is contained in:
Dan Williams
2010-04-06 17:39:57 -07:00
parent 3d6108f245
commit a00a6e5d87
10 changed files with 47 additions and 5 deletions

View File

@@ -440,6 +440,7 @@ include/Makefile
src/Makefile src/Makefile
src/tests/Makefile src/tests/Makefile
marshallers/Makefile marshallers/Makefile
src/logging/Makefile
src/named-manager/Makefile src/named-manager/Makefile
src/vpn-manager/Makefile src/vpn-manager/Makefile
src/dhcp-manager/Makefile src/dhcp-manager/Makefile

View File

@@ -1,4 +1,5 @@
SUBDIRS= \ SUBDIRS= \
logging \
named-manager \ named-manager \
vpn-manager \ vpn-manager \
dhcp-manager \ dhcp-manager \
@@ -16,6 +17,7 @@ SUBDIRS= \
INCLUDES = -I${top_srcdir} \ INCLUDES = -I${top_srcdir} \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/marshallers \ -I${top_builddir}/marshallers \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/named-manager \ -I${top_srcdir}/src/named-manager \
-I${top_srcdir}/src/vpn-manager \ -I${top_srcdir}/src/vpn-manager \
-I${top_srcdir}/src/dhcp-manager \ -I${top_srcdir}/src/dhcp-manager \
@@ -125,8 +127,6 @@ NetworkManager_SOURCES = \
NetworkManagerUtils.h \ NetworkManagerUtils.h \
nm-system.c \ nm-system.c \
nm-system.h \ nm-system.h \
nm-logging.c \
nm-logging.h \
nm-manager.c \ nm-manager.c \
nm-manager.h \ nm-manager.h \
nm-netlink-monitor.c \ nm-netlink-monitor.c \
@@ -224,6 +224,7 @@ NetworkManager_CPPFLAGS = \
NetworkManager_LDADD = \ NetworkManager_LDADD = \
$(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/marshallers/libmarshallers.la \
./logging/libnm-logging.la \
./named-manager/libnamed-manager.la \ ./named-manager/libnamed-manager.la \
./vpn-manager/libvpn-manager.la \ ./vpn-manager/libvpn-manager.la \
./dhcp-manager/libdhcp-manager.la \ ./dhcp-manager/libdhcp-manager.la \

View File

@@ -3,6 +3,7 @@ INCLUDES = \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-util \
-I${top_srcdir}/src \ -I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_builddir}/marshallers \ -I${top_builddir}/marshallers \
-I$(top_srcdir)/src/nm-bluez-manager -I$(top_srcdir)/src/nm-bluez-manager
@@ -30,6 +31,7 @@ libbluez_manager_la_CPPFLAGS = \
libbluez_manager_la_LIBADD = \ libbluez_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \ $(DBUS_LIBS) \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(BLUEZ_LIBS) $(BLUEZ_LIBS)

14
src/logging/Makefile.am Normal file
View File

@@ -0,0 +1,14 @@
noinst_LTLIBRARIES = libnm-logging.la
libnm_logging_la_SOURCES = \
nm-logging.c \
nm-logging.h
libnm_logging_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DG_DISABLE_DEPRECATED
libnm_logging_la_LIBADD = \
$(GLIB_LIBS)

View File

@@ -36,7 +36,6 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include "nm-logging.h" #include "nm-logging.h"
#include "nm-utils.h"
static guint32 log_level = LOGL_INFO; static guint32 log_level = LOGL_INFO;
static guint32 log_domains = \ static guint32 log_domains = \

View File

@@ -78,6 +78,17 @@ void _nm_log (const char *func, const char *loc,
guint32 domain, guint32 level, guint32 domain, guint32 level,
const char *fmt, ...); const char *fmt, ...);
/* Undefine the nm-utils.h logging stuff to ensure errors */
#undef nm_print_backtrace
#undef nm_get_timestamp
#undef nm_info
#undef nm_info_str
#undef nm_debug
#undef nm_debug_str
#undef nm_warning
#undef nm_warning_str
#undef nm_error
#undef nm_error_str
gboolean nm_logging_setup (const char *level, const char *domains, GError **error); gboolean nm_logging_setup (const char *level, const char *domains, GError **error);
void nm_logging_start (gboolean become_daemon); void nm_logging_start (gboolean become_daemon);

View File

@@ -1,5 +1,6 @@
INCLUDES = \ INCLUDES = \
-I${top_srcdir}/src \ -I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-util \
-I${top_builddir}/marshallers -I${top_builddir}/marshallers
@@ -22,6 +23,7 @@ libmodem_manager_la_CPPFLAGS = \
libmodem_manager_la_LIBADD = \ libmodem_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) $(DBUS_LIBS)
nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml

View File

@@ -1,4 +1,8 @@
INCLUDES = -I${top_srcdir}/libnm-util -I${top_srcdir}/src -I${top_srcdir}/include INCLUDES = \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/libnm-util \
-I${top_srcdir}/src \
-I${top_srcdir}/include
noinst_LTLIBRARIES = libnamed-manager.la noinst_LTLIBRARIES = libnamed-manager.la
@@ -10,4 +14,8 @@ libnamed_manager_la_CPPFLAGS = \
-DNM_PKGDATADIR=\"$(pkgdatadir)\" \ -DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-DNM_LOCALSTATEDIR=\"$(localstatedir)\" -DNM_LOCALSTATEDIR=\"$(localstatedir)\"
libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) libnamed_manager_la_LIBADD = \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \
$(GLIB_LIBS)

View File

@@ -3,6 +3,7 @@ INCLUDES = \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-util \
-I${top_srcdir}/src \ -I${top_srcdir}/src \
-I${top_srcdir}/src/logging \
-I${top_builddir}/marshallers -I${top_builddir}/marshallers
noinst_LTLIBRARIES = libppp-manager.la noinst_LTLIBRARIES = libppp-manager.la
@@ -28,6 +29,7 @@ libppp_manager_la_CPPFLAGS = \
libppp_manager_la_LIBADD = \ libppp_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(DBUS_LIBS) \ $(DBUS_LIBS) \
$(GLIB_LIBS) $(GLIB_LIBS)

View File

@@ -2,6 +2,7 @@ INCLUDES = \
-I${top_srcdir} \ -I${top_srcdir} \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_srcdir}/libnm-util \ -I${top_srcdir}/libnm-util \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src \ -I${top_srcdir}/src \
-I${top_builddir}/marshallers \ -I${top_builddir}/marshallers \
-I${top_srcdir}/src/named-manager \ -I${top_srcdir}/src/named-manager \
@@ -25,6 +26,7 @@ libvpn_manager_la_CPPFLAGS = \
libvpn_manager_la_LIBADD = \ libvpn_manager_la_LIBADD = \
$(top_builddir)/marshallers/libmarshallers.la \ $(top_builddir)/marshallers/libmarshallers.la \
$(top_builddir)/src/logging/libnm-logging.la \
$(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS) \ $(DBUS_LIBS) \
$(GLIB_LIBS) $(GLIB_LIBS)