Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. do-extract:
  28. # do nothing, glibc is already build in toolchain directory
  29. do-install:
  30. ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
  31. # install /etc/localtime from host system (FIXME)
  32. ${CP} /etc/localtime $(IDIR_GLIBC)/etc
  33. $(CP) $(STAGING_DIR)/lib/libgcc_s.so* $(IDIR_GLIBC)/lib/
  34. $(CP) $(STAGING_DIR)/lib/ld-*.so* $(IDIR_GLIBC)/lib/
  35. -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
  36. $(CP) $(STAGING_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib/; \
  37. $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
  38. done
  39. # create ld.so link for mips gcc linker option
  40. cd $(IDIR_GLIBC)/lib && ln -sf ld-linux.so.2 ld.so.1
  41. # header package
  42. $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ARCH=$(ARCH) V=1 \
  43. INSTALL_HDR_PATH=$(IDIR_GLIBC_DEV)/usr \
  44. headers_install
  45. (cd $(WRKBUILD); \
  46. $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/configure \
  47. --prefix=/usr \
  48. --with-sysroot=$(IDIR_GLIBC_DEV) \
  49. ${GLIBC_CONFOPTS} \
  50. );
  51. $(MAKE) -C $(WRKBUILD) \
  52. cross-compiling=yes \
  53. install_root=$(IDIR_GLIBC_DEV) \
  54. install-headers
  55. touch $(IDIR_GLIBC_DEV)/usr/include/gnu/stubs.h
  56. touch $(IDIR_GLIBC_DEV)/usr/include/bits/stdio_lim.h
  57. @find $(IDIR_GLIBC_DEV) -name .install -delete
  58. include ${TOPDIR}/mk/pkg-bottom.mk