Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/glibc/Makefile.inc
  5. PKG_DESCR:= GNU C library
  6. PKG_SECTION:= base
  7. NO_DISTFILES:= 1
  8. PKG_OPTS:= noremove
  9. include $(TOPDIR)/mk/package.mk
  10. GLIBC_CONFOPTS:= \
  11. --build=$(GNU_HOST_NAME) \
  12. --host=$(REAL_GNU_TARGET_NAME) \
  13. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  14. --disable-nls \
  15. --disable-sanity-checks \
  16. --disable-nls \
  17. --without-cvs \
  18. --disable-profile \
  19. --disable-debug \
  20. --without-gd \
  21. --with-__thread \
  22. --with-tls \
  23. --enable-kernel="2.6.0" \
  24. --enable-add-ons
  25. $(eval $(call PKG_template,GLIBC,glibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  26. $(eval $(call PKG_template,GLIBC_DEV,glibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  27. CONFIG_STYLE:= manual
  28. BUILD_STYLE:= manual
  29. INSTALL_STYLE:= manual
  30. SUB_INSTALLS-y:=
  31. SUB_INSTALLS-m:=
  32. SUB_INSTALLS-${ADK_PACKAGE_GLIBC_DEV}+= glibc-dev-install
  33. # compile nothing, glibc is already build in toolchain directory
  34. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  35. ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
  36. # install /etc/localtime from host system (FIXME)
  37. ${CP} /etc/localtime $(IDIR_GLIBC)/etc
  38. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_GLIBC)/lib/
  39. $(CP) $(STAGING_DIR)/lib/ld-*.so* $(IDIR_GLIBC)/lib/
  40. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  41. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib/; \
  42. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
  43. done
  44. glibc-dev-install:
  45. ${INSTALL_DIR} $(IDIR_GLIBC_DEV)/lib $(IDIR_GLIBC_DEV)/usr/lib
  46. # install linker script
  47. -cp ./files/libc.so.$(ARCH) $(IDIR_GLIBC_DEV)/usr/lib/libc.so
  48. ${CP} ${STAGING_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib
  49. ${CP} ${STAGING_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib
  50. # header package
  51. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  52. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  53. INSTALL_HDR_PATH=$(IDIR_GLIBC_DEV)/usr \
  54. headers_install
  55. (cd $(WRKBUILD); \
  56. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)/configure \
  57. --prefix=/usr \
  58. --with-sysroot=$(IDIR_GLIBC_DEV) \
  59. ${GLIBC_CONFOPTS} \
  60. );
  61. $(MAKE) -C $(WRKBUILD) \
  62. cross-compiling=yes \
  63. install_root=$(IDIR_GLIBC_DEV) \
  64. install-headers
  65. touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h
  66. touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h
  67. @find $(IDIR_GLIBC_DEV) -name .install -exec rm {} \;
  68. include ${TOPDIR}/mk/pkg-bottom.mk