/Src/Dependencies/Boost/tools/build/v2/tools/mipspro.jam

http://hadesmem.googlecode.com/ · text · 145 lines · 115 code · 30 blank · 0 comment · 0 complexity · d81df39490a0239ebe9e471396f6cad4 MD5 · raw file

  1. # Copyright Noel Belcourt 2007.
  2. # Distributed under the Boost Software License, Version 1.0.
  3. # (See accompanying file LICENSE_1_0.txt or copy at
  4. # http://www.boost.org/LICENSE_1_0.txt)
  5. import property ;
  6. import generators ;
  7. import os ;
  8. import toolset : flags ;
  9. import feature ;
  10. import fortran ;
  11. import type ;
  12. import common ;
  13. feature.extend toolset : mipspro ;
  14. toolset.inherit mipspro : unix ;
  15. generators.override mipspro.prebuilt : builtin.lib-generator ;
  16. generators.override mipspro.searched-lib-generator : searched-lib-generator ;
  17. # Documentation and toolchain description located
  18. # http://www.sgi.com/products/software/irix/tools/
  19. rule init ( version ? : command * : options * )
  20. {
  21. local condition = [
  22. common.check-init-parameters mipspro : version $(version) ] ;
  23. command = [ common.get-invocation-command mipspro : CC : $(command) ] ;
  24. common.handle-options mipspro : $(condition) : $(command) : $(options) ;
  25. command_c = $(command_c[1--2]) $(command[-1]:B=cc) ;
  26. toolset.flags mipspro CONFIG_C_COMMAND $(condition) : $(command_c) ;
  27. # fortran support
  28. local command = [
  29. common.get-invocation-command mipspro : f77 : $(command) : $(install_dir) ] ;
  30. command_f = $(command_f[1--2]) $(command[-1]:B=f77) ;
  31. toolset.flags mipspro CONFIG_F_COMMAND $(condition) : $(command_f) ;
  32. # set link flags
  33. flags mipspro.link FINDLIBS-ST : [
  34. feature.get-values <find-static-library> : $(options) ] : unchecked ;
  35. flags mipspro.link FINDLIBS-SA : [
  36. feature.get-values <find-shared-library> : $(options) ] : unchecked ;
  37. }
  38. # Declare generators
  39. generators.register-c-compiler mipspro.compile.c : C : OBJ : <toolset>mipspro ;
  40. generators.register-c-compiler mipspro.compile.c++ : CPP : OBJ : <toolset>mipspro ;
  41. generators.register-fortran-compiler mipspro.compile.fortran : FORTRAN : OBJ : <toolset>mipspro ;
  42. cpu-arch-32 =
  43. <architecture>/<address-model>
  44. <architecture>/<address-model>32 ;
  45. cpu-arch-64 =
  46. <architecture>/<address-model>64 ;
  47. flags mipspro.compile OPTIONS $(cpu-arch-32) : -n32 ;
  48. flags mipspro.compile OPTIONS $(cpu-arch-64) : -64 ;
  49. # Declare flags and actions for compilation
  50. flags mipspro.compile OPTIONS <debug-symbols>on : -g ;
  51. # flags mipspro.compile OPTIONS <profiling>on : -xprofile=tcov ;
  52. flags mipspro.compile OPTIONS <warnings>off : -w ;
  53. flags mipspro.compile OPTIONS <warnings>on : -ansiW -diag_suppress 1429 ; # suppress long long is nonstandard warning
  54. flags mipspro.compile OPTIONS <warnings>all : -fullwarn ;
  55. flags mipspro.compile OPTIONS <optimization>speed : -Ofast ;
  56. flags mipspro.compile OPTIONS <optimization>space : -O2 ;
  57. flags mipspro.compile OPTIONS <cflags> : -LANG:std ;
  58. flags mipspro.compile.c++ OPTIONS <inlining>off : -INLINE:none ;
  59. flags mipspro.compile.c++ OPTIONS <cxxflags> ;
  60. flags mipspro.compile DEFINES <define> ;
  61. flags mipspro.compile INCLUDES <include> ;
  62. flags mipspro.compile.fortran OPTIONS <fflags> ;
  63. actions compile.c
  64. {
  65. "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
  66. }
  67. actions compile.c++
  68. {
  69. "$(CONFIG_COMMAND)" -FE:template_in_elf_section -ptused $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
  70. }
  71. actions compile.fortran
  72. {
  73. "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
  74. }
  75. # Declare flags and actions for linking
  76. flags mipspro.link OPTIONS <debug-symbols>on : -g ;
  77. # Strip the binary when no debugging is needed
  78. # flags mipspro.link OPTIONS <debug-symbols>off : -s ;
  79. # flags mipspro.link OPTIONS <profiling>on : -xprofile=tcov ;
  80. # flags mipspro.link OPTIONS <threading>multi : -mt ;
  81. flags mipspro.link OPTIONS $(cpu-arch-32) : -n32 ;
  82. flags mipspro.link OPTIONS $(cpu-arch-64) : -64 ;
  83. flags mipspro.link OPTIONS <optimization>speed : -Ofast ;
  84. flags mipspro.link OPTIONS <optimization>space : -O2 ;
  85. flags mipspro.link OPTIONS <linkflags> ;
  86. flags mipspro.link LINKPATH <library-path> ;
  87. flags mipspro.link FINDLIBS-ST <find-static-library> ;
  88. flags mipspro.link FINDLIBS-SA <find-shared-library> ;
  89. flags mipspro.link FINDLIBS-SA <threading>multi : pthread ;
  90. flags mipspro.link LIBRARIES <library-file> ;
  91. flags mipspro.link LINK-RUNTIME <runtime-link>static : static ;
  92. flags mipspro.link LINK-RUNTIME <runtime-link>shared : dynamic ;
  93. flags mipspro.link RPATH <dll-path> ;
  94. rule link ( targets * : sources * : properties * )
  95. {
  96. SPACE on $(targets) = " " ;
  97. }
  98. actions link bind LIBRARIES
  99. {
  100. "$(CONFIG_COMMAND)" -FE:template_in_elf_section -ptused $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) -lm
  101. }
  102. # Slight mods for dlls
  103. rule link.dll ( targets * : sources * : properties * )
  104. {
  105. SPACE on $(targets) = " " ;
  106. }
  107. actions link.dll bind LIBRARIES
  108. {
  109. "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
  110. }
  111. # Declare action for creating static libraries
  112. actions piecemeal archive
  113. {
  114. ar -cr "$(<)" "$(>)"
  115. }