Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. SUB_INSTALLS-y:=
  13. SUB_INSTALLS-m:=
  14. SUB_INSTALLS-${ADK_PACKAGE_EGLIBC_DEV}+= eglibc-dev-install
  15. EGLIBC_CONFOPTS:= \
  16. --build=$(GNU_HOST_NAME) \
  17. --host=$(REAL_GNU_TARGET_NAME) \
  18. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  19. --disable-nls \
  20. --without-cvs \
  21. --disable-profile \
  22. --disable-debug \
  23. --enable-kernel=2.6.0 \
  24. --without-gd \
  25. --with-__thread \
  26. --with-tls \
  27. --enable-add-ons
  28. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  29. BUILD_CC=${HOSTCC} \
  30. CFLAGS="$(TARGET_CFLAGS)" \
  31. CC=${REAL_GNU_TARGET_NAME}-gcc \
  32. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  33. AR=${REAL_GNU_TARGET_NAME}-ar \
  34. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  35. libc_cv_forced_unwind=yes \
  36. libc_cv_c_cleanup=yes \
  37. libc_cv_gnu99_inline=yes \
  38. libc_cv_slibdir="/lib"
  39. # compile nothing, eglibc is already build in toolchain directory
  40. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  41. ${INSTALL_DIR} $(IDIR_EGLIBC)/lib $(IDIR_EGLIBC)/etc $(IDIR_EGLIBC)/usr/lib
  42. # install /etc/localtime from host system (FIXME)
  43. ${CP} /etc/localtime $(IDIR_EGLIBC)/etc
  44. $(CP) $(STAGING_DIR)/lib/ld-* $(IDIR_EGLIBC)/lib/
  45. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_EGLIBC)/lib/
  46. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  47. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_EGLIBC)/lib/; \
  48. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_EGLIBC)/lib/; \
  49. done
  50. # install linker script
  51. -cp ./files/libc.so.$(CPU_ARCH) $(IDIR_EGLIBC)/usr/lib/libc.so
  52. cd $(IDIR_EGLIBC)/lib && ln -sf libm.so.6 libm.so
  53. cd $(IDIR_EGLIBC)/lib && ln -sf libutil.so.1 libutil.so
  54. cd $(IDIR_EGLIBC)/lib && ln -sf librt.so.1 librt.so
  55. cd $(IDIR_EGLIBC)/lib && ln -sf libcrypt.so.1 libcrypt.so
  56. cd $(IDIR_EGLIBC)/lib && ln -sf libdl.so.2 libdl.so
  57. eglibc-dev-install:
  58. # header package
  59. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) \
  60. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  61. INSTALL_HDR_PATH=$(IDIR_EGLIBC_DEV)/usr \
  62. headers_install
  63. (cd $(WRKBUILD); \
  64. ${EGLIBC_ENV} \
  65. $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/libc/configure \
  66. --prefix=$(IDIR_EGLIBC_DEV)/usr \
  67. --with-headers=$(IDIR_EGLIBC_DEV)/usr/include \
  68. ${EGLIBC_CONFOPTS} \
  69. );
  70. PATH='${TARGET_PATH}' \
  71. $(MAKE) -C $(WRKBUILD) \
  72. install-headers install-bootstrap-headers=yes
  73. @find $(IDIR_EGLIBC_DEV) -name .install -exec rm {} \;
  74. include ${TOPDIR}/mk/pkg-bottom.mk