Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. PKG_OPTS:= noremove
  8. PKG_SUBPKGS:= EGLIBC EGLIBC_DEV
  9. NO_DISTFILES:= 1
  10. include $(TOPDIR)/mk/package.mk
  11. $(eval $(call PKG_template,EGLIBC,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  12. $(eval $(call PKG_template,EGLIBC_DEV,$(PKG_NAME)-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  13. CONFIG_STYLE:= manual
  14. BUILD_STYLE:= manual
  15. INSTALL_STYLE:= manual
  16. EGLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
  17. --host=$(REAL_GNU_TARGET_NAME) \
  18. --with-headers=$(STAGING_TARGET_DIR)/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. GCC_HONOUR_COPTS=s \
  30. BUILD_CC=${CC_FOR_BUILD} \
  31. CFLAGS="$(TARGET_CFLAGS)" \
  32. CC=${REAL_GNU_TARGET_NAME}-gcc \
  33. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  34. AR=${REAL_GNU_TARGET_NAME}-ar \
  35. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  36. libc_cv_forced_unwind=yes \
  37. libc_cv_c_cleanup=yes \
  38. libc_cv_gnu99_inline=yes \
  39. libc_cv_slibdir="/lib"
  40. # compile nothing, eglibc is already build in toolchain directory
  41. do-install:
  42. ${INSTALL_DIR} $(IDIR_EGLIBC)/lib $(IDIR_EGLIBC)/etc \
  43. $(IDIR_EGLIBC)/usr/lib
  44. cd ${STAGING_TARGET_DIR} && for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
  45. test -s usr/share/zoneinfo/"$$f" || continue; \
  46. echo usr/share/zoneinfo/"$$f" | \
  47. ${TOOLS_DIR}/cpio -pdu ${IDIR_EGLIBC}/; \
  48. done
  49. tz=; cd ${IDIR_EGLIBC}/usr/share/zoneinfo || exit 1; \
  50. for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
  51. test -s "$$f" || continue; \
  52. tz=$$f; \
  53. done; if test x"$$tz" = x""; then \
  54. echo >&2 Error during timezone installation; \
  55. exit 1; \
  56. else \
  57. ln -sf "../usr/share/zoneinfo/$$tz" \
  58. ${IDIR_EGLIBC}/etc/localtime; \
  59. fi
  60. ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
  61. $(CP) $(STAGING_TARGET_DIR)/lib/libssp.so* $(IDIR_EGLIBC)/lib/
  62. endif
  63. $(CP) $(STAGING_TARGET_DIR)/lib/ld* $(IDIR_EGLIBC)/lib/
  64. -for file in libc libcrypt libdl libm libresolv librt libutil libnss_dns libnss_files; do \
  65. $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_EGLIBC)/lib/; \
  66. $(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_EGLIBC)/lib/; \
  67. done
  68. ${INSTALL_DATA} ${STAGING_TARGET_DIR}/etc/gai.conf ${IDIR_EGLIBC}/etc/
  69. ${INSTALL_DATA} ${STAGING_TARGET_DIR}/etc/nscd.conf ${IDIR_EGLIBC}/etc/
  70. ${INSTALL_DATA} ${STAGING_TARGET_DIR}/etc/nsswitch.conf ${IDIR_EGLIBC}/etc/
  71. eglibc-dev-install:
  72. ${INSTALL_DIR} $(IDIR_EGLIBC_DEV)/lib $(IDIR_EGLIBC_DEV)/usr/lib
  73. # install linker script
  74. -cp ./files/libc.so.$(ARCH) $(IDIR_EGLIBC_DEV)/usr/lib/libc.so
  75. ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt* ${IDIR_EGLIBC_DEV}/usr/lib
  76. ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc_nonshared.a ${IDIR_EGLIBC_DEV}/usr/lib
  77. -for file in libc libcrypt libdl libm libresolv librt libutil; do \
  78. cd $(IDIR_EGLIBC_DEV)/lib/; ln -sf $$file-$(PKG_VERSION).so $$file.so; \
  79. done
  80. # header package
  81. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  82. HOSTCC=$(CC_FOR_BUILD) ARCH=$(ARCH) V=1 \
  83. INSTALL_HDR_PATH=$(IDIR_EGLIBC_DEV)/usr \
  84. headers_install
  85. (cd $(WRKBUILD); \
  86. ${EGLIBC_ENV} \
  87. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)/libc/configure \
  88. --prefix=$(IDIR_EGLIBC_DEV)/usr \
  89. --with-headers=$(IDIR_EGLIBC_DEV)/usr/include \
  90. ${EGLIBC_CONFOPTS} \
  91. );
  92. PATH='${TARGET_PATH}' $(MAKE) -C $(WRKBUILD) \
  93. install-headers install-bootstrap-headers=yes
  94. @touch $(IDIR_EGLIBC_DEV)/usr/include/gnu/stubs.h
  95. @find $(IDIR_EGLIBC_DEV) -name .install -exec rm {} \;
  96. @find $(IDIR_EGLIBC_DEV) -name ..install.cmd -exec rm {} \;
  97. # conflicts with libiconv
  98. find $(IDIR_EGLIBC_DEV) -name iconv.h -exec rm {} \;
  99. include ${TOPDIR}/mk/pkg-bottom.mk