diff options
author | Adrian Reber <adrian@lisas.de> | 2014-02-05 18:28:00 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-02-07 15:35:20 +0400 |
commit | b0e6ebc1c7a529dfc3073c26f2a18733a1088458 (patch) | |
tree | 5854eac50e587b972cd0577665327603d5862db0 | |
parent | e18ae2a8f5447d5f33de2af8a1c604bf0be986c3 (diff) |
Makefile: add soname to libcriu.so
Using a soname makes it easy for applications to
detect if the ABI of libcriu.so has changed.
It still creates libcriu.so as before in lib. During
'make install' additional links are created:
libcriu.so -> libcriu.so.1.0
libcriu.so.1 -> libcriu.so.1.0
Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | lib/Makefile | 4 |
2 files changed, 14 insertions, 5 deletions
@@ -3,8 +3,11 @@ VERSION_MINOR := 1 VERSION_SUBLEVEL := VERSION_EXTRA := VERSION_NAME := +VERSION_SO_MAJOR := 1 +VERSION_SO_MINOR := 0 export VERSION_MAJOR VERSION_MINOR VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME +export VERSION_SO_MAJOR VERSION_SO_MINOR # # FIXME zdtm building procedure requires implicit rules @@ -103,10 +106,11 @@ endif CFLAGS += $(WARNINGS) $(DEFINES) SYSCALL-LIB := arch/$(ARCH)/syscalls.built-in.o ARCH-LIB := arch/$(ARCH)/crtools.built-in.o -CRIU-LIB := lib/libcriu.so +CRIU-SO := libcriu +CRIU-LIB := lib/$(CRIU-SO).so CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto -export CC MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS +export CC MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS CRIU-SO export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD export cflags-y @@ -235,7 +239,12 @@ install: $(PROGRAM) install-man $(Q) mkdir -p $(DESTDIR)$(SBINDIR) $(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR) $(Q) mkdir -p $(DESTDIR)$(LIBDIR) - $(Q) install -m 755 $(CRIU-LIB) $(DESTDIR)$(LIBDIR) + $(Q) install -m 755 $(CRIU-LIB) \ + $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) + $(Q) ln -s $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \ + $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR) + $(Q) ln -s $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \ + $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so $(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR) $(Q) install -m 644 $(CRIU-INC) $(DESTDIR)$(INCLUDEDIR) $(Q) mkdir -p $(DESTDIR)$(SYSTEMDUNITDIR) diff --git a/lib/Makefile b/lib/Makefile index e9beaceee..aec6d841a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,10 +1,10 @@ -lib-so += libcriu +lib-so += $(CRIU-SO) obj-y += criu.o obj-ext-src-y += protobuf/rpc.pb-c.o includes += -iquote $(obj)/../arch/$(ARCH)/include -iquote $(obj)/../include -iquote $(obj)/.. -iquote $(obj)/../protobuf cflags-y += $(includes) -fPIC -Wa,--noexecstack -fno-stack-protector -cflags-so += -rdynamic +cflags-so += -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR) ldflags-so += -lprotobuf-c .SECONDARY: |