Verified Commit 0b162d3d authored by Max Rees's avatar Max Rees

libapk: initial versioned soname support

parent 5e96df15
......@@ -11,5 +11,5 @@ libfetch/*err.h
*.o
*.d
*.cmd
*.so
*.so*
config.mk
......@@ -6,6 +6,10 @@
PACKAGE := apk-tools
VERSION := 2.10.4
LIBAPK_SONAME := libapk.so.0.0
LIBAPK.SO := $(LIBAPK_SONAME).0
export LIBAPK_SONAME LIBAPK.SO
##
# Default directories
......
......@@ -50,9 +50,15 @@ LIBS_apk := -lapk
LIBS_apk-test := -lapk
LIBS_apk.so := -L$(obj) -lapk
shlibs-y += libapk.so
generate-y += $(LIBAPK_SONAME)
LIBAPK-y := $(obj)/libapk.so
install-LIBAPK-y := $(INSTALLDIR) $(DESTDIR)$(LIBDIR) && \
$(INSTALL) $(LIBAPK-y) $(DESTDIR)$(LIBDIR)
$(INSTALL) $(LIBAPK-y) \
$(DESTDIR)$(LIBDIR)/$(LIBAPK.SO) && \
ln -s $(LIBAPK.SO) \
$(DESTDIR)$(LIBDIR)/$(LIBAPK_SONAME) && \
ln -s $(LIBAPK.SO) \
$(DESTDIR)$(LIBDIR)/libapk.so
endif
CFLAGS_ALL += -D_ATFILE_SOURCE -Ilibfetch
......@@ -71,6 +77,7 @@ LDFLAGS_apk.static := -static
LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
LDFLAGS_apk += -L$(obj)
LDFLAGS_apk-test += -L$(obj)
LDFLAGS_libapk.so += -Wl,-soname,$(LIBAPK_SONAME)
CFLAGS_ALL += $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS)
LIBS := -Wl,--as-needed \
......@@ -81,6 +88,9 @@ $(obj)/apk: $(LIBAPK-y)
$(obj)/apk.so: $(LIBAPK-y)
$(obj)/$(LIBAPK_SONAME):
ln -s libapk.so $@
install: $(obj)/apk $(LIBAPK-y) $(LUA_LIB-y)
$(INSTALLDIR) $(DESTDIR)$(SBINDIR)
$(INSTALL) $(obj)/apk $(DESTDIR)$(SBINDIR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment