Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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:= GNU C compiler
  7. PKG_SECTION:= lang
  8. PKG_OPTS:= noremove
  9. PKG_DEPENDS:= libmpc libgmp mpfr libgcc
  10. PKG_BUILDDEP:= libmpc gmp mpfr
  11. PKG_SUBPKGS:= GCC GXX
  12. PKGSD_GXX:= GNU 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. ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y)
  34. CONFIGURE_ARGS+= --enable-sjlj-exceptions
  35. else
  36. CONFIGURE_ARGS+= --disable-sjlj-exceptions
  37. endif
  38. ifneq ($(ADK_PACKAGE_GXX),)
  39. CONFIGURE_ARGS+= --enable-languages=c,c++
  40. else
  41. CONFIGURE_ARGS+= --enable-languages=c
  42. endif
  43. ifeq ($(CPU_ARCH),ppc)
  44. CONFIGURE_ARGS+= --disable-target-optspace --with-long-double-64 --enable-secureplt
  45. TARGET_CFLAGS+= '-Wl,--secure-plt'
  46. else
  47. CONFIGURE_ARGS+= --enable-target-optspace
  48. endif
  49. CONFIGURE_ENV+= have_sys_sdt_h=no
  50. CONFIGURE_ARGS+= --host=$(GNU_TARGET_NAME) \
  51. --target=$(GNU_TARGET_NAME) \
  52. --build=$(GNU_HOST_NAME) \
  53. --disable-__cxa_atexit \
  54. --without-headers \
  55. --libexecdir=/usr/lib \
  56. --disable-libssp \
  57. --disable-biarch \
  58. --disable-libmudflap \
  59. --disable-libgomp \
  60. --disable-multilib \
  61. --disable-libstdcxx-pch \
  62. --disable-libsanitizer \
  63. --disable-libitm \
  64. --enable-cxx-flags="${TARGET_LDFLAGS}"
  65. # disable honour cflags stuff
  66. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  67. pre-configure:
  68. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  69. gcc-install:
  70. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  71. ${INSTALL_DIR} ${IDIR_GCC}/lib
  72. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  73. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  74. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  75. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  76. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  77. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  78. g++-install:
  79. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  80. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  81. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  82. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  83. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  84. include ${TOPDIR}/mk/pkg-bottom.mk