[network-manager-libreswan] 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-libreswan] build: build shared files individually without creating a library
- Date: Thu, 16 Jun 2016 11:31:22 +0000 (UTC)
commit 55367e52e50a8f50cd9a33e650465d16948dd436
Author: Thomas Haller <thaller redhat com>
Date: Thu Jun 16 13:23:07 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 | 9 ++---
shared/Makefile.am | 72 ++++++-----------------------------------------
src/Makefile.am | 12 ++++++-
4 files changed, 25 insertions(+), 70 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d358634..a794c38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(NetworkManager-libreswan,
1.3.0,
https://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager,
NetworkManager-libreswan)
-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 101bd83..e83ad3c 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -36,12 +36,12 @@ libnm_vpn_plugin_libreswan_la_CFLAGS = \
$(LIBNM_CFLAGS)
libnm_vpn_plugin_libreswan_la_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_libreswan_la_LIBADD = \
- $(LIBNM_LIBS) \
- $(top_builddir)/shared/libnm-vpn-plugin-libreswan-shared.la \
- $(top_builddir)/shared/libnm-vpn-editor-utils-shared.la
+ $(LIBNM_LIBS)
libnm_vpn_plugin_libreswan_la_LDFLAGS = \
-avoid-version \
@@ -85,8 +85,7 @@ libnm_libreswan_properties_la_SOURCES = \
libnm_libreswan_properties_la_LIBADD = \
$(GTK_LIBS) \
$(LIBNM_GLIB_LIBS) \
- $(LIBNM_GTK_LIBS) \
- $(top_builddir)/shared/libnm-libreswan-shared.la
+ $(LIBNM_GTK_LIBS)
libnm_libreswan_properties_la_LDFLAGS = \
-avoid-version \
diff --git a/shared/Makefile.am b/shared/Makefile.am
index b1e828e..c4de8a1 100644
--- a/shared/Makefile.am
+++ b/shared/Makefile.am
@@ -1,67 +1,15 @@
-noinst_LTLIBRARIES = \
- libnm-vpn-plugin-libreswan-shared.la \
- libnm-vpn-editor-utils-shared.la
-if WITH_LIBNM_GLIB
-noinst_LTLIBRARIES += libnm-libreswan-shared.la
-endif
-
-shared_sources = \
- nm-utils/nm-shared-utils.c \
- nm-utils/nm-shared-utils.h \
- utils.c \
- utils.h \
- nm-service-defines.h
-
-shared_CPPFLAGS = \
- -DLIBEXECDIR=\""$(libexecdir)"\" \
- -I"$(top_srcdir)/shared/"
-
-###############################################################################
-
-libnm_vpn_plugin_libreswan_shared_la_CPPFLAGS = \
- $(LIBNM_CFLAGS) \
- $(shared_CPPFLAGS)
-
-libnm_vpn_plugin_libreswan_shared_la_SOURCES= \
- $(shared_sources)
-
-libnm_vpn_plugin_libreswan_shared_la_LIBADD = \
- $(LIBNM_LIBS)
-
-###############################################################################
-
-libnm_libreswan_shared_la_SOURCES = \
- $(shared_sources)
-
-libnm_libreswan_shared_la_CPPFLAGS = \
- -DNM_VPN_OLD \
- $(LIBNM_GLIB_CFLAGS) \
- $(shared_CPPFLAGS)
-
-libnm_libreswan_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-default.h
-
+ nm-utils/nm-shared-utils.c \
+ nm-utils/nm-shared-utils.h \
+ nm-utils/nm-vpn-plugin-utils.c \
+ nm-utils/nm-vpn-plugin-utils.h \
+ nm-utils/nm-vpn-plugin-macros.h \
+ nm-default.h \
+ nm-service-defines.h \
+ utils.c \
+ utils.h \
+ $(NULL)
diff --git a/src/Makefile.am b/src/Makefile.am
index a2cd632..04fe25c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,6 +15,14 @@ AM_CPPFLAGS = \
-DNM_LIBRESWAN_LOCALEDIR=\"$(datadir)/locale\" \
-I"$(top_srcdir)/shared/"
+shared_sources = \
+ $(top_srcdir)/shared/nm-utils/nm-shared-utils.c \
+ $(top_srcdir)/shared/nm-utils/nm-shared-utils.h \
+ $(top_srcdir)/shared/utils.c \
+ $(top_srcdir)/shared/utils.h \
+ $(top_srcdir)/shared/nm-service-defines.h \
+ $(NULL)
+
###############################################################################
# D-Bus stuff
@@ -39,24 +47,24 @@ nm-libreswan-helper-service-dbus.c:
###############################################################################
nm_libreswan_service_SOURCES = \
+ $(shared_sources) \
nm-libreswan-service.c
nm_libreswan_service_LDADD = \
$(GLIB_LIBS) \
$(LIBNM_LIBS) \
$(LIBNL_LIBS) \
- $(top_builddir)/shared/libnm-vpn-plugin-libreswan-shared.la \
libnm-libreswan-helper-service-dbus.la \
-lutil
###############################################################################
nm_libreswan_service_helper_SOURCES = \
+ $(shared_sources) \
nm-libreswan-service-helper.c
nm_libreswan_service_helper_LDADD = \
$(LIBNM_LIBS) \
- $(top_builddir)/shared/libnm-vpn-plugin-libreswan-shared.la \
libnm-libreswan-helper-service-dbus.la
###############################################################################
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]