http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/builtin.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/builtin.jam b/ext/kenlm/jam-files/boost-build/tools/builtin.jam deleted file mode 100644 index 01c82f1..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/builtin.jam +++ /dev/null @@ -1,974 +0,0 @@ -# Copyright 2002, 2003, 2004, 2005 Dave Abrahams -# Copyright 2002, 2005, 2006, 2007, 2010 Rene Rivera -# Copyright 2006 Juergen Hunold -# Copyright 2005 Toon Knapen -# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Defines standard features and rules. - -import alias ; -import "class" : new ; -import errors ; -import feature ; -import generators ; -import numbers ; -import os ; -import path ; -import print ; -import project ; -import property ; -import regex ; -import scanner ; -import sequence ; -import stage ; -import symlink ; -import toolset ; -import type ; -import targets ; -import types/register ; -import utility ; -import virtual-target ; -import message ; -import convert ; - -# FIXME: the following generate module import is not needed here but removing it -# too hastly will break using code (e.g. the main Boost library Jamroot file) -# that forgot to import the generate module before calling the generate rule. -import generate ; - - -.os-names = aix bsd cygwin darwin freebsd hpux iphone linux netbsd openbsd osf - qnx qnxnto sgi solaris unix unixware windows - elf # Not actually an OS -- used for targeting bare metal where object - # format is ELF. This catches both -elf and -eabi gcc targets and well - # as other compilers targeting ELF. It is not clear how often we need - # the 'elf' key as opposed to other bare metal targets, but let us - # stick with gcc naming. - ; - -# Feature used to determine which OS we're on. New <target-os> and <host-os> -# features should be used instead. -local os = [ modules.peek : OS ] ; -feature.feature os : $(os) : propagated link-incompatible ; - - -# Translates from bjam current OS to the os tags used in host-os and target-os, -# i.e. returns the running host-os. -# -local rule default-host-os ( ) -{ - local host-os ; - if [ os.name ] in $(.os-names:U) - { - host-os = [ os.name ] ; - } - else - { - switch [ os.name ] - { - case NT : host-os = windows ; - case AS400 : host-os = unix ; - case MINGW : host-os = windows ; - case BSDI : host-os = bsd ; - case COHERENT : host-os = unix ; - case DRAGONFLYBSD : host-os = bsd ; - case IRIX : host-os = sgi ; - case MACOSX : host-os = darwin ; - case KFREEBSD : host-os = freebsd ; - case LINUX : host-os = linux ; - case SUNOS : - ECHO "SunOS is not a supported operating system." ; - ECHO "We believe last version of SunOS was released in 1992, " ; - ECHO "so if you get this message, something is very wrong with configuration logic. " ; - ECHO "Please report this as a bug. " ; - EXIT ; - case * : host-os = unix ; - } - } - return $(host-os:L) ; -} - - -# The two OS features define a known set of abstract OS names. The host-os is -# the OS under which bjam is running. Even though this should really be a fixed -# property we need to list all the values to prevent unknown value errors. Both -# set the default value to the current OS to account for the default use case of -# building on the target OS. -feature.feature host-os : $(.os-names) ; -feature.set-default host-os : [ default-host-os ] ; - -feature.feature target-os : $(.os-names) : propagated link-incompatible ; -feature.set-default target-os : [ default-host-os ] ; - - -feature.feature toolset : : implicit propagated symmetric ; -feature.feature stdlib : native : propagated composite ; -feature.feature link : shared static : propagated ; -feature.feature runtime-link : shared static : propagated ; -feature.feature runtime-debugging : on off : propagated ; -feature.feature optimization : off speed space none : propagated ; -feature.feature profiling : off on : propagated ; -feature.feature inlining : off on full : propagated ; -feature.feature threading : single multi : propagated ; -feature.feature rtti : on off : propagated ; -feature.feature exception-handling : on off : propagated ; - -# Whether there is support for asynchronous EH (e.g. catching SEGVs). -feature.feature asynch-exceptions : off on : propagated ; - -# Whether all extern "C" functions are considered nothrow by default. -feature.feature extern-c-nothrow : off on : propagated ; - -feature.feature debug-symbols : on off none : propagated ; -# Controls whether the binary should be stripped -- that is have -# everything not necessary to running removed. This option should -# not be very often needed. Also, this feature will show up in -# target paths of everything, not just binaries. Should fix that -# when impelementing feature relevance. -feature.feature strip : off on : propagated ; -feature.feature define : : free ; -feature.feature undef : : free ; -feature.feature "include" : : free path ; #order-sensitive ; -feature.feature cflags : : free ; -feature.feature cxxflags : : free ; -feature.feature fflags : : free ; -feature.feature asmflags : : free ; -feature.feature linkflags : : free ; -feature.feature archiveflags : : free ; -feature.feature version : : free ; - -# Generic, i.e. non-language specific, flags for tools. -feature.feature flags : : free ; -feature.feature location-prefix : : free ; - - -# The following features are incidental since they have no effect on built -# products. Not making them incidental will result in problems in corner cases, -# e.g.: -# -# unit-test a : a.cpp : <use>b ; -# lib b : a.cpp b ; -# -# Here, if <use> is not incidental, we would decide we have two targets for -# a.obj with different properties and complain about it. -# -# Note that making a feature incidental does not mean it is ignored. It may be -# ignored when creating a virtual target, but the rest of build process will use -# them. -feature.feature use : : free dependency incidental ; -feature.feature dependency : : free dependency incidental ; -feature.feature implicit-dependency : : free dependency incidental ; - -feature.feature warnings : - on # Enable default/"reasonable" warning level for the tool. - all # Enable all possible warnings issued by the tool. - off # Disable all warnings issued by the tool. - : incidental propagated ; - -feature.feature warnings-as-errors : - off # Do not fail the compilation if there are warnings. - on # Fail the compilation if there are warnings. - : incidental propagated ; - -# Feature that allows us to configure the maximal template instantiation depth -# level allowed by a C++ compiler. Applies only to C++ toolsets whose compilers -# actually support this configuration setting. -# -# Note that Boost Build currently does not allow defining features that take any -# positive integral value as a parameter, which is what we need here, so we just -# define some of the values here and leave it up to the user to extend this set -# as he needs using the feature.extend rule. -# -# TODO: This should be upgraded as soon as Boost Build adds support for custom -# validated feature values or at least features allowing any positive integral -# value. See related Boost Build related trac ticket #194. -# -feature.feature c++-template-depth - : - [ numbers.range 64 1024 : 64 ] - [ numbers.range 20 1000 : 10 ] - # Maximum template instantiation depth guaranteed for ANSI/ISO C++ - # conforming programs. - 17 - : - incidental optional propagated ; - -feature.feature source : : free dependency incidental ; -feature.feature library : : free dependency incidental ; -feature.feature file : : free dependency incidental ; -feature.feature find-shared-library : : free ; #order-sensitive ; -feature.feature find-static-library : : free ; #order-sensitive ; -feature.feature library-path : : free path ; #order-sensitive ; - -# Internal feature. -feature.feature library-file : : free dependency ; - -feature.feature name : : free ; -feature.feature tag : : free ; -feature.feature search : : free path ; #order-sensitive ; -feature.feature location : : free path ; -feature.feature dll-path : : free path ; -feature.feature hardcode-dll-paths : true false : incidental ; - - -# An internal feature that holds the paths of all dependency shared libraries. -# On Windows, it is needed so that we can add all those paths to PATH when -# running applications. On Linux, it is needed to add proper -rpath-link command -# line options. -feature.feature xdll-path : : free path ; - -# Provides means to specify def-file for windows DLLs. -feature.feature def-file : : free dependency ; - -feature.feature suppress-import-lib : false true : incidental ; - -# Internal feature used to store the name of a bjam action to call when building -# a target. -feature.feature action : : free ; - -# This feature is used to allow specific generators to run. For example, QT -# tools can only be invoked when QT library is used. In that case, <allow>qt -# will be in usage requirement of the library. -feature.feature allow : : free ; - -# The addressing model to generate code for. Currently a limited set only -# specifying the bit size of pointers. -feature.feature address-model : 16 32 64 32_64 : propagated optional ; - -# Type of CPU architecture to compile for. -feature.feature architecture : - # x86 and x86-64 - x86 - - # ia64 - ia64 - - # Sparc - sparc - - # RS/6000 & PowerPC - power - - # MIPS/SGI - mips1 mips2 mips3 mips4 mips32 mips32r2 mips64 - - # HP/PA-RISC - parisc - - # Advanced RISC Machines - arm - - # Combined architectures for platforms/toolsets that support building for - # multiple architectures at once. "combined" would be the default multi-arch - # for the toolset. - combined - combined-x86-power - - : propagated optional ; - -# The specific instruction set in an architecture to compile. -feature.feature instruction-set : - # x86 and x86-64 - native i486 i586 i686 pentium pentium-mmx pentiumpro pentium2 pentium3 - pentium3m pentium-m pentium4 pentium4m prescott nocona core2 corei7 corei7-avx core-avx-i - conroe conroe-xe conroe-l allendale merom merom-xe kentsfield kentsfield-xe penryn wolfdale - yorksfield nehalem sandy-bridge ivy-bridge haswell k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp - athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 amdfam10 barcelona - bdver1 bdver2 bdver3 btver1 btver2 winchip-c6 winchip2 c3 c3-2 atom - - # ia64 - itanium itanium1 merced itanium2 mckinley - - # Sparc - v7 cypress v8 supersparc sparclite hypersparc sparclite86x f930 f934 - sparclet tsc701 v9 ultrasparc ultrasparc3 - - # RS/6000 & PowerPC - 401 403 405 405fp 440 440fp 505 601 602 603 603e 604 604e 620 630 740 7400 - 7450 750 801 821 823 860 970 8540 power-common ec603e g3 g4 g5 power power2 - power3 power4 power5 powerpc powerpc64 rios rios1 rsc rios2 rs64a - - # MIPS - 4kc 4kp 5kc 20kc m4k r2000 r3000 r3900 r4000 r4100 r4300 r4400 r4600 r4650 - r6000 r8000 rm7000 rm9000 orion sb1 vr4100 vr4111 vr4120 vr4130 vr4300 - vr5000 vr5400 vr5500 - - # HP/PA-RISC - 700 7100 7100lc 7200 7300 8000 - - # Advanced RISC Machines - armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5te armv6 armv6j iwmmxt ep9312 - armv7 armv7s - - : propagated optional ; - -# Used to select a specific variant of C++ ABI if the compiler supports several. -feature.feature c++abi : : propagated optional ; - -feature.feature conditional : : incidental free ; - -# The value of 'no' prevents building of a target. -feature.feature build : yes no : optional ; - -# Windows-specific features - -feature.feature user-interface : console gui wince native auto ; - -feature.feature variant : : implicit composite propagated symmetric ; - - -# Declares a new variant. -# -# First determines explicit properties for this variant, by refining parents' -# explicit properties with the passed explicit properties. The result is -# remembered and will be used if this variant is used as parent. -# -# Second, determines the full property set for this variant by adding to the -# explicit properties default values for all missing non-symmetric properties. -# -# Lastly, makes appropriate value of 'variant' property expand to the full -# property set. -# -rule variant ( name # Name of the variant - : parents-or-properties * # Specifies parent variants, if - # 'explicit-properties' are given, and - # explicit-properties or parents otherwise. - : explicit-properties * # Explicit properties. - ) -{ - local parents ; - if ! $(explicit-properties) - { - if $(parents-or-properties[1]:G) - { - explicit-properties = $(parents-or-properties) ; - } - else - { - parents = $(parents-or-properties) ; - } - } - else - { - parents = $(parents-or-properties) ; - } - - # The problem is that we have to check for conflicts between base variants. - if $(parents[2]) - { - errors.error "multiple base variants are not yet supported" ; - } - - local inherited ; - # Add explicitly specified properties for parents. - for local p in $(parents) - { - # TODO: This check may be made stricter. - if ! [ feature.is-implicit-value $(p) ] - { - errors.error "Invalid base variant" $(p) ; - } - - inherited += $(.explicit-properties.$(p)) ; - } - property.validate $(explicit-properties) ; - explicit-properties = [ property.refine $(inherited) - : $(explicit-properties) ] ; - - # Record explicitly specified properties for this variant. We do this after - # inheriting parents' properties so they affect other variants derived from - # this one. - .explicit-properties.$(name) = $(explicit-properties) ; - - feature.extend variant : $(name) ; - feature.compose <variant>$(name) : $(explicit-properties) ; -} -IMPORT $(__name__) : variant : : variant ; - - -variant debug : <optimization>off <debug-symbols>on <inlining>off - <runtime-debugging>on ; -variant release : <optimization>speed <debug-symbols>off <inlining>full - <runtime-debugging>off <define>NDEBUG ; -variant profile : release : <profiling>on <debug-symbols>on ; - - -class searched-lib-target : abstract-file-target -{ - rule __init__ ( name - : project - : shared ? - : search * - : action - ) - { - abstract-file-target.__init__ $(name) : SEARCHED_LIB : $(project) - : $(action) : ; - - self.shared = $(shared) ; - self.search = $(search) ; - } - - rule shared ( ) - { - return $(self.shared) ; - } - - rule search ( ) - { - return $(self.search) ; - } - - rule actualize-location ( target ) - { - NOTFILE $(target) ; - } - - rule path ( ) - { - } -} - - -# The generator class for libraries (target type LIB). Depending on properties -# it will request building of the appropriate specific library type -- -# -- SHARED_LIB, STATIC_LIB or SHARED_LIB. -# -class lib-generator : generator -{ - rule __init__ ( * : * ) - { - generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) - : $(9) : $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : $(16) : - $(17) : $(18) : $(19) ; - } - - rule run ( project name ? : property-set : sources * ) - { - # The lib generator is composing, and can be only invoked with an - # explicit name. This check is present in generator.run (and so in - # builtin.linking-generator) but duplicated here to avoid doing extra - # work. - if $(name) - { - local properties = [ $(property-set).raw ] ; - # Determine the needed target type. - local actual-type ; - # <source>files can be generated by <conditional>@rule feature - # in which case we do not consider it a SEARCHED_LIB type. - if ! <source> in $(properties:G) && - ( <search> in $(properties:G) || <name> in $(properties:G) ) - { - actual-type = SEARCHED_LIB ; - } - else if <file> in $(properties:G) - { - actual-type = LIB ; - } - else if <link>shared in $(properties) - { - actual-type = SHARED_LIB ; - } - else - { - actual-type = STATIC_LIB ; - } - property-set = [ $(property-set).add-raw <main-target-type>LIB ] ; - # Construct the target. - return [ generators.construct $(project) $(name) : $(actual-type) - : $(property-set) : $(sources) ] ; - } - } - - rule viable-source-types ( ) - { - return * ; - } -} - - -generators.register [ new lib-generator builtin.lib-generator : : LIB ] ; - - -# The implementation of the 'lib' rule. Beyond standard syntax that rule allows -# simplified: "lib a b c ;". -# -rule lib ( names + : sources * : requirements * : default-build * : - usage-requirements * ) -{ - if $(names[2]) - { - if <name> in $(requirements:G) - { - errors.user-error "When several names are given to the 'lib' rule" : - "it is not allowed to specify the <name> feature." ; - } - if $(sources) - { - errors.user-error "When several names are given to the 'lib' rule" : - "it is not allowed to specify sources." ; - } - } - - # This is a circular module dependency so it must be imported here. - import targets ; - - local project = [ project.current ] ; - local result ; - - for local name in $(names) - { - local r = $(requirements) ; - # Support " lib a ; " and " lib a b c ; " syntax. - if ! $(sources) && ! <name> in $(requirements:G) - && ! <file> in $(requirements:G) - { - r += <name>$(name) ; - } - result += [ targets.main-target-alternative - [ new typed-target $(name) : $(project) : LIB - : [ targets.main-target-sources $(sources) : $(name) ] - : [ targets.main-target-requirements $(r) : $(project) ] - : [ targets.main-target-default-build $(default-build) : $(project) ] - : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ] - ] ] ; - } - return $(result) ; -} -IMPORT $(__name__) : lib : : lib ; - - -class searched-lib-generator : generator -{ - import property-set ; - - rule __init__ ( ) - { - # The requirements cause the generators to be tried *only* when we are - # building a lib target with a 'search' feature. This seems ugly --- all - # we want is to make sure searched-lib-generator is not invoked deep - # inside transformation search to produce intermediate targets. - generator.__init__ searched-lib-generator : : SEARCHED_LIB ; - } - - rule run ( project name ? : property-set : sources * ) - { - if $(name) - { - # If 'name' is empty, it means we have not been called to build a - # top-level target. In this case, we just fail immediately, because - # searched-lib-generator cannot be used to produce intermediate - # targets. - - local properties = [ $(property-set).raw ] ; - local shared ; - if <link>shared in $(properties) - { - shared = true ; - } - - local search = [ feature.get-values <search> : $(properties) ] ; - - local a = [ new null-action $(property-set) ] ; - local lib-name = [ feature.get-values <name> : $(properties) ] ; - lib-name ?= $(name) ; - local t = [ new searched-lib-target $(lib-name) : $(project) - : $(shared) : $(search) : $(a) ] ; - # We return sources for a simple reason. If there is - # lib png : z : <name>png ; - # the 'z' target should be returned, so that apps linking to 'png' - # will link to 'z', too. - return [ property-set.create <xdll-path>$(search) ] - [ virtual-target.register $(t) ] $(sources) ; - } - } -} - -generators.register [ new searched-lib-generator ] ; - - -class prebuilt-lib-generator : generator -{ - rule __init__ ( * : * ) - { - generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) - : $(9) : $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : $(16) : - $(17) : $(18) : $(19) ; - } - - rule run ( project name ? : property-set : sources * ) - { - local f = [ $(property-set).get <file> ] ; - return $(f) $(sources) ; - } -} - -generators.register - [ new prebuilt-lib-generator builtin.prebuilt : : LIB : <file> ] ; - -generators.override builtin.prebuilt : builtin.lib-generator ; - -class preprocessed-target-class : basic-target -{ - import generators ; - rule construct ( name : sources * : property-set ) - { - local result = [ generators.construct [ project ] - $(name) : PREPROCESSED_CPP : $(property-set) : $(sources) ] ; - if ! $(result) - { - result = [ generators.construct [ project ] - $(name) : PREPROCESSED_C : $(property-set) : $(sources) ] ; - } - if ! $(result) - { - local s ; - for x in $(sources) - { - s += [ $(x).name ] ; - } - local p = [ project ] ; - errors.user-error - "In project" [ $(p).name ] : - "Could not construct preprocessed file \"$(name)\" from $(s:J=, )." ; - } - return $(result) ; - } -} - -rule preprocessed ( name : sources * : requirements * : default-build * : - usage-requirements * ) -{ - local project = [ project.current ] ; - return [ targets.main-target-alternative - [ new preprocessed-target-class $(name) : $(project) - : [ targets.main-target-sources $(sources) : $(name) ] - : [ targets.main-target-requirements $(requirements) : $(project) ] - : [ targets.main-target-default-build $(default-build) : $(project) ] - : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ] - ] ] ; -} - -IMPORT $(__name__) : preprocessed : : preprocessed ; - -class compile-action : action -{ - import sequence ; - - rule __init__ ( targets * : sources * : action-name : properties * ) - { - action.__init__ $(targets) : $(sources) : $(action-name) : $(properties) ; - } - - # For all virtual targets for the same dependency graph as self, i.e. which - # belong to the same main target, add their directories to the include path. - # - rule adjust-properties ( property-set ) - { - local s = [ $(self.targets[1]).creating-subvariant ] ; - if $(s) - { - return [ $(property-set).add-raw - [ $(s).implicit-includes "include" : H ] ] ; - } - else - { - return $(property-set) ; - } - } -} - - -# Declare a special compiler generator. The only thing it does is changing the -# type used to represent 'action' in the constructed dependency graph to -# 'compile-action'. That class in turn adds additional include paths to handle -# cases when a source file includes headers which are generated themselves. -# -class C-compiling-generator : generator -{ - rule __init__ ( id : source-types + : target-types + : requirements * - : optional-properties * ) - { - generator.__init__ $(id) : $(source-types) : $(target-types) : - $(requirements) : $(optional-properties) ; - } - - rule action-class ( ) - { - return compile-action ; - } -} - - -rule register-c-compiler ( id : source-types + : target-types + : requirements * - : optional-properties * ) -{ - generators.register [ new C-compiling-generator $(id) : $(source-types) : - $(target-types) : $(requirements) : $(optional-properties) ] ; -} - -# FIXME: this is ugly, should find a better way (we would like client code to -# register all generators as "generators.some-rule" instead of -# "some-module.some-rule".) -# -IMPORT $(__name__) : register-c-compiler : : generators.register-c-compiler ; - - -# The generator class for handling EXE and SHARED_LIB creation. -# -class linking-generator : generator -{ - import path ; - import project ; - import property-set ; - import type ; - - rule __init__ ( id - composing ? : # The generator will be composing if a non-empty - # string is passed or the parameter is not given. To - # make the generator non-composing, pass an empty - # string (""). - source-types + : - target-types + : - requirements * ) - { - composing ?= true ; - generator.__init__ $(id) $(composing) : $(source-types) - : $(target-types) : $(requirements) ; - } - - rule run ( project name ? : property-set : sources + ) - { - sources += [ $(property-set).get <library> ] ; - - # Add <library-path> properties for all searched libraries. - local extra ; - for local s in $(sources) - { - if [ $(s).type ] = SEARCHED_LIB - { - local search = [ $(s).search ] ; - extra += <library-path>$(search) ; - } - } - - # It is possible that sources include shared libraries that did not came - # from 'lib' targets, e.g. .so files specified as sources. In this case - # we have to add extra dll-path properties and propagate extra xdll-path - # properties so that application linking to us will get xdll-path to - # those libraries. - local extra-xdll-paths ; - for local s in $(sources) - { - if [ type.is-derived [ $(s).type ] SHARED_LIB ] && ! [ $(s).action ] - { - # Unfortunately, we do not have a good way to find the path to a - # file, so use this nasty approach. - # - # TODO: This needs to be done better. One thing that is really - # broken with this is that it does not work correctly with - # projects having multiple source locations. - local p = [ $(s).project ] ; - local location = [ path.root [ $(s).name ] - [ $(p).get source-location ] ] ; - extra-xdll-paths += [ path.parent $(location) ] ; - } - } - - # Hardcode DLL paths only when linking executables. - # Pros: do not need to relink libraries when installing. - # Cons: "standalone" libraries (plugins, python extensions) can not - # hardcode paths to dependent libraries. - if [ $(property-set).get <hardcode-dll-paths> ] = true - && [ type.is-derived $(self.target-types[1]) EXE ] - { - local xdll-path = [ $(property-set).get <xdll-path> ] ; - extra += <dll-path>$(xdll-path) <dll-path>$(extra-xdll-paths) ; - } - - if $(extra) - { - property-set = [ $(property-set).add-raw $(extra) ] ; - } - - local result = [ generator.run $(project) $(name) : $(property-set) - : $(sources) ] ; - - local ur ; - if $(result) - { - ur = [ extra-usage-requirements $(result) : $(property-set) ] ; - ur = [ $(ur).add - [ property-set.create <xdll-path>$(extra-xdll-paths) ] ] ; - } - return $(ur) $(result) ; - } - - rule extra-usage-requirements ( created-targets * : property-set ) - { - local result = [ property-set.empty ] ; - local extra ; - - # Add appropricate <xdll-path> usage requirements. - local raw = [ $(property-set).raw ] ; - if <link>shared in $(raw) - { - local paths ; - local pwd = [ path.pwd ] ; - for local t in $(created-targets) - { - if [ type.is-derived [ $(t).type ] SHARED_LIB ] - { - paths += [ path.root [ path.make [ $(t).path ] ] $(pwd) ] ; - } - } - extra += $(paths:G=<xdll-path>) ; - } - - # We need to pass <xdll-path> features that we've got from sources, - # because if a shared library is built, exe using it needs to know paths - # to other shared libraries this one depends on in order to be able to - # find them all at runtime. - - # Just pass all features in property-set, it is theorically possible - # that we will propagate <xdll-path> features explicitly specified by - # the user, but then the user is to blaim for using an internal feature. - local values = [ $(property-set).get <xdll-path> ] ; - extra += $(values:G=<xdll-path>) ; - - if $(extra) - { - result = [ property-set.create $(extra) ] ; - } - return $(result) ; - } - - rule generated-targets ( sources + : property-set : project name ? ) - { - local sources2 ; # Sources to pass to inherited rule. - local properties2 ; # Properties to pass to inherited rule. - local libraries ; # Library sources. - - # Searched libraries are not passed as arguments to the linker but via - # some option. So, we pass them to the action using a property. - properties2 = [ $(property-set).raw ] ; - local fsa ; - local fst ; - for local s in $(sources) - { - if [ type.is-derived [ $(s).type ] SEARCHED_LIB ] - { - local name = [ $(s).name ] ; - if [ $(s).shared ] - { - fsa += $(name) ; - } - else - { - fst += $(name) ; - } - } - else - { - sources2 += $(s) ; - } - } - properties2 += <find-shared-library>$(fsa:J=&&) - <find-static-library>$(fst:J=&&) ; - - return [ generator.generated-targets $(sources2) - : [ property-set.create $(properties2) ] : $(project) $(name) ] ; - } -} - - -rule register-linker ( id composing ? : source-types + : target-types + - : requirements * ) -{ - generators.register [ new linking-generator $(id) $(composing) - : $(source-types) : $(target-types) : $(requirements) ] ; -} - - -# The generator class for handling STATIC_LIB creation. -# -class archive-generator : generator -{ - import property-set ; - - rule __init__ ( id composing ? : source-types + : target-types + - : requirements * ) - { - composing ?= true ; - generator.__init__ $(id) $(composing) : $(source-types) - : $(target-types) : $(requirements) ; - } - - rule run ( project name ? : property-set : sources + ) - { - sources += [ $(property-set).get <library> ] ; - - local result = [ generator.run $(project) $(name) : $(property-set) - : $(sources) ] ; - - # For static linking, if we get a library in source, we can not directly - # link to it so we need to cause our dependencies to link to that - # library. There are two approaches: - # - adding the library to the list of returned targets. - # - using the <library> usage requirements. - # The problem with the first is: - # - # lib a1 : : <file>liba1.a ; - # lib a2 : a2.cpp a1 : <link>static ; - # install dist : a2 ; - # - # here we will try to install 'a1', even though it is not necessary in - # the general case. With the second approach, even indirect dependants - # will link to the library, but it should not cause any harm. So, return - # all LIB sources together with created targets, so that dependants link - # to them. - local usage-requirements ; - if [ $(property-set).get <link> ] = static - { - for local t in $(sources) - { - if [ type.is-derived [ $(t).type ] LIB ] - { - usage-requirements += <library>$(t) ; - } - } - } - - usage-requirements = [ property-set.create $(usage-requirements) ] ; - - return $(usage-requirements) $(result) ; - } -} - - -rule register-archiver ( id composing ? : source-types + : target-types + - : requirements * ) -{ - generators.register [ new archive-generator $(id) $(composing) - : $(source-types) : $(target-types) : $(requirements) ] ; -} - - -# Generator that accepts everything and produces nothing. Useful as a general -# fallback for toolset-specific actions like PCH generation. -# -class dummy-generator : generator -{ - import property-set ; - - rule run ( project name ? : property-set : sources + ) - { - return [ property-set.empty ] ; - } -} - -IMPORT $(__name__) : register-linker register-archiver - : : generators.register-linker generators.register-archiver ;
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/cast.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/cast.jam b/ext/kenlm/jam-files/boost-build/tools/cast.jam deleted file mode 100644 index 41b0ac3..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/cast.jam +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2005 Vladimir Prus. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# Defines main target 'cast', used to change type for target. For example, in Qt -# library one wants two kinds of CPP files -- those that just compiled and those -# that are passed via the MOC tool. -# -# This is done with: -# -# exe main : main.cpp [ cast _ moccable-cpp : widget.cpp ] ; -# -# Boost.Build will assign target type CPP to both main.cpp and widget.cpp. Then, -# the cast rule will change target type of widget.cpp to MOCCABLE-CPP, and Qt -# support will run the MOC tool as part of the build process. -# -# At the moment, the 'cast' rule only works for non-derived (source) targets. -# -# TODO: The following comment is unclear or incorrect. Clean it up. -# > Another solution would be to add a separate main target 'moc-them' that -# > would moc all the passed sources, no matter what their type is, but I prefer -# > cast, as defining a new target type + generator for that type is somewhat -# > simpler than defining a main target rule. - -import "class" : new ; -import project ; -import property-set ; -import targets ; -import type ; - - -class cast-target-class : typed-target -{ - import type ; - - rule __init__ ( name : project : type : sources * : requirements * : - default-build * : usage-requirements * ) - { - typed-target.__init__ $(name) : $(project) : $(type) : $(sources) : - $(requirements) : $(default-build) : $(usage-requirements) ; - } - - rule construct ( name : source-targets * : property-set ) - { - local result ; - for local s in $(source-targets) - { - if ! [ class.is-a $(s) : file-target ] - { - import errors : user-error : errors.user-error ; - errors.user-error Source to the 'cast' rule is not a file! ; - } - if [ $(s).action ] - { - import errors : user-error : errors.user-error ; - errors.user-error Only non-derived target are allowed for - 'cast'. : when building [ full-name ] ; - } - local r = [ $(s).clone-with-different-type $(self.type) ] ; - result += [ virtual-target.register $(r) ] ; - } - return [ property-set.empty ] $(result) ; - } -} - - -rule cast ( name type : sources * : requirements * : default-build * : - usage-requirements * ) -{ - local project = [ project.current ] ; - - local real-type = [ type.type-from-rule-name $(type) ] ; - if ! $(real-type) - { - import errors ; - errors.user-error No type corresponds to the main target rule name - '$(type)' : "Hint: try a lowercase name" ; - } - - targets.main-target-alternative [ new cast-target-class $(name) : $(project) - : $(real-type) - : [ targets.main-target-sources $(sources) : $(name) ] - : [ targets.main-target-requirements $(requirements) : $(project) ] - : [ targets.main-target-default-build $(default-build) : $(project) ] - : [ targets.main-target-usage-requirements $(usage-requirements) : - $(project) ] ] ; -} - - -IMPORT $(__name__) : cast : : cast ; http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/clang-darwin.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/clang-darwin.jam b/ext/kenlm/jam-files/boost-build/tools/clang-darwin.jam deleted file mode 100644 index a8abc7d..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/clang-darwin.jam +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright Vladimir Prus 2004. -# Copyright Noel Belcourt 2007. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt -# or copy at http://www.boost.org/LICENSE_1_0.txt) - -import clang ; -import feature : feature ; -import os ; -import toolset ; -import toolset : flags ; -import gcc ; -import common ; -import errors ; -import generators ; - -feature.extend-subfeature toolset clang : platform : darwin ; - -toolset.inherit-generators clang-darwin - <toolset>clang <toolset-clang:platform>darwin - : gcc - # Don't inherit PCH generators. They were not tested, and probably - # don't work for this compiler. - : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch - ; - -generators.override clang-darwin.prebuilt : builtin.lib-generator ; -generators.override clang-darwin.prebuilt : builtin.prebuilt ; -generators.override clang-darwin.searched-lib-generator : searched-lib-generator ; - -toolset.inherit-rules clang-darwin : gcc ; -toolset.inherit-flags clang-darwin : gcc - : <inlining>off <inlining>on <inlining>full <optimization>space - <warnings>off <warnings>all <warnings>on - <architecture>x86/<address-model>32 - <architecture>x86/<address-model>64 - ; - -if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] -{ - .debug-configuration = true ; -} - -# vectorization diagnostics -feature vectorize : off on full ; - -# Initializes the clang-darwin toolset -# version in optional -# name (default clang++) is used to invoke the specified clang complier -# compile and link options allow you to specify addition command line options for each version -rule init ( version ? : command * : options * ) -{ - command = [ common.get-invocation-command clang-darwin : clang++ - : $(command) ] ; - - # Determine the version - local command-string = $(command:J=" ") ; - if $(command) - { - version ?= [ MATCH "^([0-9.]+)" - : [ SHELL "$(command-string) -dumpversion" ] ] ; - } - - local condition = [ common.check-init-parameters clang-darwin - : version $(version) ] ; - - common.handle-options clang-darwin : $(condition) : $(command) : $(options) ; - - gcc.init-link-flags clang-darwin darwin $(condition) ; - -} - -SPACE = " " ; - -flags clang-darwin.compile OPTIONS <cflags> ; -flags clang-darwin.compile OPTIONS <cxxflags> ; -# flags clang-darwin.compile INCLUDES <include> ; - -# Declare flags and action for compilation. -toolset.flags clang-darwin.compile OPTIONS <optimization>off : -O0 ; -toolset.flags clang-darwin.compile OPTIONS <optimization>speed : -O3 ; -toolset.flags clang-darwin.compile OPTIONS <optimization>space : -Os ; - -toolset.flags clang-darwin.compile OPTIONS <inlining>off : -fno-inline ; -toolset.flags clang-darwin.compile OPTIONS <inlining>on : -Wno-inline ; -toolset.flags clang-darwin.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ; - -toolset.flags clang-darwin.compile OPTIONS <warnings>off : -w ; -toolset.flags clang-darwin.compile OPTIONS <warnings>on : -Wall ; -toolset.flags clang-darwin.compile OPTIONS <warnings>all : -Wall -pedantic ; -toolset.flags clang-darwin.compile OPTIONS <warnings-as-errors>on : -Werror ; - -toolset.flags clang-darwin.compile OPTIONS <debug-symbols>on : -g ; -toolset.flags clang-darwin.compile OPTIONS <profiling>on : -pg ; -toolset.flags clang-darwin.compile OPTIONS <rtti>off : -fno-rtti ; - -actions compile.c -{ - "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" -} - -actions compile.c++ -{ - "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" -} - -flags clang-darwin ARFLAGS <archiveflags> ; - -# Default value. Mostly for the sake of clang-linux -# that inherits from gcc, but does not has the same -# logic to set the .AR variable. We can put the same -# logic in clang-linux, but that's hardly worth the trouble -# as on Linux, 'ar' is always available. -.AR = ar ; - -rule archive ( targets * : sources * : properties * ) -{ - # Always remove archive and start again. Here's 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 the building - # of 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) ; -} - -actions piecemeal archive -{ - "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)" - "ranlib" -cs "$(<)" -} - -flags clang-darwin.link USER_OPTIONS <linkflags> ; - -# Declare actions for linking -rule link ( targets * : sources * : properties * ) -{ - SPACE on $(targets) = " " ; - # Serialize execution of the 'link' action, since - # running N links in parallel is just slower. - JAM_SEMAPHORE on $(targets) = <s>clang-darwin-link-semaphore ; -} - -actions link bind LIBRARIES -{ - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) -} - -actions link.dll bind LIBRARIES -{ - "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) -} http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/clang-linux.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/clang-linux.jam b/ext/kenlm/jam-files/boost-build/tools/clang-linux.jam deleted file mode 100644 index 2999c2d..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/clang-linux.jam +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright (c) 2003 Michael Stevens -# Copyright (c) 2010-2011 Bryce Lelbach ([email protected], maintainer) -# -# 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 toolset ; -import feature ; -import toolset : flags ; - -import clang ; -import gcc ; -import common ; -import errors ; -import generators ; -import type ; -import numbers ; - -feature.extend-subfeature toolset clang : platform : linux ; - -toolset.inherit-generators clang-linux - <toolset>clang <toolset-clang:platform>linux : gcc - : gcc.mingw.link gcc.mingw.link.dll gcc.cygwin.link gcc.cygwin.link.dll ; -generators.override clang-linux.prebuilt : builtin.lib-generator ; -generators.override clang-linux.prebuilt : builtin.prebuilt ; -generators.override clang-linux.searched-lib-generator : searched-lib-generator ; - -# Override default do-nothing generators. -generators.override clang-linux.compile.c.pch : pch.default-c-pch-generator ; -generators.override clang-linux.compile.c++.pch : pch.default-cpp-pch-generator ; - -type.set-generated-target-suffix PCH - : <toolset>clang <toolset-clang:platform>linux : pth ; - -toolset.inherit-rules clang-linux : gcc ; -toolset.inherit-flags clang-linux : gcc - : <inlining>off <inlining>on <inlining>full - <optimization>space <optimization>speed - <warnings>off <warnings>all <warnings>on ; - -if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { - .debug-configuration = true ; -} - -rule init ( version ? : command * : options * ) { - command = [ common.get-invocation-command clang-linux : clang++ - : $(command) ] ; - - # Determine the version - local command-string = $(command:J=" ") ; - - if $(command) { - version ?= [ MATCH "version ([0-9.]+)" - : [ SHELL "$(command-string) --version" ] ] ; - } - - local condition = [ common.check-init-parameters clang-linux - : version $(version) ] ; - - common.handle-options clang-linux : $(condition) : $(command) : $(options) ; - - gcc.init-link-flags clang-linux gnu $(condition) ; -} - -############################################################################### -# Flags - -toolset.flags clang-linux.compile OPTIONS <cflags> ; -toolset.flags clang-linux.compile.c++ OPTIONS <cxxflags> ; - -toolset.flags clang-linux.compile OPTIONS <optimization>off : ; -toolset.flags clang-linux.compile OPTIONS <optimization>speed : -O3 ; -toolset.flags clang-linux.compile OPTIONS <optimization>space : -Os ; - -# note: clang silently ignores some of these inlining options -toolset.flags clang-linux.compile OPTIONS <inlining>off : -fno-inline ; -toolset.flags clang-linux.compile OPTIONS <inlining>on : -Wno-inline ; -toolset.flags clang-linux.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ; - -toolset.flags clang-linux.compile OPTIONS <warnings>off : -w ; -toolset.flags clang-linux.compile OPTIONS <warnings>on : -Wall ; -toolset.flags clang-linux.compile OPTIONS <warnings>all : -Wall -pedantic ; -toolset.flags clang-linux.compile OPTIONS <warnings-as-errors>on : -Werror ; - -toolset.flags clang-linux.compile OPTIONS <debug-symbols>on : -g ; -toolset.flags clang-linux.compile OPTIONS <profiling>on : -pg ; -toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ; - -############################################################################### -# C and C++ compilation - -rule compile.c++ ( targets * : sources * : properties * ) { - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-fpic $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; - - local pth-file = [ on $(<) return $(PCH_FILE) ] ; - - if $(pth-file) { - DEPENDS $(<) : $(pth-file) ; - clang-linux.compile.c++.with-pch $(targets) : $(sources) ; - } - else { - clang-linux.compile.c++.without-pth $(targets) : $(sources) ; - } -} - -actions compile.c++.without-pth { - "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)" -} - -actions compile.c++.with-pch bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -o "$(<)" "$(>)" -} - -rule compile.c ( targets * : sources * : properties * ) -{ - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-fpic $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; - - local pth-file = [ on $(<) return $(PCH_FILE) ] ; - - if $(pth-file) { - DEPENDS $(<) : $(pth-file) ; - clang-linux.compile.c.with-pch $(targets) : $(sources) ; - } - else { - clang-linux.compile.c.without-pth $(targets) : $(sources) ; - } -} - -actions compile.c.without-pth -{ - "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" -} - -actions compile.c.with-pch bind PCH_FILE -{ - "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -c -o "$(<)" "$(>)" -} - -############################################################################### -# PCH emission - -rule compile.c++.pch ( targets * : sources * : properties * ) { - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-fpic $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; -} - -actions compile.c++.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" -} - -rule compile.c.pch ( targets * : sources * : properties * ) { - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-fpic $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; -} - -actions compile.c.pch -{ - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)" -} - -############################################################################### -# Linking - -SPACE = " " ; - -rule link ( targets * : sources * : properties * ) { - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; - SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ; -} - -actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) -} - -rule link.dll ( targets * : sources * : properties * ) { - gcc.setup-threading $(targets) : $(sources) : $(properties) ; - gcc.setup-address-model $(targets) : $(sources) : $(properties) ; - SPACE on $(targets) = " " ; - JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ; -} - -# Differ from 'link' above only by -shared. -actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) -} - http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/clang.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/clang.jam b/ext/kenlm/jam-files/boost-build/tools/clang.jam deleted file mode 100644 index e0ac9a5..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/clang.jam +++ /dev/null @@ -1,27 +0,0 @@ -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt -# or copy at http://www.boost.org/LICENSE_1_0.txt) - -# This is a generic 'clang' toolset. Depending on the current system, it -# forwards either to 'clang-unix' or 'clang-darwin' modules. - -import feature ; -import os ; -import toolset ; - -feature.extend toolset : clang ; -feature.subfeature toolset clang : platform : : propagated link-incompatible ; - -rule init ( * : * ) -{ - if [ os.name ] = MACOSX - { - toolset.using clang-darwin : - $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; - } - else - { - toolset.using clang-linux : - $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; - } -} http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/common.jam ---------------------------------------------------------------------- diff --git a/ext/kenlm b/ext/kenlm new file mode 160000 index 0000000..56fdb5c --- /dev/null +++ b/ext/kenlm @@ -0,0 +1 @@ +Subproject commit 56fdb5c44fca34d5a2e07d96139c28fb163983c5 diff --git a/ext/kenlm/jam-files/boost-build/tools/common.jam b/ext/kenlm/jam-files/boost-build/tools/common.jam deleted file mode 100644 index 08df2d9..0000000 --- a/ext/kenlm/jam-files/boost-build/tools/common.jam +++ /dev/null @@ -1,988 +0,0 @@ -# Copyright 2003, 2005 Dave Abrahams -# Copyright 2005, 2006 Rene Rivera -# Copyright 2005 Toon Knapen -# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus -# 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) - -# Provides actions common to all toolsets, such as creating directories and -# removing files. - -import os ; -import modules ; -import utility ; -import print ; -import type ; -import feature ; -import errors ; -import path ; -import sequence ; -import toolset ; -import virtual-target ; - -if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] -{ - .debug-configuration = true ; -} -if [ MATCH (--show-configuration) : [ modules.peek : ARGV ] ] -{ - .show-configuration = true ; -} - -# Configurations -# -# The following class helps to manage toolset configurations. Each configuration -# has a unique ID and one or more parameters. A typical example of a unique ID -# is a condition generated by 'common.check-init-parameters' rule. Other kinds -# of IDs can be used. Parameters may include any details about the configuration -# like 'command', 'path', etc. -# -# A toolset configuration may be in one of the following states: -# -# - registered -# Configuration has been registered (e.g. explicitly or by auto-detection -# code) but has not yet been marked as used, i.e. 'toolset.using' rule has -# not yet been called for it. -# - used -# Once called 'toolset.using' rule marks the configuration as 'used'. -# -# The main difference between the states above is that while a configuration is -# 'registered' its options can be freely changed. This is useful in particular -# for autodetection code - all detected configurations may be safely overwritten -# by user code. - -class configurations -{ - import errors ; - - rule __init__ ( ) - { - } - - # Registers a configuration. - # - # Returns 'true' if the configuration has been added and an empty value if - # it already exists. Reports an error if the configuration is 'used'. - # - rule register ( id ) - { - if $(id) in $(self.used) - { - errors.error "common: the configuration '$(id)' is in use" ; - } - - local retval ; - - if ! $(id) in $(self.all) - { - self.all += $(id) ; - - # Indicate that a new configuration has been added. - retval = true ; - } - - return $(retval) ; - } - - # Mark a configuration as 'used'. - # - # Returns 'true' if the state of the configuration has been changed to - # 'used' and an empty value if it the state has not been changed. Reports an - # error if the configuration is not known. - # - rule use ( id ) - { - if ! $(id) in $(self.all) - { - errors.error "common: the configuration '$(id)' is not known" ; - } - - local retval ; - - if ! $(id) in $(self.used) - { - self.used += $(id) ; - - # Indicate that the configuration has been marked as 'used'. - retval = true ; - } - - return $(retval) ; - } - - # Return all registered configurations. - # - rule all ( ) - { - return $(self.all) ; - } - - # Return all used configurations. - # - rule used ( ) - { - return $(self.used) ; - } - - # Returns the value of a configuration parameter. - # - rule get ( id : param ) - { - return $(self.$(param).$(id)) ; - } - - # Sets the value of a configuration parameter. - # - rule set ( id : param : value * ) - { - self.$(param).$(id) = $(value) ; - } -} - - -# The rule for checking toolset parameters. Trailing parameters should all be -# parameter name/value pairs. The rule will check that each parameter either has -# a value in each invocation or has no value in each invocation. Also, the rule -# will check that the combination of all parameter values is unique in all -# invocations. -# -# Each parameter name corresponds to a subfeature. This rule will declare a -# subfeature the first time a non-empty parameter value is passed and will -# extend it with all the values. -# -# The return value from this rule is a condition to be used for flags settings. -# -rule check-init-parameters ( toolset requirement * : * ) -{ - local sig = $(toolset) ; - local condition = <toolset>$(toolset) ; - local subcondition ; - for local index in 2 3 4 5 6 7 8 9 - { - local name = $($(index)[1]) ; - local value = $($(index)[2]) ; - - if $(value)-is-not-empty - { - condition = $(condition)-$(value) ; - if $(.had-unspecified-value.$(toolset).$(name)) - { - errors.user-error - "$(toolset) initialization: parameter '$(name)'" - "inconsistent" : "no value was specified in earlier" - "initialization" : "an explicit value is specified now" ; - } - # The below logic is for intel compiler. It calls this rule with - # 'intel-linux' and 'intel-win' as toolset, so we need to get the - # base part of toolset name. We can not pass 'intel' as toolset - # because in that case it will be impossible to register versionless - # intel-linux and intel-win toolsets of a specific version. - local t = $(toolset) ; - local m = [ MATCH ([^-]*)- : $(toolset) ] ; - if $(m) - { - t = $(m[1]) ; - } - if ! $(.had-value.$(toolset).$(name)) - { - if ! $(.declared-subfeature.$(t).$(name)) - { - feature.subfeature toolset $(t) : $(name) : : propagated ; - .declared-subfeature.$(t).$(name) = true ; - } - .had-value.$(toolset).$(name) = true ; - } - feature.extend-subfeature toolset $(t) : $(name) : $(value) ; - subcondition += <toolset-$(t):$(name)>$(value) ; - } - else - { - if $(.had-value.$(toolset).$(name)) - { - errors.user-error - "$(toolset) initialization: parameter '$(name)'" - "inconsistent" : "an explicit value was specified in an" - "earlier initialization" : "no value is specified now" ; - } - .had-unspecified-value.$(toolset).$(name) = true ; - } - sig = $(sig)$(value:E="")- ; - } - if $(sig) in $(.all-signatures) - { - local message = - "duplicate initialization of $(toolset) with the following parameters: " ; - for local index in 2 3 4 5 6 7 8 9 - { - local p = $($(index)) ; - if $(p) - { - message += "$(p[1]) = $(p[2]:E=<unspecified>)" ; - } - } - message += "previous initialization at $(.init-loc.$(sig))" ; - errors.user-error - $(message[1]) : $(message[2]) : $(message[3]) : $(message[4]) : - $(message[5]) : $(message[6]) : $(message[7]) : $(message[8]) ; - } - .all-signatures += $(sig) ; - .init-loc.$(sig) = [ errors.nearest-user-location ] ; - - # If we have a requirement, this version should only be applied under that - # condition. To accomplish this we add a toolset requirement that imposes - # the toolset subcondition, which encodes the version. - if $(requirement) - { - local r = <toolset>$(toolset) $(requirement) ; - r = $(r:J=,) ; - toolset.add-requirements $(r):$(subcondition) ; - } - - # We add the requirements, if any, to the condition to scope the toolset - # variables and options to this specific version. - condition += $(requirement) ; - - if $(.show-configuration) - { - ECHO notice: $(condition) ; - } - return $(condition:J=/) ; -} - - -# A helper rule to get the command to invoke some tool. If -# 'user-provided-command' is not given, tries to find binary named 'tool' in -# PATH and in the passed 'additional-path'. Otherwise, verifies that the first -# element of 'user-provided-command' is an existing program. -# -# This rule returns the command to be used when invoking the tool. If we can not -# find the tool, a warning is issued. If 'path-last' is specified, PATH is -# checked after 'additional-paths' when searching for 'tool'. -# -rule get-invocation-command-nodefault ( toolset : tool : - user-provided-command * : additional-paths * : path-last ? ) -{ - local command ; - if ! $(user-provided-command) - { - command = [ find-tool $(tool) : $(additional-paths) : $(path-last) ] ; - if ! $(command) && $(.debug-configuration) - { - ECHO warning: toolset $(toolset) initialization: can not find tool - $(tool) ; - ECHO warning: initialized from [ errors.nearest-user-location ] ; - } - } - else - { - command = [ check-tool $(user-provided-command) ] ; - if ! $(command) && $(.debug-configuration) - { - ECHO warning: toolset $(toolset) initialization: ; - ECHO warning: can not find user-provided command - '$(user-provided-command)' ; - ECHO warning: initialized from [ errors.nearest-user-location ] ; - } - } - - return $(command) ; -} - - -# Same as get-invocation-command-nodefault, except that if no tool is found, -# returns either the user-provided-command, if present, or the 'tool' parameter. -# -rule get-invocation-command ( toolset : tool : user-provided-command * : - additional-paths * : path-last ? ) -{ - local result = [ get-invocation-command-nodefault $(toolset) : $(tool) : - $(user-provided-command) : $(additional-paths) : $(path-last) ] ; - - if ! $(result) - { - if $(user-provided-command) - { - result = $(user-provided-command) ; - } - else - { - result = $(tool) ; - } - } - return $(result) ; -} - - -# Given an invocation command return the absolute path to the command. This -# works even if command has no path element and was found on the PATH. -# -rule get-absolute-tool-path ( command ) -{ - if $(command:D) - { - return $(command:D) ; - } - else - { - local m = [ GLOB [ modules.peek : PATH Path path ] : $(command) - $(command).exe ] ; - return $(m[1]:D) ; - } -} - - -# Attempts to find tool (binary) named 'name' in PATH and in 'additional-paths'. -# If found in PATH, returns 'name' and if found in additional paths, returns -# absolute name. If the tool is found in several directories, returns the first -# path found. Otherwise, returns an empty string. If 'path-last' is specified, -# PATH is searched after 'additional-paths'. -# -rule find-tool ( name : additional-paths * : path-last ? ) -{ - local path = [ path.programs-path ] ; - local match = [ path.glob $(path) : $(name) $(name).exe ] ; - local additional-match = [ path.glob $(additional-paths) : $(name) - $(name).exe ] ; - - local result ; - if $(path-last) - { - result = $(additional-match) ; - if ! $(result) && $(match) - { - result = $(name) ; - } - } - else - { - if $(match) - { - result = $(name) ; - } - else - { - result = $(additional-match) ; - } - } - if $(result) - { - return [ path.native $(result[1]) ] ; - } -} - -# Checks if 'command' can be found either in path or is a full name to an -# existing file. -# -local rule check-tool-aux ( command ) -{ - if $(command:D) - { - if [ path.exists $(command) ] - # Both NT and Cygwin will run .exe files by their unqualified names. - || ( [ os.on-windows ] && [ path.exists $(command).exe ] ) - # Only NT will run .bat & .cmd files by their unqualified names. - || ( ( [ os.name ] = NT ) && ( [ path.exists $(command).bat ] || - [ path.exists $(command).cmd ] ) ) - { - return $(command) ; - } - } - else - { - if [ GLOB [ modules.peek : PATH Path path ] : $(command) ] - { - return $(command) ; - } - } -} - - -# Checks that a tool can be invoked by 'command'. If command is not an absolute -# path, checks if it can be found in 'path'. If comand is an absolute path, -# check that it exists. Returns 'command' if ok or empty string otherwise. -# -local rule check-tool ( xcommand + ) -{ - if [ check-tool-aux $(xcommand[1]) ] || - [ check-tool-aux $(xcommand[-1]) ] - { - return $(xcommand) ; - } -} - - -# Handle common options for toolset, specifically sets the following flag -# variables: -# - CONFIG_COMMAND to $(command) -# - OPTIONS for compile to the value of <compileflags> in $(options) -# - OPTIONS for compile.c to the value of <cflags> in $(options) -# - OPTIONS for compile.c++ to the value of <cxxflags> in $(options) -# - OPTIONS for compile.fortran to the value of <fflags> in $(options) -# - OPTIONS for link to the value of <linkflags> in $(options) -# -rule handle-options ( toolset : condition * : command * : options * ) -{ - if $(.debug-configuration) - { - ECHO notice: will use '$(command)' for $(toolset), condition - $(condition:E=(empty)) ; - } - - # The last parameter ('unchecked') says it is OK to set flags for another - # module. - toolset.flags $(toolset) CONFIG_COMMAND $(condition) : $(command) - : unchecked ; - - toolset.flags $(toolset).compile OPTIONS $(condition) : - [ feature.get-values <compileflags> : $(options) ] : unchecked ; - - toolset.flags $(toolset).compile.c OPTIONS $(condition) : - [ feature.get-values <cflags> : $(options) ] : unchecked ; - - toolset.flags $(toolset).compile.c++ OPTIONS $(condition) : - [ feature.get-values <cxxflags> : $(options) ] : unchecked ; - - toolset.flags $(toolset).compile.fortran OPTIONS $(condition) : - [ feature.get-values <fflags> : $(options) ] : unchecked ; - - toolset.flags $(toolset).link OPTIONS $(condition) : - [ feature.get-values <linkflags> : $(options) ] : unchecked ; -} - - -# Returns the location of the "program files" directory on a Windows platform. -# -rule get-program-files-dir ( ) -{ - local ProgramFiles = [ modules.peek : ProgramFiles ] ; - if $(ProgramFiles) - { - ProgramFiles = "$(ProgramFiles:J= )" ; - } - else - { - ProgramFiles = "c:\\Program Files" ; - } - return $(ProgramFiles) ; -} - - -if [ os.name ] = NT -{ - RM = del /f /q ; - CP = copy /b ; - IGNORE = "2>nul >nul & setlocal" ; - LN ?= $(CP) ; - # Ugly hack to convince copy to set the timestamp of the destination to the - # current time by concatenating the source with a nonexistent file. Note - # that this requires /b (binary) as the default when concatenating files is - # /a (ascii). - WINDOWS-CP-HACK = "+ this-file-does-not-exist-A698EE7806899E69" ; -} -else -{ - RM = rm -f ; - CP = cp ; - LN = ln ; -} - - -rule rm-command ( ) -{ - return $(RM) ; -} - - -rule copy-command ( ) -{ - return $(CP) ; -} - - -if "\n" = "n" -{ - # Escape characters not supported so use ugly hacks. Will not work on Cygwin - # - see below. - nl = " -" ; - q = "" ; -} -else -{ - nl = "\n" ; - q = "\"" ; -} - -# Returns the command needed to set an environment variable on the current -# platform. The variable setting persists through all following commands and is -# visible in the environment seen by subsequently executed commands. In other -# words, on Unix systems, the variable is exported, which is consistent with the -# only possible behavior on Windows systems. -# -rule variable-setting-command ( variable : value ) -{ - if [ os.name ] = NT - { - return "set $(variable)=$(value)$(nl)" ; - } - else - { - # If we do not have escape character support in bjam, the cod below - # blows up on CYGWIN, since the $(nl) variable holds a Windows new-line - # \r\n sequence that messes up the executed export command which then - # reports that the passed variable name is incorrect. - # But we have a check for cygwin in kernel/bootstrap.jam already. - return "$(variable)=$(q)$(value)$(q)$(nl)export $(variable)$(nl)" ; - } -} - - -# Returns a command to sets a named shell path variable to the given NATIVE -# paths on the current platform. -# -rule path-variable-setting-command ( variable : paths * ) -{ - local sep = [ os.path-separator ] ; - return [ variable-setting-command $(variable) : $(paths:J=$(sep)) ] ; -} - - -# Returns a command that prepends the given paths to the named path variable on -# the current platform. -# -rule prepend-path-variable-command ( variable : paths * ) -{ - return [ path-variable-setting-command $(variable) - : $(paths) [ os.expand-variable $(variable) ] ] ; -} - - -# Return a command which can create a file. If 'r' is result of invocation, then -# 'r foobar' will create foobar with unspecified content. What happens if file -# already exists is unspecified. -# -rule file-creation-command ( ) -{ - if [ os.name ] = NT - { - # A few alternative implementations on Windows: - # - # 'type NUL >> ' - # That would construct an empty file instead of a file containing - # a space and an end-of-line marker but it would also not change - # the target's timestamp in case the file already exists. - # - # 'type NUL > ' - # That would construct an empty file instead of a file containing - # a space and an end-of-line marker but it would also destroy an - # already existing file by overwriting it with an empty one. - # - # I guess the best solution would be to allow Boost Jam to define - # built-in functions such as 'create a file', 'touch a file' or 'copy a - # file' which could be used from inside action code. That would allow - # completely portable operations without this kind of kludge. - # (22.02.2009.) (Jurko) - return "echo. > " ; - } - else - { - return "touch " ; - } -} - - -# Returns a command that may be used for 'touching' files. It is not a real -# 'touch' command on NT because it adds an empty line at the end of file but it -# works with source files. -# -rule file-touch-command ( ) -{ - if [ os.name ] = NT - { - return "echo. >> " ; - } - else - { - return "touch " ; - } -} - - -rule MkDir -{ - # If dir exists, do not update it. Do this even for $(DOT). - NOUPDATE $(<) ; - - if $(<) != $(DOT) && ! $($(<)-mkdir) - { - # Cheesy gate to prevent multiple invocations on same dir. - $(<)-mkdir = true ; - - # Schedule the mkdir build action. - common.mkdir $(<) ; - - # Prepare a Jam 'dirs' target that can be used to make the build only - # construct all the target directories. - DEPENDS dirs : $(<) ; - - # Recursively create parent directories. $(<:P) = $(<)'s parent & we - # recurse until root. - - local s = $(<:P) ; - if [ os.name ] = NT - { - switch $(s) - { - case *: : s = ; - case *:\\ : s = ; - } - } - - if $(s) - { - if $(s) != $(<) - { - DEPENDS $(<) : $(s) ; - MkDir $(s) ; - } - else - { - NOTFILE $(s) ; - } - } - } -} - - -#actions MkDir1 -#{ -# mkdir "$(<)" -#} - -# The following quick-fix actions should be replaced using the original MkDir1 -# action once Boost Jam gets updated to correctly detect different paths leading -# up to the same filesystem target and triggers their build action only once. -# (todo) (04.07.2008.) (Jurko) - -if [ os.name ] = NT -{ - actions mkdir - { - if not exist "$(<)\\" mkdir "$(<)" - } -} -else -{ - actions mkdir - { - mkdir -p "$(<)" - } -} - -actions piecemeal together existing Clean -{ - $(RM) "$(>)" -} - - -rule copy -{ -} - - -actions copy -{ - $(CP) "$(>)" $(WINDOWS-CP-HACK) "$(<)" -} - - -rule RmTemps -{ -} - - -actions quietly updated piecemeal together RmTemps -{ - $(RM) "$(>)" $(IGNORE) -} - - -actions hard-link -{ - $(RM) "$(<)" 2$(NULL_OUT) $(NULL_OUT) - $(LN) "$(>)" "$(<)" $(NULL_OUT) -} - - -# Given a target, as given to a custom tag rule, returns a string formatted -# according to the passed format. Format is a list of properties that is -# represented in the result. For each element of format the corresponding target -# information is obtained and added to the result string. For all, but the -# literal, the format value is taken as the as string to prepend to the output -# to join the item to the rest of the result. If not given "-" is used as a -# joiner. -# -# The format options can be: -# -# <base>[joiner] -# :: The basename of the target name. -# <toolset>[joiner] -# :: The abbreviated toolset tag being used to build the target. -# <threading>[joiner] -# :: Indication of a multi-threaded build. -# <runtime>[joiner] -# :: Collective tag of the build runtime. -# <version:/version-feature | X.Y[.Z]/>[joiner] -# :: Short version tag taken from the given "version-feature" in the -# build properties. Or if not present, the literal value as the -# version number. -# <property:/property-name/>[joiner] -# :: Direct lookup of the given property-name value in the build -# properties. /property-name/ is a regular expression. E.g. -# <property:toolset-.*:flavor> will match every toolset. -# /otherwise/ -# :: The literal value of the format argument. -# -# For example this format: -# -# boost_ <base> <toolset> <threading> <runtime> <version:boost-version> -# -# Might return: -# -# boost_thread-vc80-mt-gd-1_33.dll, or -# boost_regex-vc80-gd-1_33.dll -# -# The returned name also has the target type specific prefix and suffix which -# puts it in a ready form to use as the value from a custom tag rule. -# -rule format-name ( format * : name : type ? : property-set ) -{ - local result = "" ; - for local f in $(format) - { - switch $(f:G) - { - case <base> : - local matched = [ MATCH "^(boost.*python)-.*" : $(name) ] ; - if $(matched) = boost_python || $(matched) = boost_mpi_python - { - result += $(name) ; - } - else - { - result += $(name:B) ; - } - - case <toolset> : - result += [ join-tag $(f:G=) : [ toolset-tag $(name) : $(type) : - $(property-set) ] ] ; - - case <threading> : - result += [ join-tag $(f:G=) : [ threading-tag $(name) : $(type) - : $(property-set) ] ] ; - - case <runtime> : - result += [ join-tag $(f:G=) : [ runtime-tag $(name) : $(type) : - $(property-set) ] ] ; - - case <qt> : - result += [ join-tag $(f:G=) : [ qt-tag $(name) : $(type) : - $(property-set) ] ] ; - - case <address-model> : - result += [ join-tag $(f:G=) : [ address-model-tag $(name) : - $(type) : $(property-set) ] ] ; - - case <version:*> : - local key = [ MATCH <version:(.*)> : $(f:G) ] ; - local version = [ $(property-set).get <$(key)> ] ; - version ?= $(key) ; - version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ] ; - result += [ join-tag $(f:G=) : $(version[1])_$(version[2]) ] ; - - case <property:*> : - local key = [ MATCH <property:(.*)> : $(f:G) ] ; - local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ; - if $(p0) - { - local p = [ $(property-set).get <$(p0)> ] ; - if $(p) - { - result += [ join-tag $(f:G=) : $(p) ] ; - } - } - - case * : - result += $(f:G=) ; - } - } - return [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) : - $(property-set) ] ; -} - - -local rule join-tag ( joiner ? : tag ? ) -{ - if ! $(joiner) { joiner = - ; } - return $(joiner)$(tag) ; -} - - -local rule toolset-tag ( name : type ? : property-set ) -{ - local tag = ; - - local properties = [ $(property-set).raw ] ; - switch [ $(property-set).get <toolset> ] - { - case borland* : tag += bcb ; - case clang* : - { - switch [ $(property-set).get <toolset-clang:platform> ] - { - case darwin : tag += clang-darwin ; - case linux : tag += clang ; - } - } - case como* : tag += como ; - case cw : tag += cw ; - case darwin* : tag += xgcc ; - case edg* : tag += edg ; - case gcc* : - { - switch [ $(property-set).get <toolset-gcc:flavor> ] - { - case *mingw* : tag += mgw ; - case * : tag += gcc ; - } - } - case intel : - if [ $(property-set).get <toolset-intel:platform> ] = win - { - tag += iw ; - } - else - { - tag += il ; - } - case kcc* : tag += kcc ; - case kylix* : tag += bck ; - #case metrowerks* : tag += cw ; - #case mingw* : tag += mgw ; - case mipspro* : tag += mp ; - case msvc* : tag += vc ; - case qcc* : tag += qcc ; - case sun* : tag += sw ; - case tru64cxx* : tag += tru ; - case vacpp* : tag += xlc ; - } - local version = [ MATCH <toolset.*version>([0123456789]+)[.]([0123456789]*) - : $(properties) ] ; - # For historical reasons, vc6.0 and vc7.0 use different naming. - if $(tag) = vc - { - if $(version[1]) = 6 - { - # Cancel minor version. - version = 6 ; - } - else if $(version[1]) = 7 && $(version[2]) = 0 - { - version = 7 ; - } - } - # On intel, version is not added, because it does not matter and it is the - # version of vc used as backend that matters. Ideally, we should encode the - # backend version but that would break compatibility with V1. - if $(tag) = iw - { - version = ; - } - - # On borland, version is not added for compatibility with V1. - if $(tag) = bcb - { - version = ; - } - - tag += $(version) ; - - return $(tag:J=) ; -} - - -local rule threading-tag ( name : type ? : property-set ) -{ - if <threading>multi in [ $(property-set).raw ] - { - return mt ; - } -} - - -local rule runtime-tag ( name : type ? : property-set ) -{ - local tag = ; - - local properties = [ $(property-set).raw ] ; - if <runtime-link>static in $(properties) { tag += s ; } - - # This is an ugly thing. In V1, there is code to automatically detect which - # properties affect a target. So, if <runtime-debugging> does not affect gcc - # toolset, the tag rules will not even see <runtime-debugging>. Similar - # functionality in V2 is not implemented yet, so we just check for toolsets - # known to care about runtime debugging. - if ( <toolset>msvc in $(properties) ) || - ( <stdlib>stlport in $(properties) ) || - ( <toolset-intel:platform>win in $(properties) ) - { - if <runtime-debugging>on in $(properties) { tag += g ; } - } - - if <python-debugging>on in $(properties) { tag += y ; } - if <variant>debug in $(properties) { tag += d ; } - if <stdlib>stlport in $(properties) { tag += p ; } - if <stdlib-stlport:iostream>hostios in $(properties) { tag += n ; } - - return $(tag:J=) ; -} - - -# Create a tag for the Qt library version -# "<qt>4.6.0" will result in tag "qt460" -local rule qt-tag ( name : type ? : property-set ) -{ - local v = [ MATCH ([0123456789]+)[.]?([0123456789]*)[.]?([0123456789]*) : - [ $(property-set).get <qt> ] ] ; - return qt$(v:J=) ; -} - - -# Create a tag for the address-model -# <address-model>64 will simply generate "64" -local rule address-model-tag ( name : type ? : property-set ) -{ - return [ $(property-set).get <address-model> ] ; -} - - -rule __test__ ( ) -{ - import assert ; - - local save-os = [ modules.peek os : .name ] ; - - modules.poke os : .name : LINUX ; - assert.result "PATH=\"foo:bar:baz\"\nexport PATH\n" - : path-variable-setting-command PATH : foo bar baz ; - assert.result "PATH=\"foo:bar:$PATH\"\nexport PATH\n" - : prepend-path-variable-command PATH : foo bar ; - - modules.poke os : .name : NT ; - assert.result "set PATH=foo;bar;baz\n" - : path-variable-setting-command PATH : foo bar baz ; - assert.result "set PATH=foo;bar;%PATH%\n" - : prepend-path-variable-command PATH : foo bar ; - - modules.poke os : .name : $(save-os) ; -}
