Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. include $(TOPDIR)/toolchain/eglibc/Makefile.inc
  5. PKG_DESCR:= embedded GNU C library
  6. PKG_SECTION:= base
  7. NO_DISTFILES:= 1
  8. PKG_OPTS:= noremove
  9. include $(TOPDIR)/mk/package.mk
  10. $(eval $(call PKG_template,EGLIBC,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  11. $(eval $(call PKG_template,EGLIBC_DEV,$(PKG_NAME)-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  12. EGLIBC_CONFOPTS:= \
  13. --build=$(GNU_HOST_NAME) \
  14. --host=$(REAL_GNU_TARGET_NAME) \
  15. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  16. --disable-nls \
  17. --without-cvs \
  18. --disable-profile \
  19. --disable-debug \
  20. --enable-kernel=2.6.0 \
  21. --without-gd \
  22. --with-__thread \
  23. --with-tls \
  24. --enable-add-ons
  25. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  26. BUILD_CC=${HOSTCC} \
  27. CFLAGS="$(TARGET_CFLAGS)" \
  28. CC=${REAL_GNU_TARGET_NAME}-gcc \
  29. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  30. AR=${REAL_GNU_TARGET_NAME}-ar \
  31. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  32. libc_cv_forced_unwind=yes \
  33. libc_cv_c_cleanup=yes \
  34. libc_cv_gnu99_inline=yes \
  35. libc_cv_slibdir="/lib"
  36. do-extract:
  37. # do nothing, eglibc is already build in toolchain directory
  38. do-install:
  39. ${INSTALL_DIR} $(IDIR_EGLIBC)/lib $(IDIR_EGLIBC)/etc $(IDIR_EGLIBC)/usr/lib
  40. # install /etc/localtime from host system (FIXME)
  41. ${CP} /etc/localtime $(IDIR_EGLIBC)/etc
  42. ifeq ($(ADK_SSP),y)
  43. $(CP) $(STAGING_DIR)/lib/libssp.so* $(IDIR_EGLIBC)/lib/
  44. endif
  45. $(CP) $(STAGING_DIR)/lib/ld-* $(IDIR_EGLIBC)/lib/
  46. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_EGLIBC)/lib/
  47. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  48. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_EGLIBC)/lib/; \
  49. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_EGLIBC)/lib/; \
  50. done
  51. # install linker script
  52. -cp ./files/libc.so.$(CPU_ARCH) $(IDIR_EGLIBC)/usr/lib/libc.so
  53. cd $(IDIR_EGLIBC)/lib && ln -sf libm.so.6 libm.so
  54. cd $(IDIR_EGLIBC)/lib && ln -sf libutil.so.1 libutil.so
  55. cd $(IDIR_EGLIBC)/lib && ln -sf librt.so.1 librt.so
  56. cd $(IDIR_EGLIBC)/lib && ln -sf libcrypt.so.1 libcrypt.so
  57. cd $(IDIR_EGLIBC)/lib && ln -sf libdl.so.2 libdl.so
  58. # header package
  59. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ARCH=$(ARCH) V=1 \
  60. INSTALL_HDR_PATH=$(IDIR_EGLIBC_DEV)/usr \
  61. headers_install
  62. (cd $(WRKBUILD); \
  63. ${EGLIBC_ENV} \
  64. $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/libc/configure \
  65. --prefix=$(IDIR_EGLIBC_DEV)/usr \
  66. --with-headers=$(IDIR_EGLIBC_DEV)/usr/include \
  67. ${EGLIBC_CONFOPTS} \
  68. );
  69. PATH='${TARGET_PATH}' \
  70. $(MAKE) -C $(WRKBUILD) \
  71. install-headers install-bootstrap-headers=yes
  72. @find $(IDIR_EGLIBC_DEV) -name .install -delete
  73. include ${TOPDIR}/mk/pkg-bottom.mk