1
0

Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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-kernel="2.6.32" \
  25. --enable-add-ons
  26. ifeq ($(ADK_TARGET_FLOAT),soft)
  27. GLIBC_CONFOPTS+= --without-fp
  28. endif
  29. ifeq ($(ADK_TARGET_FLOAT),hard)
  30. GLIBC_CONFOPTS+= --with-fp
  31. endif
  32. GLIBC_ENV:= PATH='${TARGET_PATH}' \
  33. BUILD_CC=${CC_FOR_BUILD} \
  34. CFLAGS="$(GLIBC_FLAGS)" \
  35. CXXFLAGS="$(GLIBC_FLAGS)" \
  36. CC="${TARGET_CC}" \
  37. CXX="${TARGET_CXX}" \
  38. AR="${TARGET_AR}" \
  39. RANLIB="${TARGET_RANLIB}" \
  40. libc_cv_forced_unwind=yes \
  41. libc_cv_c_cleanup=yes \
  42. libc_cv_gnu99_inline=yes \
  43. libc_cv_initfini_array=yes
  44. GLIBC_MAKEOPTS+= cross-compiling=yes
  45. ifeq (${ADK_MAKE_PARALLEL},y)
  46. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"
  47. endif
  48. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  49. $(WRKBUILD)/.configured:
  50. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  51. (cd $(GLIBC_BUILD_DIR_FINAL); \
  52. ${GLIBC_ENV} \
  53. $(WRKBUILD)/configure \
  54. --prefix=/usr \
  55. --enable-shared \
  56. --enable-stackguard-randomization \
  57. ${GLIBC_CONFOPTS} \
  58. );
  59. touch $@
  60. $(WRKBUILD)/.compiled:
  61. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  62. touch $@
  63. $(WRKBUILD)/.installed:
  64. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
  65. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  66. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64,soft,hard}.h
  67. mkdir -p ${STAGING_TARGET_DIR}/etc
  68. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  69. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  70. touch $@
  71. include ${ADK_TOPDIR}/mk/toolchain.mk