Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_ARCH_DEPENDS:= !avr32
  12. PKG_SUBPKGS:= GCC GXX
  13. PKGSD_GXX:= GNU C++ compiler
  14. WRKBUILD= ${WRKDIR}/${PKG_NAME}-obj
  15. include ${TOPDIR}/mk/package.mk
  16. $(eval $(call PKG_template,GCC,gcc,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  17. $(eval $(call PKG_template,GXX,g++,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  18. TARGET_CPPFLAGS:= ''
  19. TARGET_CFLAGS:= ''
  20. TARGET_CXXFLAGS:= $(filter-out -fstack-protector,$(TARGET_CXXFLAGS))
  21. ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
  22. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
  23. endif
  24. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64),y)
  25. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
  26. endif
  27. ifeq ($(ADK_TARGET_SYSTEM_QEMU_MIPS64EL),y)
  28. CONFIGURE_ARGS+= --with-abi=$(ADK_TARGET_ABI)
  29. endif
  30. ifneq ($(ADK_PACKAGE_GXX),)
  31. CONFIGURE_ARGS+= --enable-languages=c,c++
  32. else
  33. CONFIGURE_ARGS+= --enable-languages=c
  34. endif
  35. CONFIGURE_ENV+= have_sys_sdt_h=no
  36. CONFIGURE_ARGS+= --host=$(REAL_GNU_TARGET_NAME) \
  37. --target=$(REAL_GNU_TARGET_NAME) \
  38. --disable-__cxa_atexit \
  39. --without-headers \
  40. --libexecdir=/usr/lib \
  41. --disable-libssp \
  42. --disable-sjlj-exceptions \
  43. --disable-biarch \
  44. --disable-libmudflap \
  45. --disable-libgomp \
  46. --disable-multilib \
  47. --disable-libstdcxx-pch \
  48. --enable-cxx-flags="${TARGET_LDFLAGS}"
  49. # disable honour cflags stuff
  50. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  51. pre-configure:
  52. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  53. gcc-install:
  54. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  55. ${INSTALL_DIR} ${IDIR_GCC}/lib
  56. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  57. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  58. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  59. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  60. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  61. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  62. g++-install:
  63. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  64. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  65. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  66. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  67. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  68. include ${TOPDIR}/mk/pkg-bottom.mk