Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. PKG_OPTS:= noremove
  8. PKG_SUBPKGS:= GLIBC GLIBC_DEV
  9. NO_DISTFILES:= 1
  10. include $(TOPDIR)/mk/package.mk
  11. GLIBC_CONFOPTS:= --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. test -z $(ADK_RUNTIME_TIMEZONE) || \
  37. $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \
  38. $(IDIR_GLIBC)/etc/localtime
  39. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_GLIBC)/lib/
  40. $(CP) $(STAGING_DIR)/lib/ld*.so* $(IDIR_GLIBC)/lib/
  41. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  42. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib/; \
  43. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
  44. done
  45. glibc-dev-install:
  46. ${INSTALL_DIR} $(IDIR_GLIBC_DEV)/lib $(IDIR_GLIBC_DEV)/usr/lib
  47. # install linker script
  48. -cp ./files/libc.so.$(ARCH) $(IDIR_GLIBC_DEV)/usr/lib/libc.so
  49. ${CP} ${STAGING_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib
  50. ${CP} ${STAGING_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib
  51. # header package
  52. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  53. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  54. INSTALL_HDR_PATH=$(IDIR_GLIBC_DEV)/usr \
  55. headers_install
  56. (cd $(WRKBUILD); \
  57. PATH='${TARGET_PATH}' \
  58. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)/configure \
  59. --prefix=/usr \
  60. --with-sysroot=$(IDIR_GLIBC_DEV) \
  61. ${GLIBC_CONFOPTS} \
  62. );
  63. $(MAKE) -C $(WRKBUILD) \
  64. cross-compiling=yes \
  65. install_root=$(IDIR_GLIBC_DEV) \
  66. install-headers
  67. touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h
  68. touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h
  69. @find $(IDIR_GLIBC_DEV) -name .install -exec rm {} \;
  70. include ${TOPDIR}/mk/pkg-bottom.mk