WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] add SONAME to libblktapctl.so

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] add SONAME to libblktapctl.so
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Sun, 1 Aug 2010 11:49:35 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 01 Aug 2010 02:50:50 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1280656187; l=2110; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=Wz5YdeRWjqn65nrai5xc9kqrwwA=; b=xufInBvyTJzt5dQd+wMu/eIJqVLeQw1eISvxRQ5Bq1BkLe7xuqEcbIyBWrcd5cKpzFf aavNrNojFr8lY3K1eWvRe8Aa9vxyzFdU8XRh/eE8DoklJZUHq6OrRXlqBCP76o6HNM4Ky zGe34hbqCaFnEvDE+kI2zhzUozl5baQmicI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C8760BCA.1BEA6%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100728152348.GA6308@xxxxxxxxx> <C8760BCA.1BEA6%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
Add an SONAME to libblktapctl.so.
Install static library as data to avoid executable permissions in the .a file.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 tools/blktap2/control/Makefile |   35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

--- xen-unstable.hg-4.1.21890.orig/tools/blktap2/control/Makefile
+++ xen-unstable.hg-4.1.21890/tools/blktap2/control/Makefile
@@ -1,6 +1,11 @@
 XEN_ROOT := ../../../
 include $(XEN_ROOT)/tools/Rules.mk
 
+MAJOR              = 1.0
+MINOR              = 0
+LIBNAME            = libblktapctl
+LIBSONAME          = $(LIBNAME).so.$(MAJOR)
+
 IBIN               = tap-ctl
 
 CFLAGS            += -Werror
@@ -35,29 +40,39 @@ CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_
 OBJS = $(CTL_OBJS) tap-ctl.o
 PICS = $(CTL_PICS)
 
-LIBS = libblktapctl.a libblktapctl.so
+LIB_STATIC = $(LIBNAME).a
+LIB_SHARED = $(LIBSONAME).$(MINOR)
 IBIN = tap-ctl
 
 all: build
 
-build: $(IBIN) $(LIBS)
+build: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+
+$(LIBNAME).so: $(LIBSONAME)
+       ln -sf $< $@
+
+$(LIBSONAME): $(LIB_SHARED)
+       ln -sf $< $@
 
-tap-ctl: tap-ctl.o libblktapctl.so
-       $(CC) $(CFLAGS) -o $@ $^
+tap-ctl: tap-ctl.o $(LIBNAME).so
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
-libblktapctl.a: $(CTL_OBJS)
+$(LIB_STATIC): $(CTL_OBJS)
        $(AR) r $@ $^
 
-libblktapctl.so: $(CTL_PICS)
-       $(CC) $(CFLAGS) -fPIC -shared -rdynamic $^ -o $@
+$(LIB_SHARED): $(CTL_PICS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) 
$(SHLIB_LDFLAGS) -rdynamic $^ -o $@
 
-install: $(IBIN) $(LIBS)
+install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
        $(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
        $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
-       $(INSTALL_PROG) $(LIBS) $(DESTDIR)$(LIBDIR)
+       $(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
+       $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
+       ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
+       ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
 
 clean:
-       rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIBS)
+       rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
        rm -f *~
 
 .PHONY: all build clean install

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>