From 516815a2660c84656bdedb740a396343c0ffeba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 7 Feb 2014 05:29:59 +0100 Subject: [PATCH] qrexec-lib: make it shared library --- qrexec-lib/Makefile | 21 ++++++++++++++------- rpm_spec/qubes-utils.spec | 6 ++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/qrexec-lib/Makefile b/qrexec-lib/Makefile index 3fc7bb5..ea840ea 100644 --- a/qrexec-lib/Makefile +++ b/qrexec-lib/Makefile @@ -1,20 +1,27 @@ CC=gcc -CFLAGS+=-I. -g -Wall -pie -fPIC -Wall +CFLAGS+=-I. -g -Wall -pie -fPIC -Wextra +XENLIBS=-lxenctrl -lxenstore -lvchan COMMONIOALL=ioall.o +SO_VER=1 +LDFLAGS=-shared -all: libqrexec-utils.a libqubes-rpc-filecopy.a -libqrexec-utils.a: unix-server.o ioall.o buffer.o write-stdin.o exec.o txrx-vchan.o -libqubes-rpc-filecopy.a: ioall.o copy-file.o crc32.o unpack.o +all: libqrexec-utils.so.$(SO_VER) libqubes-rpc-filecopy.so.$(SO_VER) +libqrexec-utils.so.$(SO_VER): unix-server.o ioall.o buffer.o write-stdin.o exec.o txrx-vchan.o + $(CC) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^ $(XENLIBS) +libqubes-rpc-filecopy.so.$(SO_VER): ioall.o copy-file.o crc32.o unpack.o + $(CC) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^ %.a: $(AR) rcs $@ $^ clean: - rm -f *.o *~ *.a + rm -f *.o *~ *.a *.so.* install: mkdir -p $(DESTDIR)$(LIBDIR) - cp libqrexec-utils.a $(DESTDIR)$(LIBDIR) - cp libqubes-rpc-filecopy.a $(DESTDIR)$(LIBDIR) + cp libqrexec-utils.so.$(SO_VER) $(DESTDIR)$(LIBDIR) + ln -s libqrexec-utils.so.$(SO_VER) $(DESTDIR)$(LIBDIR)/libqrexec-utils.so + cp libqubes-rpc-filecopy.so.$(SO_VER) $(DESTDIR)$(LIBDIR) + ln -s libqubes-rpc-filecopy.so.$(SO_VER) $(DESTDIR)$(LIBDIR)/libqubes-rpc-filecopy.so mkdir -p $(DESTDIR)$(INCLUDEDIR) cp libqrexec-utils.h $(DESTDIR)$(INCLUDEDIR) cp libqubes-rpc-filecopy.h $(DESTDIR)$(INCLUDEDIR) diff --git a/rpm_spec/qubes-utils.spec b/rpm_spec/qubes-utils.spec index 3d56c98..52bf33d 100644 --- a/rpm_spec/qubes-utils.spec +++ b/rpm_spec/qubes-utils.spec @@ -66,8 +66,10 @@ rm -rf $RPM_BUILD_ROOT /usr/include/libqrexec-utils.h /usr/include/libqubes-rpc-filecopy.h /usr/include/qrexec.h -%{_libdir}/libqrexec-utils.a -%{_libdir}/libqubes-rpc-filecopy.a +%{_libdir}/libqrexec-utils.so +%{_libdir}/libqubes-rpc-filecopy.so +%{_libdir}/libqrexec-utils.so.1 +%{_libdir}/libqubes-rpc-filecopy.so.1 %changelog