Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 ../rules.mk
  5. include Makefile.inc
  6. include ${TOPDIR}/mk/buildhlp.mk
  7. # glibc does not compile with Os
  8. TARGET_CFLAGS:=$(subst Os,O2,$(TARGET_CFLAGS))
  9. GLIBC_CONFOPTS:= \
  10. --build=$(GNU_HOST_NAME) \
  11. --host=$(REAL_GNU_TARGET_NAME) \
  12. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  13. --disable-nls \
  14. --disable-sanity-checks \
  15. --disable-nls \
  16. --without-cvs \
  17. --disable-profile \
  18. --disable-debug \
  19. --without-gd \
  20. --with-__thread \
  21. --with-tls \
  22. --enable-kernel="2.6.0" \
  23. --enable-add-ons
  24. GLIBC_ENV:= PATH='${TARGET_PATH}' \
  25. BUILD_CC=${HOSTCC} \
  26. CFLAGS="$(TARGET_CFLAGS)" \
  27. CC=${REAL_GNU_TARGET_NAME}-gcc \
  28. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  29. AR=${REAL_GNU_TARGET_NAME}-ar \
  30. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  31. LD=${REAL_GNU_TARGET_NAME}-ld \
  32. libc_cv_forced_unwind=yes \
  33. libc_cv_c_cleanup=yes \
  34. libc_cv_gnu99_inline=yes \
  35. libc_cv_slibdir="/lib"
  36. ifeq ($(ADK_TARGET_NO_FPU),y)
  37. GLIBC_CONFOPTS+= --without-fp
  38. endif
  39. ifeq (${ADK_MAKE_PARALLEL},y)
  40. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
  41. endif
  42. GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  43. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  44. $(WRKBUILD)/.headers_configure:
  45. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); ln -sf ../glibc-ports-2.11/ ports);
  46. mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
  47. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  48. $(WRKBUILD)/configure \
  49. --prefix=/usr \
  50. --with-sysroot=$(TOOLCHAIN_SYSROOT) \
  51. ${GLIBC_CONFOPTS} \
  52. );
  53. touch $@
  54. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  55. mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
  56. -$(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_INITIAL) \
  57. cross-compiling=yes \
  58. install_root=$(TOOLCHAIN_SYSROOT) \
  59. install-headers
  60. touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
  61. touch $@
  62. $(WRKBUILD)/.configured:
  63. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  64. (cd $(GLIBC_BUILD_DIR_FINAL); \
  65. ${GLIBC_ENV} \
  66. $(WRKBUILD)/configure \
  67. --prefix=/usr \
  68. --enable-shared \
  69. --enable-stackguard-randomization \
  70. ${GLIBC_CONFOPTS} \
  71. );
  72. touch $@
  73. $(WRKBUILD)/.compiled:
  74. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  75. touch $@
  76. $(WRKBUILD)/.installed:
  77. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
  78. install_root=$(STAGING_DIR) install
  79. touch $(STAGING_DIR)/usr/include/gnu/stubs.h
  80. touch $@
  81. include ${TOPDIR}/mk/toolchain.mk