Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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:= \
  12. --build=$(GNU_HOST_NAME) \
  13. --host=$(REAL_GNU_TARGET_NAME) \
  14. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  15. --disable-nls \
  16. --disable-sanity-checks \
  17. --disable-nls \
  18. --without-cvs \
  19. --disable-profile \
  20. --disable-debug \
  21. --without-gd \
  22. --with-__thread \
  23. --with-tls \
  24. --enable-kernel="2.6.0" \
  25. --enable-add-ons
  26. $(eval $(call PKG_template,GLIBC,glibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  27. $(eval $(call PKG_template,GLIBC_DEV,glibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
  28. CONFIG_STYLE:= manual
  29. BUILD_STYLE:= manual
  30. INSTALL_STYLE:= manual
  31. SUB_INSTALLS-y:=
  32. SUB_INSTALLS-m:=
  33. SUB_INSTALLS-${ADK_PACKAGE_GLIBC_DEV}+= glibc-dev-install
  34. # compile nothing, glibc is already build in toolchain directory
  35. do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  36. ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
  37. test -z $(ADK_RUNTIME_TIMEZONE) || \
  38. $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \
  39. $(IDIR_EGLIBC)/etc/localtime
  40. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_GLIBC)/lib/
  41. $(CP) $(STAGING_DIR)/lib/ld*.so* $(IDIR_GLIBC)/lib/
  42. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  43. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib/; \
  44. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
  45. done
  46. glibc-dev-install:
  47. ${INSTALL_DIR} $(IDIR_GLIBC_DEV)/lib $(IDIR_GLIBC_DEV)/usr/lib
  48. # install linker script
  49. -cp ./files/libc.so.$(ARCH) $(IDIR_GLIBC_DEV)/usr/lib/libc.so
  50. ${CP} ${STAGING_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib
  51. ${CP} ${STAGING_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib
  52. # header package
  53. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
  54. HOSTCC=$(HOSTCC) ARCH=$(ARCH) V=1 \
  55. INSTALL_HDR_PATH=$(IDIR_GLIBC_DEV)/usr \
  56. headers_install
  57. (cd $(WRKBUILD); \
  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