Makefile 3.3 KB

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