Makefile 2.4 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 $(ADK_TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include Makefile.inc
  6. include ${ADK_TOPDIR}/mk/buildhlp.mk
  7. GLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
  8. --host=$(GNU_TARGET_NAME) \
  9. --with-headers=$(STAGING_TARGET_DIR)/usr/include \
  10. --disable-sanity-checks \
  11. --disable-nls \
  12. --disable-werror \
  13. --without-cvs \
  14. --disable-profile \
  15. --without-gd \
  16. --disable-nscd \
  17. --with-__thread \
  18. --with-tls \
  19. --enable-shared \
  20. --enable-kernel="2.6.32" \
  21. --enable-add-ons
  22. ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
  23. GLIBC_CONFOPTS+= --enable-static-nss
  24. endif
  25. ifeq ($(ADK_TARGET_FLOAT),soft)
  26. GLIBC_CONFOPTS+= --without-fp
  27. endif
  28. ifeq ($(ADK_TARGET_FLOAT),hard)
  29. GLIBC_CONFOPTS+= --with-fp
  30. endif
  31. GLIBC_ENV:= PATH='${TARGET_PATH}' \
  32. BUILD_CC=${CC_FOR_BUILD} \
  33. CFLAGS="$(TARGET_CFLAGS)" \
  34. CXXFLAGS="$(TARGET_CXXFLAGS)" \
  35. CC="${TARGET_CC}" \
  36. CXX="${TARGET_CXX}" \
  37. AR="${TARGET_AR}" \
  38. RANLIB="${TARGET_RANLIB}" \
  39. libc_cv_forced_unwind=yes \
  40. libc_cv_c_cleanup=yes \
  41. libc_cv_gnu99_inline=yes \
  42. libc_cv_initfini_array=yes
  43. GLIBC_MAKEOPTS+= cross-compiling=yes
  44. ifeq (${ADK_MAKE_PARALLEL},y)
  45. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"
  46. endif
  47. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  48. $(WRKBUILD)/.configured:
  49. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  50. (cd $(GLIBC_BUILD_DIR_FINAL); \
  51. ${GLIBC_ENV} \
  52. $(WRKBUILD)/configure \
  53. --prefix=/usr \
  54. --enable-stackguard-randomization \
  55. ${GLIBC_CONFOPTS} \
  56. );
  57. touch $@
  58. $(WRKBUILD)/.compiled:
  59. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  60. touch $@
  61. $(WRKBUILD)/.installed:
  62. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
  63. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  64. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64,soft,hard}.h
  65. mkdir -p ${STAGING_TARGET_DIR}/etc
  66. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  67. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  68. touch $@
  69. include ${ADK_TOPDIR}/mk/toolchain.mk