2013-02-11 51 views
2

我有一箇舊版本的boost 1.33.1。我想用一個自定義的gcc二進制文件構建它,這個二進制文件位於默認路徑之外。我無法在網絡上找到該頁面,因此我粘貼了gcc-tools.jam表格tools/build/v1/gcc-tools.jam的第一部分。修改默認編譯器路徑以建立提升

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 ; 

在這部分中,我可以使用在註釋部分中定義的變量將默認的gcc/g ++修改爲我自己的。但是我不知道該怎麼做。例如,我寫

GCC_BIN_DIRECTORY=/opt/gcc-4.1.2/installed 

但是,這給了我這個錯誤:

所以
rule GCC_ROOT_DIRECTORY=/opt/gcc-4.1.2/installed unknown in module 

我該怎麼辦呢?

回答