Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_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. ifeq ($(ADK_TOOLCHAIN_GCC_SJLJ),y)
  31. CONFIGURE_ARGS+= --enable-sjlj-exceptions
  32. else
  33. CONFIGURE_ARGS+= --disable-sjlj-exceptions
  34. endif
  35. ifneq ($(ADK_PACKAGE_GXX),)
  36. CONFIGURE_ARGS+= --enable-languages=c,c++
  37. else
  38. CONFIGURE_ARGS+= --enable-languages=c
  39. endif
  40. CONFIGURE_ENV+= have_sys_sdt_h=no
  41. CONFIGURE_ARGS+= --host=$(REAL_GNU_TARGET_NAME) \
  42. --target=$(REAL_GNU_TARGET_NAME) \
  43. --disable-__cxa_atexit \
  44. --without-headers \
  45. --libexecdir=/usr/lib \
  46. --disable-libssp \
  47. --disable-biarch \
  48. --disable-libmudflap \
  49. --disable-libgomp \
  50. --disable-multilib \
  51. --disable-libstdcxx-pch \
  52. --enable-cxx-flags="${TARGET_LDFLAGS}"
  53. # disable honour cflags stuff
  54. XAKE_FLAGS+= GCC_HONOUR_COPTS=s
  55. pre-configure:
  56. $(SED) 's@\./fixinc\.sh@-c true@' $(WRKSRC)/gcc/Makefile.in
  57. gcc-install:
  58. ${INSTALL_DIR} ${IDIR_GCC}/usr/lib/gcc ${IDIR_GCC}/usr/bin
  59. ${INSTALL_DIR} ${IDIR_GCC}/lib
  60. ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
  61. cd ${IDIR_GCC}/usr/bin/ && ln -sf gcc cc
  62. ${INSTALL_BIN} ${WRKINST}/usr/bin/cpp ${IDIR_GCC}/usr/bin/
  63. cd ${IDIR_GCC}/lib && ln -sf ../usr/bin/cpp .
  64. ${CP} ${WRKINST}/usr/lib/gcc/* ${IDIR_GCC}/usr/lib/gcc/
  65. rm -rf ${IDIR_GCC}/usr/lib/gcc/*/*/install-tools
  66. g++-install:
  67. ${INSTALL_DIR} ${IDIR_GXX}/usr/bin
  68. ${INSTALL_DIR} ${IDIR_GXX}/usr/include/c++
  69. ${INSTALL_BIN} ${WRKINST}/usr/bin/g++ ${IDIR_GXX}/usr/bin/
  70. cd ${IDIR_GXX}/usr/bin/ && ln -sf g++ c++
  71. ${CP} ${WRKINST}/usr/include/c++/* ${IDIR_GXX}/usr/include/c++/
  72. include ${TOPDIR}/mk/pkg-bottom.mk