Makefile 3.4 KB

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