# 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 : pathscale ; toolset.inherit pathscale : unix ; generators.override pathscale.prebuilt : builtin.prebuilt ; generators.override pathscale.searched-lib-generator : searched-lib-generator ; rule init ( version ? : command * : options * ) { local install_dir = "/home/kbelco/pathscale-compilers-fedora1-2.3.1-2.3178/bin" ; local condition = [ common.check-init-parameters pathscale : version $(version) ] ; command = [ common.get-invocation-command pathscale : pathCC : $(command) : $(install_dir) ] ; common.handle-options pathscale : $(condition) : $(command) : $(options) ; command_c = $(command_c[1--2]) $(command[-1]:B=pathcc) ; toolset.flags pathscale CONFIG_C_COMMAND $(condition) : $(command_c) ; # fortran support local command = [ common.get-invocation-command pathscale : pathf90 : $(command) : $(install_dir) ] ; command_f = $(command_f[1--2]) $(command[-1]:B=pathf90) ; toolset.flags pathscale CONFIG_F_COMMAND $(condition) : $(command_f) ; } # Declare generators generators.register-c-compiler pathscale.compile.c : C : OBJ : pathscale ; generators.register-c-compiler pathscale.compile.c++ : CPP : OBJ : pathscale ; generators.register-fortran-compiler pathscale.compile.fortran : FORTRAN : OBJ : pathscale ; # Declare flags and actions for compilation flags pathscale.compile OPTIONS on : -g ; flags pathscale.compile OPTIONS on : -xprofile=tcov ; flags pathscale.compile OPTIONS speed : -fast -xarch=generic ; flags pathscale.compile OPTIONS space : -xO2 -xspace ; flags pathscale.compile OPTIONS multi : -mt ; flags pathscale.compile.c++ OPTIONS off : -INLINE:none ; flags pathscale.compile OPTIONS ; flags pathscale.compile.c++ OPTIONS ; flags pathscale.compile DEFINES ; flags pathscale.compile INCLUDES ; flags pathscale.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 pathscale.link OPTIONS on : -g ; # Strip the binary when no debugging is needed flags pathscale.link OPTIONS off : -s ; flags pathscale.link OPTIONS on : -xprofile=tcov ; flags pathscale.link OPTIONS multi : -mt ; flags pathscale.link OPTIONS ; flags pathscale.link LINKPATH ; flags pathscale.link FINDLIBS-ST ; flags pathscale.link FINDLIBS-SA ; flags pathscale.link LIBRARIES ; flags pathscale.link LINK-RUNTIME static : static ; flags pathscale.link LINK-RUNTIME shared : dynamic ; flags pathscale.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 pathscale.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) } # Declare action for creating static libraries actions piecemeal archive { "$(CONFIG_COMMAND)" -ar -o "$(<)" "$(>)" }