Makefile 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 \
  42. $(IDIR_EGLIBC)/usr/lib
  43. # install /etc/localtime from host system (FIXME)
  44. ${CP} /etc/localtime $(IDIR_EGLIBC)/etc
  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. eglibc-dev-install:
  52. ${INSTALL_DIR} $(IDIR_EGLIBC_DEV)/lib $(IDIR_EGLIBC_DEV)/usr/lib
  53. # install linker script
  54. -cp ./files/libc.so.$(ARCH) $(IDIR_EGLIBC_DEV)/usr/lib/libc.so
  55. ${CP} ${STAGING_DIR}/usr/lib/crt* ${IDIR_EGLIBC_DEV}/usr/lib
  56. ${CP} ${STAGING_DIR}/usr/lib/libc_nonshared.a ${IDIR_EGLIBC_DEV}/usr/lib
  57. cd $(IDIR_EGLIBC_DEV)/lib && ln -sf libm.so.6 libm.so
  58. cd $(IDIR_EGLIBC_DEV)/lib && ln -sf libutil.so.1 libutil.so
  59. cd $(IDIR_EGLIBC_DEV)/lib && ln -sf librt.so.1 librt.so
  60. cd $(IDIR_EGLIBC_DEV)/lib && ln -sf libcrypt.so.1 libcrypt.so
  61. cd $(IDIR_EGLIBC_DEV)/lib && ln -sf libdl.so.2 libdl.so
  62. # header package
  63. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) \
  64. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  65. INSTALL_HDR_PATH=$(IDIR_EGLIBC_DEV)/usr \
  66. headers_install
  67. (cd $(WRKBUILD); \
  68. ${EGLIBC_ENV} \
  69. $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/libc/configure \
  70. --prefix=$(IDIR_EGLIBC_DEV)/usr \
  71. --with-headers=$(IDIR_EGLIBC_DEV)/usr/include \
  72. ${EGLIBC_CONFOPTS} \
  73. );
  74. PATH='${TARGET_PATH}' \
  75. $(MAKE) -C $(WRKBUILD) \
  76. install-headers install-bootstrap-headers=yes
  77. @find $(IDIR_EGLIBC_DEV) -name .install -exec rm {} \;
  78. include ${TOPDIR}/mk/pkg-bottom.mk