settings/build: build and use libnms-*-core.la library

Don't have the test recompile parts of the settings plugin.
Instead, build one core library that is used both by the test
and the settings plugin.

Advantage: might save some compilation time, but more importantly: the
test use the same object code then NetworkManager itself, avoiding
different behavior due to compilation flags.
This commit is contained in:
Thomas Haller 2016-10-07 12:13:44 +02:00
parent eab8b06d8b
commit dd4ce10c92
6 changed files with 95 additions and 63 deletions

View file

@ -2,9 +2,35 @@ SUBDIRS = . tests
@GNOME_CODE_COVERAGE_RULES@
# See note about gdbus-codegen in introspection/Makefile.am
pkglib_LTLIBRARIES = \
libnm-settings-plugin-ifcfg-rh.la
noinst_LTLIBRARIES = libnmdbus-ifcfg-rh.la
noinst_LTLIBRARIES = \
libnmdbus-ifcfg-rh.la \
libnms-ifcfg-rh-core.la
BUILT_SOURCES = \
nmdbus-ifcfg-rh.h \
nmdbus-ifcfg-rh.c
###############################################################################
AM_CPPFLAGS = \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/shared \
-I$(top_builddir)/shared \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
$(GLIB_CFLAGS) \
$(NSS_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DSBINDIR=\"$(sbindir)\"
###############################################################################
nodist_libnmdbus_ifcfg_rh_la_SOURCES = \
nmdbus-ifcfg-rh.c \
@ -22,46 +48,35 @@ nmdbus-ifcfg-rh.h: nm-ifcfg-rh.xml
nmdbus-ifcfg-rh.c: nmdbus-ifcfg-rh.h
@true
BUILT_SOURCES = nmdbus-ifcfg-rh.h nmdbus-ifcfg-rh.c
###############################################################################
pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-rh.la
noinst_LTLIBRARIES += libifcfg-rh-io.la
libifcfg_rh_io_la_SOURCES = \
libnms_ifcfg_rh_core_la_SOURCES = \
nms-ifcfg-rh-common.h \
shvar.c \
shvar.h \
nms-ifcfg-rh-utils.c \
nms-ifcfg-rh-utils.h \
nms-ifcfg-rh-reader.c \
nms-ifcfg-rh-reader.h \
nms-ifcfg-rh-writer.c \
nms-ifcfg-rh-writer.h \
nms-ifcfg-rh-common.h \
nms-ifcfg-rh-utils.c \
nms-ifcfg-rh-utils.h
nms-ifcfg-rh-writer.h
AM_CPPFLAGS = \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/shared \
-I$(top_builddir)/shared \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
$(GLIB_CFLAGS) \
$(NSS_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DSBINDIR=\"$(sbindir)\"
###############################################################################
libnm_settings_plugin_ifcfg_rh_la_SOURCES = \
nms-ifcfg-rh-plugin.c \
nms-ifcfg-rh-plugin.h \
libnm_settings_plugin_ifcfg_rh_la_SOURCES =
nms-ifcfg-rh-connection.c \
nms-ifcfg-rh-connection.h
nms-ifcfg-rh-connection.h \
nms-ifcfg-rh-plugin.c \
nms-ifcfg-rh-plugin.h
libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifcfg_rh_la_LIBADD = libifcfg-rh-io.la libnmdbus-ifcfg-rh.la
libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = \
-module -avoid-version
libnm_settings_plugin_ifcfg_rh_la_LIBADD = \
libnms-ifcfg-rh-core.la \
libnmdbus-ifcfg-rh.la
###############################################################################
dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = nm-ifcfg-rh.conf

View file

@ -31,13 +31,10 @@ AM_LDFLAGS = \
noinst_PROGRAMS = test-ifcfg-rh
test_ifcfg_rh_SOURCES = \
test-ifcfg-rh.c \
../nms-ifcfg-rh-reader.c \
../shvar.c \
../nms-ifcfg-rh-utils.c \
../nms-ifcfg-rh-writer.c
test-ifcfg-rh.c
test_ifcfg_rh_LDADD = \
$(top_builddir)/src/settings/plugins/ifcfg-rh/libnms-ifcfg-rh-core.la \
$(top_builddir)/src/libNetworkManager.la
@VALGRIND_RULES@

View file

@ -16,21 +16,15 @@ AM_CPPFLAGS = \
-DSYSCONFDIR=\"$(sysconfdir)\"
-DSBINDIR=\"$(sbindir)\"
pkglib_LTLIBRARIES = libnm-settings-plugin-ifnet.la
pkglib_LTLIBRARIES = \
libnm-settings-plugin-ifnet.la
noinst_LTLIBRARIES = lib-ifnet-io.la
noinst_LTLIBRARIES = \
libnms-ifnet-core.la
libnm_settings_plugin_ifnet_la_SOURCES = \
nm-ifnet-connection.c \
nm-ifnet-connection.h \
plugin.c \
plugin.h
###############################################################################
libnm_settings_plugin_ifnet_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifnet_la_LIBADD = lib-ifnet-io.la
lib_ifnet_io_la_SOURCES = \
libnms_ifnet_core_la_SOURCES = \
net_parser.c\
net_parser.h\
connection_parser.c \
@ -39,3 +33,17 @@ lib_ifnet_io_la_SOURCES = \
net_utils.c\
wpa_parser.h\
wpa_parser.c
###############################################################################
libnm_settings_plugin_ifnet_la_SOURCES = \
nm-ifnet-connection.c \
nm-ifnet-connection.h \
plugin.c \
plugin.h
libnm_settings_plugin_ifnet_la_LDFLAGS = \
-module -avoid-version
libnm_settings_plugin_ifnet_la_LIBADD = \
libnms-ifnet-core.la

View file

@ -24,17 +24,17 @@ AM_CPPFLAGS= \
-DSYSCONFDIR=\"nonexistent\"
noinst_PROGRAMS = test-ifnet
test_ifnet_SOURCES = \
test-ifnet.c \
../connection_parser.c \
../net_parser.c \
../net_utils.c \
../wpa_parser.c
test-ifnet.c
test_ifnet_LDFLAGS = \
$(GLIB_LDFLAGS)
$(CODE_COVERAGE_LDFLAGS)
test_ifnet_LDADD = $(top_builddir)/src/libNetworkManager.la
test_ifnet_LDADD = \
$(top_builddir)/src/settings/plugins/ifnet/libnms-ifnet-core.la \
$(top_builddir)/src/libNetworkManager.la
@VALGRIND_RULES@
TESTS = test-ifnet

View file

@ -15,15 +15,21 @@ AM_CPPFLAGS = \
$(GUDEV_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"
noinst_LTLIBRARIES = libifupdown-io.la
pkglib_LTLIBRARIES = \
libnm-settings-plugin-ifupdown.la
libifupdown_io_la_SOURCES = \
noinst_LTLIBRARIES = \
libnms-ifupdown-core.la
###############################################################################
libnms_ifupdown_core_la_SOURCES = \
interface_parser.c \
interface_parser.h \
parser.c \
parser.h
pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la
###############################################################################
libnm_settings_plugin_ifupdown_la_SOURCES = \
nm-ifupdown-connection.c \
@ -31,6 +37,9 @@ libnm_settings_plugin_ifupdown_la_SOURCES = \
plugin.c \
plugin.h
libnm_settings_plugin_ifupdown_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ifupdown_la_LIBADD = libifupdown-io.la
libnm_settings_plugin_ifupdown_la_LDFLAGS = \
-module -avoid-version
libnm_settings_plugin_ifupdown_la_LIBADD = \
libnms-ifupdown-core.la

View file

@ -18,11 +18,14 @@ AM_CPPFLAGS = \
noinst_PROGRAMS = test-ifupdown
test_ifupdown_SOURCES = \
test-ifupdown.c \
../interface_parser.c \
../parser.c
test-ifupdown.c
test_ifupdown_LDFLAGS = \
$(GLIB_LDFLAGS)
$(CODE_COVERAGE_LDFLAGS)
test_ifupdown_LDADD = \
$(top_builddir)/src/settings/plugins/ifupdown/libnms-ifupdown-core.la \
$(top_builddir)/src/libNetworkManager.la
@VALGRIND_RULES@