diff options
author | Thomas Haller <thaller@redhat.com> | 2016-10-07 12:13:44 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-10-11 11:37:46 +0200 |
commit | dd4ce10c927b87d8e174b2953818aea40db7694b (patch) | |
tree | 37a1b74f139c787865c58c68ce3ff44a548ec137 | |
parent | eab8b06d8b958bcabb2397cbc68e4525c2d8f7db (diff) | |
download | NetworkManager-dd4ce10c927b87d8e174b2953818aea40db7694b.tar.gz |
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.
-rw-r--r-- | src/settings/plugins/ifcfg-rh/Makefile.am | 79 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/tests/Makefile.am | 7 | ||||
-rw-r--r-- | src/settings/plugins/ifnet/Makefile.am | 32 | ||||
-rw-r--r-- | src/settings/plugins/ifnet/tests/Makefile.am | 12 | ||||
-rw-r--r-- | src/settings/plugins/ifupdown/Makefile.am | 19 | ||||
-rw-r--r-- | src/settings/plugins/ifupdown/tests/Makefile.am | 9 |
6 files changed, 95 insertions, 63 deletions
diff --git a/src/settings/plugins/ifcfg-rh/Makefile.am b/src/settings/plugins/ifcfg-rh/Makefile.am index ec8114ac13..44acd7f041 100644 --- a/src/settings/plugins/ifcfg-rh/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/Makefile.am @@ -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 = \ + libnms-ifcfg-rh-core.la \ + libnmdbus-ifcfg-rh.la -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 +############################################################################### dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = nm-ifcfg-rh.conf diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am index 8b94006cd4..8315e494bf 100644 --- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am @@ -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@ diff --git a/src/settings/plugins/ifnet/Makefile.am b/src/settings/plugins/ifnet/Makefile.am index 0d90aad34e..327438d47e 100644 --- a/src/settings/plugins/ifnet/Makefile.am +++ b/src/settings/plugins/ifnet/Makefile.am @@ -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 diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am index bdecfa10e5..7ff38fa09c 100644 --- a/src/settings/plugins/ifnet/tests/Makefile.am +++ b/src/settings/plugins/ifnet/tests/Makefile.am @@ -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 diff --git a/src/settings/plugins/ifupdown/Makefile.am b/src/settings/plugins/ifupdown/Makefile.am index dbea6be612..f0d4973064 100644 --- a/src/settings/plugins/ifupdown/Makefile.am +++ b/src/settings/plugins/ifupdown/Makefile.am @@ -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 diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am index 6a4dcdf800..80abf8a9e7 100644 --- a/src/settings/plugins/ifupdown/tests/Makefile.am +++ b/src/settings/plugins/ifupdown/tests/Makefile.am @@ -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@ |