⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcc-tools.jam

📁 C++的一个好库。。。现在很流行
💻 JAM
📖 第 1 页 / 共 2 页
字号:
# Copyright (c) 2001 David Abrahams.
# Copyright (c) 2002-2005 Rene Rivera.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# The following #// line will be used by the regression test table generation
# program as the column heading for HTML tables. Must not include version number.
#//<a href="http://gcc.gnu.org/">GNU<br>GCC</a>

# compute directories for invoking GCC
#
# The gcc toolset can be user-configured using the following
# variables:
#
# GCC_ROOT_DIRECTORY
#       The directory in which GCC was installed. Defaults to
#       unset. Usually, there is no need to set this variable at
#       all. However, if G++ is not in the path it is usually
#       sufficient to configure this one variable. More fine-grained
#       configuration is available by setting the following:
#
# GCC_BIN_DIRECTORY
#       the directory prefix used to find the gcc executables. Defaults to
#       $(GCC_ROOT_DIRECTORY)/bin/, or "" if GCC_ROOT_DIRECTORY is
#       not set.
#
# GCC_INCLUDE_DIRECTORY
#       the directory in which to find system includes. Defaults to
#       empty.
#
# GCC_STDLIB_DIRECTORY
#       the directory in which to find the standard library
#       objects associated with this build of gcc. Defaults to
#       $(GCC_ROOT_DIRECTORY)/lib. 
#
# GXX
#       The name by which g++ is invoked. You can also use this in
#       lieu of setting the <cxxflags> property to force options such
#       as "-V3.0.4" into the g++ command line: "-sGXX=g++ -V3.0.4".
#
# GCC
#       Similar to GXX, the name by which gcc is invoked for "C"
#       language targets.

# singleton variables...
set-as-singleton GCC_ROOT_DIRECTORY GCC_BIN_DIRECTORY GCC_INCLUDE_DIRECTORY GCC_STDLIB_DIRECTORY ;

flags gcc GCC_BIN_DIRECTORY : $(GCC_BIN_DIRECTORY) ;
flags gcc GCC_INCLUDE_DIRECTORY : $(GCC_INCLUDE_DIRECTORY) ;
flags gcc GCC_STDLIB_DIRECTORY : $(GCC_STDLIB_DIRECTORY) ;

GCC_BIN_DIRECTORY ?= $(GCC_ROOT_DIRECTORY)$(SLASH)bin ;
GCC_BIN_DIRECTORY ?= "" ; # Don't clobber tool names if GCC_ROOT_DIRECTORY not set
GCC_STDLIB_DIRECTORY ?= $(GCC_ROOT_DIRECTORY)$(SLASH)lib ;

# Make sure this gets set "on" the target
flags gcc GCC_BIN_DIR : $(GCC_BIN_DIRECTORY) ;

flags gcc LINKFLAGS <runtime-link>static : -static ;
flags gcc CFLAGS <debug-symbols>on : -g ;
flags gcc LINKFLAGS <debug-symbols>on : -g ;
flags gcc CFLAGS <optimization>off : -O0 ;
flags gcc CFLAGS <optimization>speed : -O3 ;

# Other optimizations we might want for GCC
# -fforce-mem -fomit-frame-pointer
# -foptimize-sibling-calls -finline-functions -ffast-math -finline-limit=10000

flags gcc CFLAGS <optimization>space : -Os ;
flags gcc CFLAGS <inlining>off : -fno-inline ;
flags gcc CFLAGS <inlining>on : -Wno-inline ;
flags gcc CFLAGS <inlining>full : -finline-functions -Wno-inline ;

flags gcc .GXX : $(GXX) ;
flags gcc .GCC : $(GCC) ;

#
# set threading options for various platforms:
#
local on-windows ;

if $(NT)
{
    on-windows = 1 ;
}
else if $(UNIX)
{
    switch $(JAMUNAME)
    {
        case CYGWIN* :
        {
            on-windows = 1 ;
        }
    }
}

flags gcc ON_WINDOWS : $(on-windows) ;

if $(on-windows)
{
    flags gcc CFLAGS <threading>multi : -mthreads ;
    flags gcc LINKFLAGS <threading>multi : -mthreads ;
}
else if $(UNIX)
{
    switch $(JAMUNAME)
    {
    case SunOS* :
        {
        flags gcc CFLAGS <threading>multi : -pthreads ;
        flags gcc LINKFLAGS <threading>multi : -pthreads ;
        flags gcc FINDLIBS <threading>multi : rt ;
        }
    case BeOS :
        {
        # BeOS has no threading options, don't set anything here.
        }
    case Darwin :
        {
        # MacOS X, doesn't need any threading options set
        # -lpthread is linked to by default.
        # There is no gcc/g++, we need to use cc/c++ instead:
        .GCC ?= cc ;
        .GXX ?= c++ ;
        }
    case *BSD :
        {
        flags gcc CFLAGS <threading>multi : -pthread ;
        flags gcc LINKFLAGS <threading>multi : -pthread ;
        # there is no -lrt on BSD
        }
    case DragonFly :
        {
        flags gcc CFLAGS <threading>multi : -pthread ;
        flags gcc LINKFLAGS <threading>multi : -pthread ;
        # there is no -lrt on BSD - DragonFly is a FreeBSD variant,
        # which anoyingly doesn't say it's a *BSD.
        }
    case IRIX :
        {
        # gcc on IRIX does not support multi-threading, don't set anything here.
        }
    case HP_UX :
        {
        # gcc on HP-UX does not support multi-threading, don't set anything here
        }
    case QNX* :
        {
        # gcc/QCC on QNX is always? in multi-thread mode, don't set anything here
        }
    case * :
        {
        flags gcc CFLAGS <threading>multi : -pthread ;
        flags gcc LINKFLAGS <threading>multi : -pthread ;
        flags gcc FINDLIBS <threading>multi : rt ;
        }
    }
}

