From 6c4336eb195de570903627b6738d63910b0fa834 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 15 Dec 2019 10:44:05 +0100 Subject: [PATCH] tinycdb: install shared lib and pic archive dnsdist picks up cdb.h but can't link in the static archive. /home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt-linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libcdb.a(cdb_init.o): relocation R_MIPS_26 against `fstat' can not be used when making a shared object; recompile with -fPIC This commit extends the tinycdb Makefile to build and install as well the shared library as well as the pic archive. dnsdist will then pick the shared library. Signed-off-by: Sebastian Kemper --- libs/tinycdb/Makefile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libs/tinycdb/Makefile b/libs/tinycdb/Makefile index 067844d54..05d56ca04 100644 --- a/libs/tinycdb/Makefile +++ b/libs/tinycdb/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tinycdb -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://www.corpit.ru/mjt/tinycdb/ PKG_VERSION:=0.78 PKG_HASH:=50678f432d8ada8d69f728ec11c3140e151813a7847cf30a62d86f3a720ed63c @@ -17,6 +17,8 @@ PKG_LICENSE:=NLPL PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_INSTALL:=1 + include $(INCLUDE_DIR)/package.mk # Pass CPPFLAGS in the CFLAGS as otherwise the build system will @@ -27,21 +29,35 @@ MAKE_FLAGS+= \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" +CDB_INST_STRING:=prefix=/usr install install-sharedlib install-piclib + define Package/tinycdb SECTION:=libs CATEGORY:=Libraries TITLE:=a Constant DataBase URL:=http://www.corpit.ru/mjt/tinycdb.html + ABI_VERSION=1 endef define Package/tinycdb/description TinyCDB is a very fast and simple package for creating and reading constant data bases endef -define Build/InstallDev - cd $(PKG_BUILD_DIR); $(MAKE) DESTDIR=$(1) prefix=/usr install +define Package/tinycdb/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcdb.so.$(ABI_VERSION) $(1)/usr/lib +endef + +define Build/Compile + $(call Build/Compile/Default,shared staticlib piclib) endef +define Build/Install + $(call Build/Install/Default,$(CDB_INST_STRING)) +endef +define Build/InstallDev + cd $(PKG_BUILD_DIR); $(MAKE) DESTDIR=$(1) $(CDB_INST_STRING) +endef $(eval $(call BuildPackage,tinycdb))