Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 ${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 ${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-cxx-flags="${TARGET_LDFLAGS}"
  61. # disable honour cflags stuff
  62. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  63. pre-configure:
  64. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  65. $(SED) 's/install_to_$$(INSTALL_DEST) //' ${WRKSRC}/libiberty/Makefile.in
  66. gcc-install:
  67. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  68. ${INSTALL_DIR} ${IDIR_GCC}/lib
  69. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  70. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  71. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  72. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  73. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  74. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  75. g++-install:
  76. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  77. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  78. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  79. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  80. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  81. include ${TOPDIR}/mk/pkg-bottom.mk