# Some possibly supported, or not, linker flags. The support depends on the OS linker.
#
flags gcc RPATH_LINK  ;
flags gcc SONAME ;

# Set/reset options for the linker of the platform.
#
if $(UNIX)
{
    switch $(JAMUNAME)
    {
    case SunOS* :
        {
        NO_GNU_LN = true ; # sun seems not to use the GNU linker with gcc
        flags gcc OBJCOPY_FLAGS <debug-symbols>on : "--set-section-flags .debug_str=contents" ;
        }
    case Linux :
        {
        RPATH_LINK = -Wl,-rpath-link, ;
        SONAME = -Wl,-soname, ;
        flags gcc OBJCOPY_FLAGS <debug-symbols>on : "--set-section-flags .debug_str=contents,debug" ;
        }
    case OpenBSD :
        {
        SONAME = -Wl,-soname, ;
        }
    case AIX* :
        {
        NO_GNU_LN = true ;
        IMPLIB_FLAGS = "-Wl,-bI:" ;
        }
    }
}


# Set architecture/instruction-set options.
#
# x86 and compatible
.ARCH = <architecture>x86 <architecture>native ;
flags gcc CFLAGS <architecture>x86/<instruction-set>default : -mcpu=i386 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>i386 : -mcpu=i386 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>i486 : -mcpu=i486 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>i586 : -mcpu=i586 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>i686 : -mcpu=i686 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentium : -mcpu=pentium ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentium-mmx : -mcpu=pentium-mmx ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentiumpro : -mcpu=pentiumpro ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentium2 : -mcpu=pentium2 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentium3 : -mcpu=pentium3 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>pentium4 : -mcpu=pentium4 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>k6 : -mcpu=k6 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>k6-2 : -mcpu=k6-2 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>k6-3 : -mcpu=k6-3 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>athlon : -mcpu=athlon ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>athlon-tbird : -mcpu=athlon-tbird ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>athlon-4 : -mcpu=athlon-4 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>athlon-xp : -mcpu=athlon-xp ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>athlon-mp : -mcpu=athlon-mp ;
# Sparc
.ARCH = <architecture>sparc <architecture>native ;
flags gcc CFLAGS <architecture>sparc/<instruction-set>default : -mcpu=v7 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>v7 : -mcpu=v7 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>cypress : -mcpu=cypress ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>v8 : -mcpu=v8 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>supersparc : -mcpu=supersparc ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>sparclite : -mcpu=sparclite ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>hypersparc : -mcpu=hypersparc ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>sparclite86x : -mcpu=sparclite86x ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>f930 : -mcpu=f930 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>f934 : -mcpu=f934 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>sparclet : -mcpu=sparclet ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>tsc701 : -mcpu=tsc701 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>v9 : -mcpu=v9 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>ultrasparc : -mcpu=ultrasparc ;
flags gcc CFLAGS <architecture>sparc/<address-model>64 : -m64 ;
flags gcc LINKFLAGS <architecture>sparc/<address-model>64 : -m64 ;
# RS/6000 & PowerPC
.ARCH = <architecture>power <architecture>native ;
flags gcc CFLAGS <architecture>power/<address-model>default/<instruction-set>default : -mcpu=common ;
flags gcc CFLAGS <architecture>power/<address-model>32/<instruction-set>default : -mcpu=common ;
flags gcc CFLAGS <architecture>power/<address-model>64/<instruction-set>default : -mcpu=powerpc64 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>rios : -mcpu=rios ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>rios1 : -mcpu=rios1 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>rsc : -mcpu=rsc ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>rios2 : -mcpu=rios2 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>rs64a : -mcpu=rs64a ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>403 : -mcpu=403 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>505 : -mcpu=505 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>601 : -mcpu=601 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>602 : -mcpu=602 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>603 : -mcpu=603 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>603e : -mcpu=603e ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>604 : -mcpu=604 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>604e : -mcpu=604e ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>620 : -mcpu=620 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>630 : -mcpu=630 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>740 : -mcpu=740 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>7400 : -mcpu=7400 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>7450 : -mcpu=7450 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>750 : -mcpu=750 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>801 : -mcpu=801 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>821 : -mcpu=821 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>823 : -mcpu=823 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>860 : -mcpu=860 ;
flags gcc CFLAGS $(.ARCH)/<instruction-set>power : -mcpu=power ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -