From 3faecf9a00512dcbc8712c4bca9adae72fb64410 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Sat, 12 May 2012 14:01:52 -0400 Subject: Give in and copy bjam into cdec source code --- jam-files/boost-build/tools/mipspro.jam | 145 ++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 jam-files/boost-build/tools/mipspro.jam (limited to 'jam-files/boost-build/tools/mipspro.jam') diff --git a/jam-files/boost-build/tools/mipspro.jam b/jam-files/boost-build/tools/mipspro.jam new file mode 100644 index 00000000..417eaefc --- /dev/null +++ b/jam-files/boost-build/tools/mipspro.jam @@ -0,0 +1,145 @@ +# Copyright Noel Belcourt 2007. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import property ; +import generators ; +import os ; +import toolset : flags ; +import feature ; +import fortran ; +import type ; +import common ; + +feature.extend toolset : mipspro ; +toolset.inherit mipspro : unix ; +generators.override mipspro.prebuilt : builtin.lib-generator ; +generators.override mipspro.searched-lib-generator : searched-lib-generator ; + +# Documentation and toolchain description located +# http://www.sgi.com/products/software/irix/tools/ + +rule init ( version ? : command * : options * ) +{ + local condition = [ + common.check-init-parameters mipspro : version $(version) ] ; + + command = [ common.get-invocation-command mipspro : CC : $(command) ] ; + + common.handle-options mipspro : $(condition) : $(command) : $(options) ; + + command_c = $(command_c[1--2]) $(command[-1]:B=cc) ; + + toolset.flags mipspro CONFIG_C_COMMAND $(condition) : $(command_c) ; + + # fortran support + local command = [ + common.get-invocation-command mipspro : f77 : $(command) : $(install_dir) ] ; + + command_f = $(command_f[1--2]) $(command[-1]:B=f77) ; + toolset.flags mipspro CONFIG_F_COMMAND $(condition) : $(command_f) ; + + # set link flags + flags mipspro.link FINDLIBS-ST : [ + feature.get-values : $(options) ] : unchecked ; + + flags mipspro.link FINDLIBS-SA : [ + feature.get-values : $(options) ] : unchecked ; +} + +# Declare generators +generators.register-c-compiler mipspro.compile.c : C : OBJ : mipspro ; +generators.register-c-compiler mipspro.compile.c++ : CPP : OBJ : mipspro ; +generators.register-fortran-compiler mipspro.compile.fortran : FORTRAN : OBJ : mipspro ; + +cpu-arch-32 = + / + /32 ; + +cpu-arch-64 = + /64 ; + +flags mipspro.compile OPTIONS $(cpu-arch-32) : -n32 ; +flags mipspro.compile OPTIONS $(cpu-arch-64) : -64 ; + +# Declare flags and actions for compilation +flags mipspro.compile OPTIONS on : -g ; +# flags mipspro.compile OPTIONS on : -xprofile=tcov ; +flags mipspro.compile OPTIONS off : -w ; +flags mipspro.compile OPTIONS on : -ansiW -diag_suppress 1429 ; # suppress long long is nonstandard warning +flags mipspro.compile OPTIONS all : -fullwarn ; +flags mipspro.compile OPTIONS speed : -Ofast ; +flags mipspro.compile OPTIONS space : -O2 ; +flags mipspro.compile OPTIONS : -LANG:std ; +flags mipspro.compile.c++ OPTIONS off : -INLINE:none ; +flags mipspro.compile.c++ OPTIONS ; +flags mipspro.compile DEFINES ; +flags mipspro.compile INCLUDES ; + + +flags mipspro.compile.fortran OPTIONS ; + +actions compile.c +{ + "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions compile.c++ +{ + "$(CONFIG_COMMAND)" -FE:template_in_elf_section -ptused $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +actions compile.fortran +{ + "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + +# Declare flags and actions for linking +flags mipspro.link OPTIONS on : -g ; +# Strip the binary when no debugging is needed +# flags mipspro.link OPTIONS off : -s ; +# flags mipspro.link OPTIONS on : -xprofile=tcov ; +# flags mipspro.link OPTIONS multi : -mt ; + +flags mipspro.link OPTIONS $(cpu-arch-32) : -n32 ; +flags mipspro.link OPTIONS $(cpu-arch-64) : -64 ; + +flags mipspro.link OPTIONS speed : -Ofast ; +flags mipspro.link OPTIONS space : -O2 ; +flags mipspro.link OPTIONS ; +flags mipspro.link LINKPATH ; +flags mipspro.link FINDLIBS-ST ; +flags mipspro.link FINDLIBS-SA ; +flags mipspro.link FINDLIBS-SA multi : pthread ; +flags mipspro.link LIBRARIES ; +flags mipspro.link LINK-RUNTIME static : static ; +flags mipspro.link LINK-RUNTIME shared : dynamic ; +flags mipspro.link RPATH ; + +rule link ( targets * : sources * : properties * ) +{ + SPACE on $(targets) = " " ; +} + +actions link bind LIBRARIES +{ + "$(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 +} + +# Slight mods for dlls +rule link.dll ( targets * : sources * : properties * ) +{ + SPACE on $(targets) = " " ; +} + +actions link.dll bind LIBRARIES +{ + "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) +} + +# Declare action for creating static libraries +actions piecemeal archive +{ + ar -cr "$(<)" "$(>)" +} -- cgit v1.2.3