2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 12:42:11 +00:00
Files
build/gcc.jam
Vladimir Prus 731f4ee7f7 Improve 'flags' and the gcc toolset.
* gcc.jam: Extend the 'toolset' feature with gcc here.
    Use flags for linking too and eliminate 'link-options'
    rule. Remove empty compile/archive/link/link-dll rules.

* toolset.jam (flags): Document somehow.
     (set-target-variables): Call 'actualize' on values
     of dependency features.


[SVN r16440]
2002-11-27 09:35:53 +00:00

57 lines
1.8 KiB
Plaintext

import property ;
import generators ;
import os ;
feature.extend toolset : gcc ;
# Declare generators
generators.register-composing gcc.link : LIB OBJ : EXE : <toolset>gcc ;
generators.register-composing gcc.archive : OBJ : STATIC_LIB : <toolset>gcc ;
generators.register-composing gcc.link-dll : OBJ : SHARED_LIB : <toolset>gcc ;
generators.register-c-compiler gcc.compile : CPP : OBJ : <toolset>gcc ;
generators.register-c-compiler gcc.compile : C : OBJ : <toolset>gcc ;
# Declare flags and action for compilation
toolset.flags gcc.compile OPTIONS <optimization>on : -O2 ;
toolset.flags gcc.compile OPTIONS <debug-symbols>on : -g ;
toolset.flags gcc.compile OPTIONS <cxxflags> ;
toolset.flags gcc.compile DEFINES <define> ;
toolset.flags gcc.compile INCLUDES <include> ;
actions compile
{
g++ -ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I$(INCLUDES) -c -o $(<) $(>)
}
# Declare flags and action for linking
toolset.flags gcc.link OPTIONS <debug-symbols>on : -g ;
toolset.flags gcc.link LINKPATH <library-path> ;
toolset.flags gcc.link FINDLIBS <find-library> ;
toolset.flags gcc.link LIBRARIES <library-file> ;
toolset.flags gcc.link LIBRARIES <library> ;
actions link bind LIBRARIES
{
g++ $(OPTIONS) -L$(LINKPATH) -o $(<) $(>) $(LIBRARIES) -l$(FINDLIBS)
}
# Declare action for creating static libraries
actions archive
{
ar ur $(<) $(>)
}
# Declare flags and action for linking shared libraries
toolset.flags gcc.link-dll OPTIONS <debug-symbols>on : -g ;
toolset.flags gcc.link-dll LINKPATH <library-path> ;
toolset.flags gcc.link-dll FINDLIBS <find-library> ;
toolset.flags gcc.link-dll LIBRARIES <library-file> ;
toolset.flags gcc.link-dll LIBRARIES <library> ;
actions link-dll bind LIBS
{
g++ $(OPTIONS) -o $(<) -Wl,-soname,$(<[1]:D=) -shared $(>) $(LIBS) $(FINDLIBS)
}