Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. test -z $(ADK_RUNTIME_TIMEZONE) || \
  37. $(CP) /usr/share/zoneinfo/$(ADK_RUNTIME_TIMEZONE) \
  38. $(IDIR_EGLIBC)/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. $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/$(PKG_NAME)-$(PKG_VERSION)/configure \
  58. --prefix=/usr \
  59. --with-sysroot=$(IDIR_GLIBC_DEV) \
  60. ${GLIBC_CONFOPTS} \
  61. );
  62. $(MAKE) -C $(WRKBUILD) \
  63. cross-compiling=yes \
  64. install_root=$(IDIR_GLIBC_DEV) \
  65. install-headers
  66. touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h
  67. touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h
  68. @find $(IDIR_GLIBC_DEV) -name .install -exec rm {} \;
  69. include ${TOPDIR}/mk/pkg-bottom.mk