Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 ${ADK_TOPDIR}/toolchain/gcc/Makefile.inc
  5. PKG_NAME:= gcc
  6. PKG_DESCR:= c compiler
  7. PKG_SECTION:= dev/lang
  8. PKG_OPTS:= noremove
  9. PKG_DEPENDS:= libmpc libgmp mpfr
  10. PKG_BUILDDEP:= libmpc gmp mpfr
  11. PKG_SUBPKGS:= GCC GXX
  12. PKGSD_GXX:= c++ compiler
  13. WRKBUILD= ${WRKDIR}/${PKG_NAME}-obj
  14. include ${ADK_TOPDIR}/mk/package.mk
  15. $(eval $(call PKG_template,GCC,gcc,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  16. $(eval $(call PKG_template,GXX,g++,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  17. CPPFLAGS_FOR_BUILD:= -I$(STAGING_HOST_DIR)/usr/include
  18. CFLAGS_FOR_BUILD:=
  19. LDFLAGS_FOR_BUILD:=
  20. TARGET_CPPFLAGS:=
  21. TARGET_CFLAGS:=
  22. TARGET_LDFLAGS:=
  23. TARGET_CXXFLAGS:=
  24. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  25. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  26. endif
  27. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64),y)
  28. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  29. endif
  30. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y)
  31. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_MIPS_ABI)
  32. endif
  33. ifneq ($(ADK_PACKAGE_GXX),)
  34. CONFIGURE_ARGS+= --enable-languages=c,c++
  35. else
  36. CONFIGURE_ARGS+= --enable-languages=c
  37. endif
  38. ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
  39. CONFIGURE_ARGS+= --disable-target-optspace --with-long-double-64 --enable-secureplt
  40. TARGET_CFLAGS+= '-Wl,--secure-plt'
  41. else
  42. CONFIGURE_ARGS+= --enable-target-optspace
  43. endif
  44. CONFIGURE_ENV+= have_sys_sdt_h=no
  45. CONFIGURE_ARGS+= --host=$(GNU_TARGET_NAME) \
  46. --target=$(GNU_TARGET_NAME) \
  47. --build=$(GNU_HOST_NAME) \
  48. --disable-__cxa_atexit \
  49. --without-headers \
  50. --libexecdir=/usr/lib \
  51. --disable-libssp \
  52. --disable-biarch \
  53. --disable-libmudflap \
  54. --disable-libgomp \
  55. --disable-multilib \
  56. --disable-libstdcxx-pch \
  57. --disable-libsanitizer \
  58. --disable-libitm \
  59. --disable-install-libiberty \
  60. --enable-dependency-tracking \
  61. --enable-cxx-flags="${TARGET_LDFLAGS}"
  62. # disable honour cflags stuff
  63. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  64. pre-configure:
  65. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  66. $(SED) 's/install_to_$$(INSTALL_DEST) //' ${WRKSRC}/libiberty/Makefile.in
  67. gcc-install:
  68. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  69. ${INSTALL_DIR} ${IDIR_GCC}/lib
  70. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  71. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  72. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  73. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  74. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  75. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  76. g++-install:
  77. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  78. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  79. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  80. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  81. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  82. include ${ADK_TOPDIR}/mk/pkg-bottom.mk