build system: Introduce nosharedlibs variable.
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 28 May 2014 16:06:02 +0000 (17:06 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 14 Jul 2014 15:07:50 +0000 (16:07 +0100)
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 <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
v2: Clarify deliberate INSTALL_SHLIB and SYMLINK_SHLIB breakage.

config/MiniOS.mk
config/NetBSDRump.mk
tools/Rules.mk
tools/libxc/Makefile
tools/xenstore/Makefile

index fc02b70fc400be895da38d8478428675ea4d8e06..32260ada91f82c88467c6efc55048f726039ebee 100644 (file)
@@ -7,3 +7,4 @@ LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS)
 
 # Override settings for this OS
 PTHREAD_LIBS =
+nosharedlibs=y
index e32c1cd7bcb27f5346ff11ab0e6918d9cd3019ba..8daade8eb39513f496e1ec5cb8b2ec0fd704ce8d 100644 (file)
@@ -8,3 +8,4 @@ XEN_LOCK_DIR = /var/lib
 WGET = ftp
 
 XENSTORE_XENSTORED=n
+nosharedlibs=y
index 327d2b4a410f7ed97883100d14a802fe01a7cc6b..9ac8541475a721095e4e477f7550de02a2c6227e 100644 (file)
@@ -21,9 +21,18 @@ CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
 XENSTORE_XENSTORED ?= y
 
+ifneq ($(nosharedlibs),y)
 INSTALL_SHLIB = $(INSTALL_PROG)
 SYMLINK_SHLIB = ln -sf
 libextension = .so
+else
+libextension = .a
+XENSTORE_STATIC_CLIENTS=y
+# If something tries to use these it is a mistake.  Provide references
+# to nonexistent programs to produce a sane error message.
+INSTALL_SHLIB = : install-shlib-unsupported-fail
+SYMLINK_SHLIB = : symlink-shlib-unsupported-fail
+endif
 
 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
index 4020f3787c4fb02c4260867286de85cf85a8d37e..22eef8e3b6e87786a38f48c5df04930eaf0ece0a 100644 (file)
@@ -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
 
index 0cf06f1872683e6600cdbe0135145c8c33e0ee88..48b4e3dc87633b2f50b69d0140c605bb6951016e 100644 (file)
@@ -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