[network-manager-vpnc] build: build shared files individually without creating a library
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-vpnc] build: build shared files individually without creating a library
- Date: Thu, 16 Jun 2016 10:36:51 +0000 (UTC)
commit c15c6a8eb31b2330a2437fd1d06ff854fd8d50ea
Author: Thomas Haller <thaller redhat com>
Date: Thu Jun 16 12:26:51 2016 +0200
build: build shared files individually without creating a library
Previously, we would build static libraries out of the shared
files. But the users (in properties/, src/, auth-dialog/) themself
want to build those files differently.
For example, the core part under src/ wants to include
<glib/gi18n.h>
for translation, while the properties/ shall use <glib/gi18n-lib.h>.
We get this right via "nm-default.h" and NETWORKMANAGER_COMPILATION,
but for that we have to rebuild the files each time.
Instead, let each user of those files explicitly pick the shared
files as source.
To workaround a bug in autotools, we have to disable subdir-objects
(see https://lists.gnu.org/archive/html/automake/2015-08/msg00003.html).
configure.ac | 2 +-
properties/Makefile.am | 12 ++++++++-
shared/Makefile.am | 60 +++--------------------------------------------
src/Makefile.am | 16 ++++++++----
4 files changed, 26 insertions(+), 64 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a18f4ed..0c8b8b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(NetworkManager-vpnc,
1.3.0,
https://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager,
NetworkManager-vpnc)
-AM_INIT_AUTOMAKE([subdir-objects no-dist-gzip dist-xz])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-xz])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
diff --git a/properties/Makefile.am b/properties/Makefile.am
index d2d1ed8..56d5e56 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -9,6 +9,10 @@ plugin_LTLIBRARIES += libnm-vpnc-properties.la
endif
endif
+shared_sources = \
+ $(top_srcdir)/shared/nm-service-defines.h \
+ $(NULL)
+
plugin_sources = \
nm-vpnc-helper.c \
nm-vpnc-helper.h \
@@ -34,6 +38,9 @@ common_CFLAGS = \
###############################################################################
libnm_vpn_plugin_vpnc_la_SOURCES = \
+ $(shared_sources) \
+ $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.c \
+ $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-utils.h \
$(plugin_sources)
libnm_vpn_plugin_vpnc_la_CFLAGS = \
@@ -43,8 +50,7 @@ libnm_vpn_plugin_vpnc_la_CFLAGS = \
$(LIBNM_CFLAGS)
libnm_vpn_plugin_vpnc_la_LIBADD = \
- $(LIBNM_LIBS) \
- $(top_builddir)/shared/libnm-vpn-editor-utils-shared.la
+ $(LIBNM_LIBS)
libnm_vpn_plugin_vpnc_la_LDFLAGS = \
-avoid-version \
@@ -53,6 +59,7 @@ libnm_vpn_plugin_vpnc_la_LDFLAGS = \
###############################################################################
libnm_vpn_plugin_vpnc_editor_la_SOURCES = \
+ $(shared_sources) \
$(editor_sources)
libnm_vpn_plugin_vpnc_editor_la_CFLAGS = \
@@ -74,6 +81,7 @@ libnm_vpn_plugin_vpnc_editor_la_LDFLAGS = \
###############################################################################
libnm_vpnc_properties_la_SOURCES = \
+ $(shared_sources) \
$(plugin_sources) \
$(editor_sources)
diff --git a/shared/Makefile.am b/shared/Makefile.am
index 26b57d6..2eb5e18 100644
--- a/shared/Makefile.am
+++ b/shared/Makefile.am
@@ -1,62 +1,10 @@
-noinst_LTLIBRARIES = \
- libnm-vpn-plugin-vpnc-shared.la \
- libnm-vpn-editor-utils-shared.la
-if WITH_LIBNM_GLIB
-noinst_LTLIBRARIES += libnm-vpnc-shared.la
-endif
-
-shared_sources = \
- nm-utils/nm-shared-utils.c \
- nm-utils/nm-shared-utils.h \
- nm-service-defines.h
-
-###############################################################################
-
-libnm_vpn_plugin_vpnc_shared_la_CPPFLAGS = \
- $(LIBNM_CFLAGS) \
- -I$(top_srcdir)/shared
-
-libnm_vpn_plugin_vpnc_shared_la_SOURCES= \
- $(shared_sources)
-
-libnm_vpn_plugin_vpnc_shared_la_LIBADD = \
- $(LIBNM_LIBS)
-
-###############################################################################
-
-libnm_vpnc_shared_la_SOURCES = \
- $(shared_sources)
-
-libnm_vpnc_shared_la_CPPFLAGS = \
- -DNM_VPN_OLD \
- $(LIBNM_GLIB_CFLAGS) \
- -I$(top_srcdir)/shared
-
-libnm_vpnc_shared_la_LIBADD = \
- $(LIBNM_GLIB_LIBS)
-
-###############################################################################
-
-libnm_vpn_editor_utils_shared_la_CPPFLAGS = \
- $(LIBNM_CFLAGS) \
- -I$(top_srcdir)/shared
-
-libnm_vpn_editor_utils_shared_la_SOURCES = \
- nm-utils/nm-vpn-plugin-utils.c \
- nm-utils/nm-vpn-plugin-utils.h \
- nm-utils/nm-vpn-plugin-macros.h
-
-libnm_vpn_editor_utils_shared_la_LIBADD = \
- $(LIBNM_LIBS) \
- -ldl
-
-###############################################################################
-
EXTRA_DIST = \
README \
nm-utils/gsystem-local-alloc.h \
nm-utils/nm-glib.h \
nm-utils/nm-macros-internal.h \
nm-utils/nm-test-utils.h \
- nm-default.h
-
+ nm-utils/nm-shared-utils.c \
+ nm-utils/nm-shared-utils.h \
+ nm-default.h \
+ nm-service-defines.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 575f0f1..b76c583 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,10 +13,17 @@ AM_CPPFLAGS = \
libexec_PROGRAMS = nm-vpnc-service nm-vpnc-service-vpnc-helper
+shared_sources = \
+ $(top_srcdir)/shared/nm-utils/nm-shared-utils.c \
+ $(top_srcdir)/shared/nm-utils/nm-shared-utils.h \
+ $(top_srcdir)/shared/nm-utils/nm-vpn-plugin-macros.h \
+ $(top_srcdir)/shared/nm-service-defines.h \
+ $(NULL)
+
###############################################################################
nm_vpnc_service_SOURCES = \
- $(top_srcdir)/shared/nm-service-defines.h \
+ $(shared_sources) \
nm-vpnc-service.c \
nm-vpnc-service.h \
utils.c \
@@ -24,18 +31,17 @@ nm_vpnc_service_SOURCES = \
nm_vpnc_service_LDADD = \
$(GLIB_LIBS) \
- $(LIBNM_LIBS) \
- $(top_builddir)/shared/libnm-vpn-plugin-vpnc-shared.la
+ $(LIBNM_LIBS)
###############################################################################
nm_vpnc_service_vpnc_helper_SOURCES = \
+ $(shared_sources) \
nm-vpnc-service-vpnc-helper.c
nm_vpnc_service_vpnc_helper_LDADD = \
$(GTHREAD_LIBS) \
- $(LIBNM_LIBS) \
- $(top_builddir)/shared/libnm-vpn-plugin-vpnc-shared.la
+ $(LIBNM_LIBS)
###############################################################################
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]