Makefile 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. SUB_INSTALLS-y:=
  17. SUB_INSTALLS-m:=
  18. SUB_INSTALLS-${ADK_PACKAGE_EGLIBC_DEV}+= eglibc-dev-install
  19. EGLIBC_CONFOPTS:= \
  20. --build=$(GNU_HOST_NAME) \
  21. --host=$(REAL_GNU_TARGET_NAME) \
  22. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  23. --disable-nls \
  24. --without-cvs \
  25. --disable-profile \
  26. --disable-debug \
  27. --enable-kernel=2.6.0 \
  28. --without-gd \
  29. --with-__thread \
  30. --with-tls \
  31. --enable-add-ons
  32. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  33. BUILD_CC=${HOSTCC} \
  34. CFLAGS="$(TARGET_CFLAGS)" \
  35. CC=${REAL_GNU_TARGET_NAME}-gcc \
  36. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  37. AR=${REAL_GNU_TARGET_NAME}-ar \
  38. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  39. libc_cv_forced_unwind=yes \
  40. libc_cv_c_cleanup=yes \
  41. libc_cv_gnu99_inline=yes \
  42. libc_cv_slibdir="/lib"
  43. # compile nothing, eglibc is already build in toolchain directory
  44. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  45. ${INSTALL_DIR} $(IDIR_EGLIBC)/lib $(IDIR_EGLIBC)/etc \
  46. $(IDIR_EGLIBC)/usr/lib
  47. test -z $(ADK_RUNTIME_TIMEZONE) || \
  48. $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \
  49. $(IDIR_EGLIBC)/etc/localtime
  50. $(CP) $(STAGING_TARGET_DIR)/lib/ld* $(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_TARGET_DIR)/lib/$$file.so* $(IDIR_EGLIBC)/lib/; \
  53. $(CP) $(STAGING_TARGET_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_TARGET_DIR}/usr/lib/crt* ${IDIR_EGLIBC_DEV}/usr/lib
  60. ${CP} ${STAGING_TARGET_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. @find $(IDIR_EGLIBC_DEV) -name ..install.cmd -exec rm {} \;
  83. # conflicts with libiconv
  84. find $(IDIR_EGLIBC_DEV) -name iconv.h -exec rm {} \;
  85. include ${TOPDIR}/mk/pkg-bottom.mk