1
0

Makefile 2.4 KB

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