Makefile 2.8 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 ${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
  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. ifneq ($(ADK_PACKAGE_GXX),)
  34. CONFIGURE_ARGS+= --enable-languages=c,c++
  35. else
  36. CONFIGURE_ARGS+= --enable-languages=c
  37. endif
  38. ifeq ($(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. --enable-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. gcc-install:
  66. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  67. ${INSTALL_DIR} ${IDIR_GCC}/lib
  68. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  69. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  70. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  71. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  72. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  73. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  74. g++-install:
  75. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  76. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  77. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  78. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  79. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  80. include ${TOPDIR}/mk/pkg-bottom.mk