toolchain: packetize libatomic

Based on a patch by Tobias Steinicke <tobias.steinicke@inet.tu-berlin.de>.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 42514
lede-17.01
Steven Barth 2014-09-12 12:25:55 +00:00
parent 80ff3af16f
commit 0a5caa47e5
1 changed files with 39 additions and 1 deletions

View File

@ -52,6 +52,31 @@ define Package/libgcc/config
endmenu endmenu
endef endef
define Package/libatomic
$(call Package/gcc/Default)
DEPENDS:=+libgcc
TITLE:=Atomic support library
endef
define Package/libatomic/config
menu "Configuration"
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
config LIBATOMIC_ROOT_DIR
string
prompt "libatomic shared library base directory"
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
default "/" if NATIVE_TOOLCHAIN
config LIBATOMIC_FILE_SPEC
string
prompt "libatomic shared library files (use wildcards)"
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
default "./lib/libatomic.so.*"
endmenu
endef
define Package/libssp define Package/libssp
$(call Package/gcc/Default) $(call Package/gcc/Default)
@ -314,6 +339,13 @@ ifneq ($(BUILD_LIBGCC),)
"$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so))" \ "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so))" \
$(BUILD_LIBGCC) \ $(BUILD_LIBGCC) \
-Wl,-soname=libcrypt.so.0 -Wl,-soname=libcrypt.so.0
$(SCRIPT_DIR)/relink-lib.sh \
"$(TARGET_CROSS)" \
"$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic.so)" \
"$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic.a)" \
"$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic*.so))" \
$(BUILD_LIBGCC) \
-Wl,-soname=libatomic.so.0
$(SCRIPT_DIR)/relink-lib.sh \ $(SCRIPT_DIR)/relink-lib.sh \
"$(TARGET_CROSS)" \ "$(TARGET_CROSS)" \
"$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so)" \ "$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so)" \
@ -367,6 +399,11 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/) $(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/)
endef endef
define Package/libatomic/install
$(INSTALL_DIR) $(1)/lib
$(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/)
endef
define Package/libgfortran/install define Package/libgfortran/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/) $(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/)
@ -414,7 +451,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(TOOLCHAIN_DIR)/lib/libc.so.* \ $(TOOLCHAIN_DIR)/lib/libc.so.* \
$(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \
$(1)/lib/ $(1)/lib/
for file in libcrypt libdl libm libutil; do \ for file in libatomic libcrypt libdl libm libutil; do \
$(CP) \ $(CP) \
$(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \
$(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \
@ -588,6 +625,7 @@ endif
$(eval $(call BuildPackage,libc)) $(eval $(call BuildPackage,libc))
$(eval $(call BuildPackage,libgcc)) $(eval $(call BuildPackage,libgcc))
$(eval $(call BuildPackage,libatomic))
$(eval $(call BuildPackage,libssp)) $(eval $(call BuildPackage,libssp))
$(eval $(call BuildPackage,libstdcpp)) $(eval $(call BuildPackage,libstdcpp))
$(eval $(call BuildPackage,libpthread)) $(eval $(call BuildPackage,libpthread))