From bd380a3c71aaf7ef1857a97b3f1db827e9f2d4b6 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 6 Dec 2018 09:43:36 -0200 Subject: [PATCH 1/3] unixodbc: Fix LIB_PREFIX in host build When copying config.h from PKG_BUILD_DIR to HOST_BUILD_DIR, LIB_PREFIX is set to /usr/lib. Then when odbc_config is run, it reports /usr/lib as the --lib-dir, and in --libs as well, and dependent packages may fail. Set it to $(STAGING_DIR)/usr/lib to make it right. Signed-off-by: Eneas U de Queiroz --- libs/unixodbc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/unixodbc/Makefile b/libs/unixodbc/Makefile index 6a1ca0dff..c9fcfbade 100644 --- a/libs/unixodbc/Makefile +++ b/libs/unixodbc/Makefile @@ -127,6 +127,7 @@ endef define Host/Configure $(call Host/Configure/Default) cp $(PKG_BUILD_DIR)/config.h $(HOST_BUILD_DIR) + sed -i -e 's!\(LIB_PREFIX \).*$$$$!\1"$(STAGING_DIR)/usr/lib"!' $(HOST_BUILD_DIR)/config.h cp $(PKG_BUILD_DIR)/unixodbc_conf.h $(HOST_BUILD_DIR) endef From 01a2f4353e289e6438ce24b870e15dfe02c65017 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 6 Dec 2018 12:03:02 -0200 Subject: [PATCH 2/3] unixodbc: fix clean-build compilation For host compilation, the configure-generated config.h from the target compilation is used in place of the host-generated file. When the target package is compiled with clean-build, that file is gone. This saves the file under $(STAGING_DIR), and fetch it from there. Signed-off-by: Eneas U de Queiroz --- libs/unixodbc/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/unixodbc/Makefile b/libs/unixodbc/Makefile index c9fcfbade..21154627a 100644 --- a/libs/unixodbc/Makefile +++ b/libs/unixodbc/Makefile @@ -92,6 +92,8 @@ endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/$(STAGING_DIR)/usr/include/*.h $(1)/usr/include/ + # Save autoconf config.h file for host build + $(CP) $(PKG_BUILD_DIR)/config.h $(1)/usr/include/unixodbc_ac_config.h $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/etc @@ -126,7 +128,8 @@ endef define Host/Configure $(call Host/Configure/Default) - cp $(PKG_BUILD_DIR)/config.h $(HOST_BUILD_DIR) + # copy target autoconf config.h file for host build + cp $(STAGING_DIR)/usr/include/unixodbc_ac_config.h $(HOST_BUILD_DIR) sed -i -e 's!\(LIB_PREFIX \).*$$$$!\1"$(STAGING_DIR)/usr/lib"!' $(HOST_BUILD_DIR)/config.h cp $(PKG_BUILD_DIR)/unixodbc_conf.h $(HOST_BUILD_DIR) endef From 7220dab75513e479236ba034f4a7ae73a6b2cc0d Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 11 Dec 2018 21:12:24 -0200 Subject: [PATCH 3/3] unixodbc: save unixodbc_conf.h for host build Save a copy of unixodbc_conf.h in STAGING_DIR to be used by host build. Use STAGING_DIR/tmp/unixodbc instead of include. Signed-off-by: Eneas U de Queiroz --- libs/unixodbc/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/unixodbc/Makefile b/libs/unixodbc/Makefile index 21154627a..cfd6d2f5f 100644 --- a/libs/unixodbc/Makefile +++ b/libs/unixodbc/Makefile @@ -93,7 +93,10 @@ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/$(STAGING_DIR)/usr/include/*.h $(1)/usr/include/ # Save autoconf config.h file for host build - $(CP) $(PKG_BUILD_DIR)/config.h $(1)/usr/include/unixodbc_ac_config.h + # copy target autoconf config.h and unixodbc_conf.h file for host build + $(INSTALL_DIR) $(1)/tmp/unixodbc + $(CP) $(PKG_BUILD_DIR)/config.h $(1)/tmp/unixodbc/ + $(CP) $(PKG_BUILD_DIR)/unixodbc_conf.h $(1)/tmp/unixodbc/ $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/etc @@ -128,10 +131,9 @@ endef define Host/Configure $(call Host/Configure/Default) - # copy target autoconf config.h file for host build - cp $(STAGING_DIR)/usr/include/unixodbc_ac_config.h $(HOST_BUILD_DIR) + cp $(STAGING_DIR)/tmp/unixodbc/config.h $(HOST_BUILD_DIR) sed -i -e 's!\(LIB_PREFIX \).*$$$$!\1"$(STAGING_DIR)/usr/lib"!' $(HOST_BUILD_DIR)/config.h - cp $(PKG_BUILD_DIR)/unixodbc_conf.h $(HOST_BUILD_DIR) + cp $(STAGING_DIR)/tmp/unixodbc/unixodbc_conf.h $(HOST_BUILD_DIR) endef define Host/Compile