1
0

Makefile 2.5 KB

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