toolchain: fix up lib64 symlink to lib before copying the initial prefix dir to avoid...
authorFelix Fietkau <nbd@openwrt.org>
Sat, 30 Jun 2012 21:43:59 +0000 (21:43 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 30 Jun 2012 21:43:59 +0000 (21:43 +0000)
SVN-Revision: 32556

include/toolchain-build.mk
toolchain/binutils/Makefile
toolchain/gcc/initial/Makefile

index a0bc4061fcfcfc6c488e30ac985ccf4c709f9d5d..d2fdb0281a104175bb24649703415b30218ddd65 100644 (file)
@@ -16,3 +16,12 @@ TOOLCHAIN_JOBS?=$(if $(CONFIG_TOOLCHAIN_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))
 include $(INCLUDE_DIR)/host-build.mk
 
 HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared
+
+define FixupLibdir
+       if [ -d $(1)/lib64 -a \! -L $(1)/lib64 ]; then \
+               mkdir -p $(1)/lib; \
+               mv $(1)/lib64/* $(1)/lib/; \
+               rm -rf $(1)/lib64; \
+       fi
+       ln -sf lib $(1)/lib64
+endef
index 9d12721dec4aaaa7aaff0287292c5eec42d03e1c..c7d21b1dcdfc2b6a90157415b2fc4219d8f01e87 100644 (file)
@@ -83,6 +83,7 @@ define Host/Install
        $(MAKE) -C $(HOST_BUILD_DIR) \
                prefix=$(TOOLCHAIN_DIR)/initial \
                install
+       $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
        $(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
        $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
 endef
index 3d8ab61cdf01c54a5971a65bfdca658afaa2559d..6b0536d83a2c9e99e2e473b720e3daa07a30d8d7 100644 (file)
@@ -29,6 +29,8 @@ define Host/Install
                cp libgcc.a libgcc_initial.a; \
        )
 
+       $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
+
        $(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
 endef