📄 gcc.jam
字号:
# On *nix mixing shared libs with static runtime is not a good idea. toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>shared : -Wl,-Bstatic : unchecked ; toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>shared : -Wl,-Bdynamic : unchecked ; # On windows allow mixing of static and dynamic libs with static # runtime. toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>static/<target-os>windows : -Wl,-Bstatic : unchecked ; toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>static/<target-os>windows : -Wl,-Bdynamic : unchecked ; toolset.flags $(toolset).link OPTIONS $(condition)/<runtime-link>static/<target-os>windows : -Wl,-Bstatic : unchecked ; } case hpux : { toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,-s : unchecked ; toolset.flags $(toolset).link OPTIONS $(condition)/<link>shared : -fPIC : unchecked ; } case osf : { # No --strip-all, just -s. toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,-s : unchecked ; toolset.flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ; # This does not supports -R. toolset.flags $(toolset).link RPATH_OPTION $(condition) : -rpath : unchecked ; # -rpath-link is not supported at all. } case sun : { toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,-s : unchecked ; toolset.flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ; # Solaris linker does not have a separate -rpath-link, but allows to use # -L for the same purpose. toolset.flags $(toolset).link LINKPATH $(condition) : <xdll-path> : unchecked ; # This permits shared libraries with non-PIC code on Solaris. # VP, 2004/09/07: Now that we have -fPIC hardcode in link.dll, the # following is not needed. Whether -fPIC should be hardcoded, is a # separate question. # AH, 2004/10/16: it is still necessary because some tests link against # static libraries that were compiled without PIC. toolset.flags $(toolset).link OPTIONS $(condition)/<link>shared : -mimpure-text : unchecked ; } case * : { errors.user-error "$(toolset) initialization: invalid linker '$(linker)'" : "The value '$(linker)' specified for <linker> is not recognized." : "Possible values are 'aix', 'darwin', 'gnu', 'hpux', 'osf' or 'sun'" ; } }}# Declare actions for linking.rule link ( targets * : sources * : properties * ){ setup-threading $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; # Serialize execution of the 'link' action, since running N links in # parallel is just slower. For now, serialize only gcc links, it might be a # good idea to serialize all links. JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;}actions link bind LIBRARIES{ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)}# Default value. Mostly for the sake of intel-linux that inherits from gcc, but# does not have the same logic to set the .AR variable. We can put the same# logic in intel-linux, but that's hardly worth the trouble as on Linux, 'ar' is# always available..AR = ar ;toolset.flags gcc.archive AROPTIONS <archiveflags> ;rule archive ( targets * : sources * : properties * ){ # Always remove archive and start again. Here is the rationale from # # Andre Hentz: # # I had a file, say a1.c, that was included into liba.a. I moved a1.c to # a2.c, updated my Jamfiles and rebuilt. My program was crashing with absurd # errors. After some debugging I traced it back to the fact that a1.o was # *still* in liba.a # # Rene Rivera: # # Originally removing the archive was done by splicing an RM onto the # archive action. That makes archives fail to build on NT when they have # many files because it will no longer execute the action directly and blow # the line length limit. Instead we remove the file in a different action, # just before building the archive. # local clean.a = $(targets[1])(clean) ; TEMPORARY $(clean.a) ; NOCARE $(clean.a) ; LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ; DEPENDS $(clean.a) : $(sources) ; DEPENDS $(targets) : $(clean.a) ; common.RmTemps $(clean.a) : $(targets) ;}# Declare action for creating static libraries.# The letter 'r' means to add files to the archive with replacement. Since we# remove archive, we don't care about replacement, but there's no option "add# without replacement".# The letter 'c' suppresses the warning in case the archive does not exists yet.# That warning is produced only on some platforms, for whatever reasons.actions piecemeal archive{ "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"}rule link.dll ( targets * : sources * : properties * ){ setup-threading $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;}# Differs from 'link' above only by -shared.actions link.dll bind LIBRARIES{ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)}rule setup-threading ( targets * : sources * : properties * ){ local threading = [ feature.get-values threading : $(properties) ] ; if $(threading) = multi { local target = [ feature.get-values target-os : $(properties) ] ; local option ; local libs ; switch $(target) { case windows : { option = -mthreads ; } case cygwin : { option = -mthreads ; } case sunos : { option = -pthreads ; libs = rt ; } case beos : { # BeOS has no threading options, so do not set anything here. } case *bsd : { option = -pthread ; # There is no -lrt on BSD. } case sgi : { # gcc on IRIX does not support multi-threading so do not set anything # here. } case darwin : { # Darwin has no threading options so do not set anything here. } case * : { option = -pthread ; libs = rt ; } } if $(option) { OPTIONS on $(targets) += $(option) ; } if $(libs) { FINDLIBS-SA on $(targets) += $(libs) ; } } }local rule cpu-flags ( toolset variable : architecture : instruction-set + : values + : default ? ){ if $(default) { toolset.flags $(toolset) $(variable) <architecture>$(architecture)/<instruction-set> : $(values) ; } toolset.flags $(toolset) $(variable) <architecture>/<instruction-set>$(instruction-set) <architecture>$(architecture)/<instruction-set>$(instruction-set) : $(values) ;}# Set architecture/instruction-set options.## x86 and compatibletoolset.flags gcc OPTIONS <architecture>x86/<address-model>32 : -m32 ;toolset.flags gcc OPTIONS <architecture>x86/<address-model>64 : -m64 ;cpu-flags gcc OPTIONS : x86 : i386 : -march=i386 : default ;cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ;cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ;cpu-flags gcc OPTIONS : x86 : i686 : -march=i686 ;cpu-flags gcc OPTIONS : x86 : pentium : -march=pentium ;cpu-flags gcc OPTIONS : x86 : pentium-mmx : -march=pentium-mmx ;cpu-flags gcc OPTIONS : x86 : pentiumpro : -march=pentiumpro ;cpu-flags gcc OPTIONS : x86 : pentium2 : -march=pentium2 ;cpu-flags gcc OPTIONS : x86 : pentium3 : -march=pentium3 ;cpu-flags gcc OPTIONS : x86 : pentium3m : -march=pentium3m ;cpu-flags gcc OPTIONS : x86 : pentium-m : -march=pentium-m ;cpu-flags gcc OPTIONS : x86 : pentium4 : -march=pentium4 ;cpu-flags gcc OPTIONS : x86 : pentium4m : -march=pentium4m ;cpu-flags gcc OPTIONS : x86 : prescott : -march=prescott ;cpu-flags gcc OPTIONS : x86 : nocona : -march=nocona ;cpu-flags gcc OPTIONS : x86 : k6 : -march=k6 ;cpu-flags gcc OPTIONS : x86 : k6-2 : -march=k6-2 ;cpu-flags gcc OPTIONS : x86 : k6-3 : -march=k6-3 ;cpu-flags gcc OPTIONS : x86 : athlon : -march=athlon ;cpu-flags gcc OPTIONS : x86 : athlon-tbird : -march=athlon-tbird ;cpu-flags gcc OPTIONS : x86 : athlon-4 : -march=athlon-4 ;cpu-flags gcc OPTIONS : x86 : athlon-xp : -march=athlon-xp ;cpu-flags gcc OPTIONS : x86 : athlon-mp : -march=athlon-mp ;##cpu-flags gcc OPTIONS : x86 : k8 : -march=k8 ;cpu-flags gcc OPTIONS : x86 : opteron : -march=opteron ;cpu-flags gcc OPTIONS : x86 : athlon64 : -march=athlon64 ;cpu-flags gcc OPTIONS : x86 : athlon-fx : -march=athlon-fx ;cpu-flags gcc OPTIONS : x86 : winchip-c6 : -march=winchip-c6 ;cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ;cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ;cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ;# Sparctoolset.flags gcc OPTIONS <architecture>sparc/<address-model>32 : -m32 ;toolset.flags gcc OPTIONS <architecture>sparc/<address-model>64 : -m64 ;cpu-flags gcc OPTIONS : sparc : c3 : -mcpu=c3 : default ;cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 ;cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ;cpu-flags gcc OPTIONS : sparc : v8 : -mcpu=v8 ;cpu-flags gcc OPTIONS : sparc : supersparc : -mcpu=supersparc ;cpu-flags gcc OPTIONS : sparc : sparclite : -mcpu=sparclite ;cpu-flags gcc OPTIONS : sparc : hypersparc : -mcpu=hypersparc ;cpu-flags gcc OPTIONS : sparc : sparclite86x : -mcpu=sparclite86x ;cpu-flags gcc OPTIONS : sparc : f930 : -mcpu=f930 ;cpu-flags gcc OPTIONS : sparc : f934 : -mcpu=f934 ;cpu-flags gcc OPTIONS : sparc : sparclet : -mcpu=sparclet ;cpu-flags gcc OPTIONS : sparc : tsc701 : -mcpu=tsc701 ;cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ;cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ;cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ;# RS/6000 & PowerPCtoolset.flags gcc OPTIONS <architecture>power/<address-model>32 : -m32 ;toolset.flags gcc OPTIONS <architecture>power/<address-model>64 : -m64 ;cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ;cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ;cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ;cpu-flags gcc OPTIONS : power : 602 : -mcpu=602 ;cpu-flags gcc OPTIONS : power : 603 : -mcpu=603 ;cpu-flags gcc OPTIONS : power : 603e : -mcpu=603e ;cpu-flags gcc OPTIONS : power : 604 : -mcpu=604 ;cpu-flags gcc OPTIONS : power : 604e : -mcpu=604e ;cpu-flags gcc OPTIONS : power : 620 : -mcpu=620 ;cpu-flags gcc OPTIONS : power : 630 : -mcpu=630 ;cpu-flags gcc OPTIONS : power : 740 : -mcpu=740 ;cpu-flags gcc OPTIONS : power : 7400 : -mcpu=7400 ;cpu-flags gcc OPTIONS : power : 7450 : -mcpu=7450 ;cpu-flags gcc OPTIONS : power : 750 : -mcpu=750 ;cpu-flags gcc OPTIONS : power : 801 : -mcpu=801 ;cpu-flags gcc OPTIONS : power : 821 : -mcpu=821 ;cpu-flags gcc OPTIONS : power : 823 : -mcpu=823 ;cpu-flags gcc OPTIONS : power : 860 : -mcpu=860 ;cpu-flags gcc OPTIONS : power : 970 : -mcpu=970 ;cpu-flags gcc OPTIONS : power : 8540 : -mcpu=8540 ;cpu-flags gcc OPTIONS : power : power : -mcpu=power ;cpu-flags gcc OPTIONS : power : power2 : -mcpu=power2 ;cpu-flags gcc OPTIONS : power : power3 : -mcpu=power3 ;cpu-flags gcc OPTIONS : power : power4 : -mcpu=power4 ;cpu-flags gcc OPTIONS : power : power5 : -mcpu=power5 ;cpu-flags gcc OPTIONS : power : powerpc : -mcpu=powerpc ;cpu-flags gcc OPTIONS : power : powerpc64 : -mcpu=powerpc64 ;cpu-flags gcc OPTIONS : power : rios : -mcpu=rios ;cpu-flags gcc OPTIONS : power : rios1 : -mcpu=rios1 ;cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ;cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ;cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ;# AIX variant of RS/6000 & PowerPCtoolset.flags gcc OPTIONS <architecture>power/<address-model>32/<target-os>aix : -maix32 ;toolset.flags gcc OPTIONS <architecture>power/<address-model>64/<target-os>aix : -maix64 ;toolset.flags gcc AROPTIONS <architecture>power/<address-model>64/<target-os>aix : "-X 64" ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -