From: Ian Jackson Subject: [PATCH 09/11] build system: Introduce nosharedlibs variable. Date: Mon, 30 Jun 2014 16:52:07 +0100 Message-ID: <1404143529-5039-10-git-send-email-ian.jackson@eu.citrix.com> References: <1404143529-5039-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404143529-5039-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org Introduce a new build variable "nosharedlibs". In tools/libxc use it instead of $(stubdom). In tools/xenstore honour it, and build static clients. If shared libs are disabled, do not try to install or symlink them. Set nosharedlibs when building for MiniOS or NetBSDRump. Signed-off-by: Ian Jackson --- config/MiniOS.mk | 1 + config/NetBSDRump.mk | 1 + tools/Rules.mk | 7 +++++++ tools/libxc/Makefile | 6 +++--- tools/xenstore/Makefile | 5 ++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/MiniOS.mk b/config/MiniOS.mk index fc02b70..32260ad 100644 --- a/config/MiniOS.mk +++ b/config/MiniOS.mk @@ -7,3 +7,4 @@ LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS) # Override settings for this OS PTHREAD_LIBS = +nosharedlibs=y diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk index e32c1cd..8daade8 100644 --- a/config/NetBSDRump.mk +++ b/config/NetBSDRump.mk @@ -8,3 +8,4 @@ XEN_LOCK_DIR = /var/lib WGET = ftp XENSTORE_XENSTORED=n +nosharedlibs=y diff --git a/tools/Rules.mk b/tools/Rules.mk index 327d2b4..9229f9f 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -21,9 +21,16 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE) XENSTORE_XENSTORED ?= y +ifneq ($(nosharedlibs),y) INSTALL_SHLIB = $(INSTALL_PROG) SYMLINK_SHLIB = ln -sf libextension = .so +else +INSTALL_SHLIB = : install-shlib +SYMLINK_SHLIB = : symlink-shlib +libextension = .a +XENSTORE_STATIC_CLIENTS=y +endif CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 8b9cac6..36f646f 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -109,16 +109,16 @@ $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \ $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include $(XEN_ROOT)/tools/config.h LIB := libxenctrl.a -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR) endif LIB += libxenguest.a -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR) endif -ifneq ($(stubdom),y) +ifneq ($(nosharedlibs),y) LIB += xenctrl_osdep_ENOSYS.so endif diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 7303a5f..9945027 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -28,7 +28,10 @@ LIBXENSTORE := libxenstore.a xenstore xenstore-control: CFLAGS += -static endif -ALL_TARGETS = libxenstore.so libxenstore.a clients +ALL_TARGETS = libxenstore.a clients +ifneq ($(nosharedlibs),y) +ALL_TARGETS += libxenstore.so +endif ifeq ($(XENSTORE_XENSTORED),y) ALL_TARGETS += xs_tdb_dump xenstored endif -- 1.7.10.4