Makefile 2.4 KB

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