# Copyright (C) 2006 Noel Belcourt # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or # 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 ; 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) ; } # 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 ; # Declare flags and actions for compilation flags mipspro.compile OPTIONS on : -g ; flags mipspro.compile OPTIONS on : -xprofile=tcov ; flags mipspro.compile OPTIONS speed : -Ofast -xarch=generic ; flags mipspro.compile OPTIONS space : -xO2 -xspace ; flags mipspro.compile OPTIONS multi : -mt ; flags mipspro.compile.c++ OPTIONS off : -INLINE:none ; flags mipspro.compile OPTIONS ; 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)" $(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 ; flags mipspro.link LINKPATH ; flags mipspro.link FINDLIBS-ST ; flags mipspro.link FINDLIBS-SA ; flags mipspro.link LIBRARIES ; flags mipspro.link LINK-RUNTIME static : static ; flags mipspro.link LINK-RUNTIME shared : dynamic ; flags mipspro.link RPATH ; # On gcc, there are separate options for dll path at runtime and # link time. On Solaris, there's only one: -R, so we have to use # it, even though it's bad idea. flags mipspro.link RPATH ; rule link ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; } actions link bind LIBRARIES { "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) } # 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 "$(<)" -h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) }