diff options
Diffstat (limited to 'package/glibc')
-rw-r--r-- | package/glibc/Makefile | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/package/glibc/Makefile b/package/glibc/Makefile index 9655288a6..355595ffa 100644 --- a/package/glibc/Makefile +++ b/package/glibc/Makefile @@ -3,16 +3,17 @@ include $(TOPDIR)/rules.mk -TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS)) -TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS)) +TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS)) +TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS)) include $(TOPDIR)/toolchain/glibc/Makefile.inc +include $(TOPDIR)/toolchain/glibc/Makefile.multilib PKG_DESCR:= GNU C library PKG_VER:= 2.16 PKG_SECTION:= base PKG_OPTS:= noremove -PKG_SUBPKGS:= GLIBC GLIBC_DEV +PKG_SUBPKGS:= GLIBC GLIBC_DEV GLIBC_STATIC NO_DISTFILES:= 1 @@ -20,9 +21,10 @@ include $(TOPDIR)/mk/package.mk $(eval $(call PKG_template,GLIBC,glibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) $(eval $(call PKG_template,GLIBC_DEV,glibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) +$(eval $(call PKG_template,GLIBC_STATIC,$(PKG_NAME)-static,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) -TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS)) -TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS)) +#TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS)) +#TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS)) XAKE_FLAGS+= GCC_HONOUR_COPTS=s CONFIG_STYLE:= manual @@ -31,24 +33,48 @@ INSTALL_STYLE:= manual # compile nothing, glibc is already build in toolchain directory do-install: - ${INSTALL_DIR} ${IDIR_GLIBC}/$(ADK_TARGET_LIBC_PATH) ${IDIR_GLIBC}/etc - ${CP} ${STAGING_TARGET_DIR}/etc/gai.conf ${IDIR_GLIBC}/etc - ${CP} ${STAGING_TARGET_DIR}/etc/nscd.conf ${IDIR_GLIBC}/etc - ${CP} ${STAGING_TARGET_DIR}/etc/nsswitch.conf ${IDIR_GLIBC}/etc -ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y) - $(CP) $(STAGING_TARGET_DIR)/lib/libssp.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH) -endif +ifeq ($(ADK_TARGET_WITH_MULTILIB),y) + for abi in $(TABI); do \ + ${INSTALL_DIR} $(IDIR_GLIBC)/lib$${abi/*:/} $(IDIR_GLIBC)/usr/lib$${abi/*:/} ; \ + $(CP) $(STAGING_TARGET_DIR)/lib/ld* $(IDIR_GLIBC)/lib$${abi/*:/} ; \ + -for file in libc libcrypt libdl libm libresolv libutil libnsl libnss_dns libnss_files; do \ + $(CP) $(STAGING_TARGET_DIR)-$${abi/*:/}/lib/$$file.so* $(IDIR_GLIBC)/lib$${abi/*:/}; \ + $(CP) $(STAGING_TARGET_DIR)-$${abi/*:/}/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib$${abi/*:/}; \ + done ; \ + done +else + ${INSTALL_DIR} ${IDIR_GLIBC}/$(ADK_TARGET_LIBC_PATH) $(CP) $(STAGING_TARGET_DIR)/lib/ld*.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH) for file in libc libcrypt libdl libm libnsl libresolv libutil libnss_compat libnss_dns libnss_files; do \ $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \ $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VER).so $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \ done + $(CP) $(STAGING_TARGET_DIR)/usr/bin/getconf $(IDIR_GLIBC)/usr/bin +ifeq ($(ADK_LOCALES),y) + $(CP) $(STAGING_TARGET_DIR)/usr/bin/locale $(IDIR_GLIBC)/usr/bin +endif +endif + ${INSTALL_DIR} ${IDIR_GLIBC}/etc + ${INSTALL_DATA} ${STAGING_TARGET_DIR}/etc/{gai,nscd,nsswitch}.conf ${IDIR_GLIBC}/etc + +glibc-static-install: + ${INSTALL_DIR} $(IDIR_GLIBC_STATIC)/usr/lib + $(CP) $(STAGING_TARGET_DIR)/usr/lib/libc.a $(IDIR_GLIBC_STATIC)/usr/lib glibc-dev-install: echo $(TARGET_CFLAGS) ${INSTALL_DIR} $(IDIR_GLIBC_DEV)/$(ADK_TARGET_LIBC_PATH) $(IDIR_GLIBC_DEV)/usr/lib # install linker script -cp ./files/libc.so.$(CPU_ARCH) $(IDIR_GLIBC_DEV)/usr/lib/libc.so +ifeq ($(ADK_TARGET_ABI_O32),y) + $(SED) "s#@@ELFFORMAT@@#elf32-tradlittlemips#" $(IDIR_GLIBC_DEV)/usr/lib/libc.so +endif +ifeq ($(ADK_TARGET_ABI_N32),y) + $(SED) "s#@@ELFFORMAT@@#elf32-ntradlittlemips#" $(IDIR_GLIBC_DEV)/usr/lib/libc.so +endif +ifeq ($(ADK_TARGET_ABI_N64),y) + $(SED) "s#@@ELFFORMAT@@#elf64-tradlittlemips#" $(IDIR_GLIBC_DEV)/usr/lib/libc.so +endif ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib -for file in libcrypt libdl libm libresolv libutil; do \ @@ -69,6 +95,7 @@ glibc-dev-install: ); $(GLIBC_ENV) $(MAKE) -C $(WRKBUILD) cross-compiling=yes install-headers touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h + touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs-{32,x32,64}.h touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h # WORKAROUND: bits/syscall.h is only installed via install-others target $(CP) $(STAGING_TARGET_DIR)/usr/include/bits/syscall.h \ |