gcc4.port.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # $OpenBSD: gcc4.port.mk,v 1.2 2017/06/04 23:22:57 sthen Exp $
  2. MODGCC4_ARCHS ?=
  3. MODGCC4_LANGS ?=
  4. .if ${MODGCC4_LANGS:L} != "java" && !${MODGCC4_LANGS:L:Mc}
  5. # Always include support for this
  6. # unless only java is needed
  7. MODGCC4_LANGS += c
  8. .endif
  9. _MODGCC4_OKAY = c c++ java fortran
  10. .for _l in ${MODGCC4_LANGS:L}
  11. . if !${_MODGCC4_OKAY:M${_l}}
  12. ERRORS += "Fatal: unknown language ${_l}"
  13. . endif
  14. .endfor
  15. _MODGCC4_ARCH_USES = No
  16. .if ${MODGCC4_ARCHS:L} != ""
  17. . for _i in ${MODGCC4_ARCHS}
  18. . if !empty(MACHINE_ARCH:M${_i})
  19. _MODGCC4_ARCH_USES = Yes
  20. . endif
  21. . endfor
  22. .endif
  23. COMPILER_VERSION ?= gcc2
  24. _MODGCC4_LINKS =
  25. MODGCC4STDCPP = estdc++
  26. MODGCC4_CPPLIBDEP = lang/gcc/6,-libs>=6,<7
  27. MODGCC4_CPPWANTLIB = estdc++>=18
  28. .if ${_MODGCC4_ARCH_USES:L} == "yes"
  29. . if ${MODGCC4_LANGS:L:Mc}
  30. BUILD_DEPENDS += lang/gcc/6>=6,<7
  31. COMPILER_LINKS += cc ${LOCALBASE}/bin/egcc gcc ${LOCALBASE}/bin/egcc
  32. . endif
  33. . if ${MODGCC4_LANGS:L:Mc++}
  34. BUILD_DEPENDS += lang/gcc/6,-c++>=6,<7
  35. LIB_DEPENDS += ${MODGCC4_CPPLIBDEP}
  36. WANTLIB += ${MODGCC4_CPPWANTLIB}
  37. COMPILER_LINKS += c++ ${LOCALBASE}/bin/eg++ g++ ${LOCALBASE}/bin/eg++
  38. . endif
  39. . if ${MODGCC4_LANGS:L:Mfortran}
  40. BUILD_DEPENDS += lang/gcc/6,-f95>=6,<7
  41. WANTLIB += gfortran>=7
  42. # XXX sync with Makefile
  43. .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
  44. WANTLIB += quadmath
  45. .endif
  46. LIB_DEPENDS += lang/gcc/6,-libs>=6,<7
  47. COMPILER_LINKS += gfortran ${LOCALBASE}/bin/egfortran
  48. . endif
  49. . if ${MODGCC4_LANGS:L:Mjava}
  50. BUILD_DEPENDS += lang/gcc/6,-java>=6,<7
  51. MODGCC4_GCJWANTLIB = gcj
  52. MODGCC4_GCJLIBDEP = lang/gcc/6,-java>=6,<7
  53. COMPILER_LINKS += gcj ${LOCALBASE}/bin/egcj
  54. _MODGCC4_LINKS += gcjh gjar gij
  55. . endif
  56. #. if ${MODGCC4_LANGS:L:Mgo}
  57. #BUILD_DEPENDS += lang/gcc/6,-go>=6,<7
  58. #WANTLIB += go
  59. #LIB_DEPENDS += lang/gcc/6,-go>=6,<7
  60. #COMPILER_LINKS += gccgo ${LOCALBASE}/bin/egccgo
  61. #. endif
  62. .endif
  63. .if !empty(_MODGCC4_LINKS)
  64. . for _src in ${_MODGCC4_LINKS}
  65. MODGCC4_post-patch += ln -sf ${LOCALBASE}/bin/e${_src} ${WRKDIR}/bin/${_src};
  66. . endfor
  67. .endif