You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/04/19 21:34:24 UTC

[36/51] [partial] incubator-joshua git commit: Converted KenLM into a submodule

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/png.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/png.jam b/ext/kenlm/jam-files/boost-build/tools/png.jam
deleted file mode 100644
index 0544fe9..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/png.jam
+++ /dev/null
@@ -1,226 +0,0 @@
-# Copyright (c) 2010 Vladimir Prus.
-# Copyright (c) 2013 Steven Watanabe
-#
-# 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)
-
-# Supports the libpng library
-#
-# After 'using libpng', the following targets are available:
-#
-# /libpng//libpng -- The libpng library
-
-import project ;
-import ac ;
-import errors ;
-import "class" : new ;
-import targets ; 
-import path ;
-import modules ;
-import errors ;
-import indirect ;
-import property ;
-import property-set ;
-
-header = png.h ;
-names = libpng ;
-
-sources =   png.c pngerror.c pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c
-            pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c ;
-
-library-id = 0 ;
-
-if --debug-configuration in [ modules.peek : ARGV ]
-{
-    .debug =  true ;
-}
-
-# Initializes the libpng library.
-#
-# libpng can be configured either to use pre-existing binaries
-# or to build the library from source.
-#
-# Options for configuring a prebuilt libpng::
-#
-#   <search>
-#       The directory containing the libpng binaries.
-#   <name>
-#       Overrides the default library name.
-#   <include>
-#       The directory containing the libpng headers.
-#
-# If none of these options is specified, then the environmental
-# variables LIBPNG_LIBRARY_PATH, LIBPNG_NAME, and LIBPNG_INCLUDE will
-# be used instead.
-#
-# Options for building libpng from source::
-#
-#   <source>
-#       The libpng source directory.  Defaults to the environmental variable
-#       LIBPNG_SOURCE.
-#   <tag>
-#       A rule which computes the actual name of the compiled
-#       libraries based on the build properties.  Ignored
-#       when using precompiled binaries.
-#   <build-name>
-#       The base name to use for the compiled library.  Ignored
-#       when using precompiled binaries.
-#
-# Examples::
-#
-#   # Find libpng in the default system location
-#   using libpng ;
-#   # Build libpng from source
-#   using libpng : 1.5.4 : <source>/home/steven/libpng-1.5.4 ;
-#   # Find libpng in /usr/local
-#   using libpng : 1.5.4
-#     : <include>/usr/local/include <search>/usr/local/lib ;
-#   # Build libpng from source for msvc and find
-#   # prebuilt binaries for gcc.
-#   using libpng : 1.5.4 : <source>C:/Devel/src/libpng-1.5.4 : <toolset>msvc ;
-#   using libpng : 1.5.4 : : <toolset>gcc ;
-#
-rule init (
-    version ?
-    # The libpng version (currently ignored)
-
-    : options *
-    # A list of the options to use
-
-    : requirements *
-    # The requirements for the libpng target
-
-    : is-default ?
-    # Default configurations are only used when libpng
-    # has not yet been configured.
-    )
-{
-    local caller = [ project.current ] ;
-
-    if ! $(.initialized)
-    {
-        .initialized = true ;
-
-        project.initialize $(__name__) ;
-        .project = [ project.current ] ;
-        project libpng ;
-    }
-
-    local library-path = [ property.select <search> : $(options) ] ;
-    library-path = $(library-path:G=) ;
-    local include-path = [ property.select <include> : $(options) ] ;
-    include-path = $(include-path:G=) ;
-    local source-path = [ property.select <source> : $(options) ] ;
-    source-path = $(source-path:G=) ;
-    local library-name = [ property.select <name> : $(options) ] ;
-    library-name = $(library-name:G=) ;
-    local tag = [ property.select <tag> : $(options) ] ;
-    tag = $(tag:G=) ;
-    local build-name = [ property.select <build-name> : $(options) ] ;
-    build-name = $(build-name:G=) ;
-
-    condition = [ property-set.create $(requirements) ] ;
-    condition = [ property-set.create [ $(condition).base ] ] ;
-
-    local no-build-from-source ;
-    # Ignore environmental ZLIB_SOURCE if this initialization
-    # requested to search for a specific pre-built library.
-    if $(library-path) || $(include-path) || $(library-name)
-    {
-        if $(source-path) || $(tag) || $(build-name)
-        {
-            errors.user-error "incompatible options for libpng:"
-                [ property.select <search> <include> <name> : $(options) ] "and"
-                [ property.select <source> <tag> <build-name> : $(options) ] ;
-        }
-        else
-        {
-            no-build-from-source = true ;
-        }
-    }
-
-    source-path ?= [ modules.peek : ZLIB_SOURCE ] ;
-
-    if $(.configured.$(condition))
-    {
-        if $(is-default)
-        {
-            if $(.debug)
-            {
-                ECHO "notice: [libpng] libpng is already configured" ;
-            }
-        }
-        else
-        {
-            errors.user-error "libpng is already configured" ;
-        }
-        return ;
-    }
-    else if $(source-path) && ! $(no-build-from-source)
-    {
-        build-name ?= z ;
-        library-id = [ CALC $(library-id) + 1 ] ;
-        tag = [ MATCH ^@?(.*)$ : $(tag) ] ;
-        if $(tag) && ! [ MATCH ^([^%]*)%([^%]+)$ : $(tag) ]
-        {
-            tag = [ indirect.make $(tag) : [ $(caller).project-module ] ] ;
-        }
-        sources = [ path.glob $(source-path) : $(sources) ] ;
-        if $(.debug)
-        {
-            ECHO "notice: [libpng] Building libpng from source as $(build-name)" ;
-            if $(condition)
-            {
-                ECHO "notice: [libpng] Condition" [ $(condition).raw ] ;
-            }
-            if $(sources)
-            {
-                ECHO "notice: [libpng] found libpng source in $(source-path)" ;
-            }
-            else
-            {
-                ECHO "warning: [libpng] could not find libpng source in $(source-path)" ;
-            }
-        }
-        local target ;
-        if $(sources) {
-            target = [ targets.create-typed-target LIB : $(.project)
-              : $(build-name).$(library-id)
-              : $(sources)
-              : $(requirements)
-                <tag>@$(tag)
-                <include>$(source-path)
-                <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
-                <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
-                <link>shared:<define>ZLIB_DLL
-              :
-              : <include>$(source-path) ] ;
-        }
-
-        local mt = [ new ac-library libpng : $(.project) : $(condition) ] ;
-        $(mt).set-header $(header) ;
-        $(mt).set-default-names $(names) ;
-        if $(target)
-        {
-            $(mt).set-target $(target) ;
-        }
-        targets.main-target-alternative $(mt) ;
-    } else {
-        if $(.debug)
-        {
-            ECHO "notice: [libpng] Using pre-installed library" ;
-            if $(condition)
-            {
-                ECHO "notice: [libpng] Condition" [ $(condition).raw ] ;
-            }
-        }
-
-        local mt = [ new ac-library libpng : $(.project) : $(condition) :
-            $(include-path) : $(library-path) : $(library-name) : $(root) ] ;
-        $(mt).set-header $(header) ;
-        $(mt).set-default-names $(names) ;
-        targets.main-target-alternative $(mt) ;
-    }
-    .configured.$(condition) = true ;
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/python-config.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/python-config.jam b/ext/kenlm/jam-files/boost-build/tools/python-config.jam
deleted file mode 100644
index 40aa825..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/python-config.jam
+++ /dev/null
@@ -1,27 +0,0 @@
-#~ Copyright 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)
-
-# Automatic configuration for Python tools and librries. To use, just import this module.
-
-import os ;
-import toolset : using ;
-
-if [ os.name ] = NT
-{
-    for local R in 2.4 2.3 2.2
-    {
-        local python-path = [ W32_GETREG
-            "HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\$(R)\\InstallPath" ] ;
-        local python-version = $(R) ;
-        
-        if $(python-path)
-        {
-            if --debug-configuration in [ modules.peek : ARGV ]
-            {
-                ECHO "notice:" using python ":" $(python-version) ":" $(python-path) ;
-            }
-            using python : $(python-version) : $(python-path) ;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/python.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/python.jam b/ext/kenlm/jam-files/boost-build/tools/python.jam
deleted file mode 100644
index a50a516..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/python.jam
+++ /dev/null
@@ -1,1258 +0,0 @@
-# Copyright 2004 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)
-
-# Support for Python and the the Boost.Python library.
-#
-# This module defines
-#
-# - a project 'python' with a target 'python' in it, that corresponds to the
-#   python library
-#
-# - a main target rule 'python-extension' which can be used to build a python
-#   extension.
-#
-# Extensions that use Boost.Python must explicitly link to it.
-
-import type ;
-import testing ;
-import generators ;
-import project ;
-import errors ;
-import targets ;
-import "class" : new ;
-import os ;
-import common ;
-import toolset ;
-import regex ;
-import numbers ;
-import string ;
-import property ;
-import sequence ;
-import path ;
-import feature ;
-import set ;
-import builtin ;
-
-
-# Make this module a project.
-project.initialize $(__name__) ;
-project python ;
-
-# Save the project so that if 'init' is called several times we define new
-# targets in the python project, not in whatever project we were called by.
-.project = [ project.current ] ;
-
-# Dynamic linker lib. Necessary to specify it explicitly on some platforms.
-lib dl ;
-# This contains 'openpty' function need by python. Again, on some system need to
-# pass this to linker explicitly.
-lib util ;
-# Python uses pthread symbols.
-lib pthread ;
-# Extra library needed by phtread on some platforms.
-lib rt ;
-
-# The pythonpath feature specifies additional elements for the PYTHONPATH
-# environment variable, set by run-pyd. For example, pythonpath can be used to
-# access Python modules that are part of the product being built, but are not
-# installed in the development system's default paths.
-feature.feature pythonpath : : free optional path ;
-
-# Initializes the Python toolset. Note that all parameters are optional.
-#
-# - version -- the version of Python to use. Should be in Major.Minor format,
-#   for example 2.3.  Do not include the subminor version.
-#
-# - cmd-or-prefix: Preferably, a command that invokes a Python interpreter.
-#   Alternatively, the installation prefix for Python libraries and includes. If
-#   empty, will be guessed from the version, the platform's installation
-#   patterns, and the python executables that can be found in PATH.
-#
-# - includes: the include path to Python headers. If empty, will be guessed.
-#
-# - libraries: the path to Python library binaries. If empty, will be guessed.
-#   On MacOS/Darwin, you can also pass the path of the Python framework.
-#
-# - condition: if specified, should be a set of properties that are matched
-#   against the build configuration when Boost.Build selects a Python
-#   configuration to use.
-#
-# - extension-suffix: A string to append to the name of extension modules before
-#   the true filename extension.  Ordinarily we would just compute this based on
-#   the value of the <python-debugging> feature. However ubuntu's python-dbg
-#   package uses the windows convention of appending _d to debug-build extension
-#   modules. We have no way of detecting ubuntu, or of probing python for the
-#   "_d" requirement, and if you configure and build python using
-#   --with-pydebug, you'll be using the standard *nix convention. Defaults to ""
-#   (or "_d" when targeting windows and <python-debugging> is set).
-#
-# Example usage:
-#
-#   using python : 2.3 ;
-#   using python : 2.3 : /usr/local/bin/python ;
-#
-rule init ( version ? : cmd-or-prefix ? : includes * : libraries ?
-    : condition * : extension-suffix ? )
-{
-    project.push-current $(.project) ;
-
-    debug-message Configuring python... ;
-    for local v in version cmd-or-prefix includes libraries condition
-    {
-        if $($(v))
-        {
-            debug-message "  user-specified "$(v): \"$($(v))\" ;
-        }
-    }
-
-    configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
-
-    project.pop-current ;
-}
-
-# A simpler version of SHELL that grabs stderr as well as stdout, but returns
-# nothing if there was an error.
-#
-local rule shell-cmd ( cmd )
-{
-    debug-message running command '$(cmd)" 2>&1"' ;
-    x = [ SHELL $(cmd)" 2>&1" : exit-status ] ;
-    if $(x[2]) = 0
-    {
-        return $(x[1]) ;
-    }
-    else
-    {
-        return ;
-    }
-}
-
-
-# Try to identify Cygwin symlinks. Invoking such a file directly as an NT
-# executable from a native Windows build of bjam would be fatal to the bjam
-# process. One /can/ invoke them through sh.exe or bash.exe, if you can prove
-# that those are not also symlinks. ;-)
-#
-# If a symlink is found returns non-empty; we try to extract the target of the
-# symlink from the file and return that.
-#
-# Note: 1. only works on NT  2. path is a native path.
-local rule is-cygwin-symlink ( path )
-{
-    local is-symlink = ;
-
-    # Look for a file with the given path having the S attribute set, as cygwin
-    # symlinks do. /-C means "do not use thousands separators in file sizes."
-    local dir-listing = [ shell-cmd "DIR /-C /A:S \""$(path)"\"" ] ;
-
-    if $(dir-listing)
-    {
-        # Escape any special regex characters in the base part of the path.
-        local base-pat = [ regex.escape $(path:D=) : ].[()*+?|\\$^ : \\ ] ;
-
-        # Extract the file's size from the directory listing.
-        local size-of-system-file = [ MATCH "([0-9]+) "$(base-pat) : $(dir-listing) : 1 ] ;
-
-        # If the file has a reasonably small size, look for the special symlink
-        # identification text.
-        if $(size-of-system-file) && [ numbers.less $(size-of-system-file) 1000 ]
-        {
-            local link = [ SHELL "FIND /OFF \"!<symlink>\" \""$(path)"\" 2>&1" ] ;
-            if $(link[2]) != 0
-            {
-                local nl = "
-
-" ;
-                is-symlink = [ MATCH ".*!<symlink>([^"$(nl)"]*)" : $(link[1]) : 1 ] ;
-                if $(is-symlink)
-                {
-                    is-symlink = [ *nix-path-to-native $(is-symlink) ] ;
-                    is-symlink = $(is-symlink:R=$(path:D)) ;
-                }
-
-            }
-        }
-    }
-    return $(is-symlink) ;
-}
-
-
-# Append ext to each member of names that does not contain '.'.
-#
-local rule default-extension ( names * : ext * )
-{
-    local result ;
-    for local n in $(names)
-    {
-        switch $(n)
-        {
-            case *.* : result += $(n) ;
-            case * : result += $(n)$(ext) ;
-        }
-    }
-    return $(result) ;
-}
-
-
-# Tries to determine whether invoking "cmd" would actually attempt to launch a
-# cygwin symlink.
-#
-# Note: only works on NT.
-#
-local rule invokes-cygwin-symlink ( cmd )
-{
-    local dirs = $(cmd:D) ;
-    if ! $(dirs)
-    {
-        dirs = . [ os.executable-path ] ;
-    }
-    local base = [ default-extension $(cmd:D=) : .exe .cmd .bat ] ;
-    local paths = [ GLOB $(dirs) : $(base) ] ;
-    if $(paths)
-    {
-        # Make sure we have not run into a Cygwin symlink. Invoking such a file
-        # as an NT executable would be fatal for the bjam process.
-        return [ is-cygwin-symlink $(paths[1]) ] ;
-    }
-}
-
-
-local rule debug-message ( message * )
-{
-    if --debug-configuration in [ modules.peek : ARGV ]
-    {
-        ECHO notice: [python-cfg] $(message) ;
-    }
-}
-
-
-# Like W32_GETREG, except prepend HKEY_CURRENT_USER\SOFTWARE and
-# HKEY_LOCAL_MACHINE\SOFTWARE to the first argument, returning the first result
-# found. Also accounts for the fact that on 64-bit machines, 32-bit software has
-# its own area, under SOFTWARE\Wow6432node.
-#
-local rule software-registry-value ( path : data ? )
-{
-    local result ;
-    for local root in HKEY_CURRENT_USER HKEY_LOCAL_MACHINE
-    {
-        for local x64elt in "" Wow6432node\\ # Account for 64-bit windows
-        {
-            if ! $(result)
-            {
-                result = [ W32_GETREG $(root)\\SOFTWARE\\$(x64elt)$(path) : $(data) ] ;
-            }
-        }
-
-    }
-    return $(result) ;
-}
-
-
-.windows-drive-letter-re = ^([A-Za-z]):[\\/](.*) ;
-.cygwin-drive-letter-re = ^/cygdrive/([a-z])/(.*) ;
-
-.working-directory = [ PWD ] ;
-.working-drive-letter = [ SUBST $(.working-directory) $(.windows-drive-letter-re) $1 ] ;
-.working-drive-letter ?= [ SUBST $(.working-directory) $(.cygwin-drive-letter-re) $1 ] ;
-
-
-local rule windows-to-cygwin-path ( path )
-{
-    # If path is rooted with a drive letter, rewrite it using the /cygdrive
-    # mountpoint.
-    local p = [ SUBST $(path:T) $(.windows-drive-letter-re) /cygdrive/$1/$2 ] ;
-
-    # Else if path is rooted without a drive letter, use the working directory.
-    p ?= [ SUBST $(path:T) ^/(.*) /cygdrive/$(.working-drive-letter:L)/$2 ] ;
-
-    # Else return the path unchanged.
-    return $(p:E=$(path:T)) ;
-}
-
-
-# :W only works in Cygwin builds of bjam.  This one works on NT builds as well.
-#
-local rule cygwin-to-windows-path ( path )
-{
-    path = $(path:R="") ; # strip any trailing slash
-
-    local drive-letter = [ SUBST $(path) $(.cygwin-drive-letter-re) $1:/$2 ] ;
-    if $(drive-letter)
-    {
-        path = $(drive-letter) ;
-    }
-    else if $(path:R=/x) = $(path) # already rooted?
-    {
-        # Look for a cygwin mount that includes each head sequence in $(path).
-        local head = $(path) ;
-        local tail = "" ;
-
-        while $(head)
-        {
-            local root = [ software-registry-value
-                "Cygnus Solutions\\Cygwin\\mounts v2\\"$(head) : native ] ;
-
-            if $(root)
-            {
-                path = $(tail:R=$(root)) ;
-                head = ;
-            }
-            tail = $(tail:R=$(head:D=)) ;
-
-            if $(head) = /
-            {
-                head = ;
-            }
-            else
-            {
-                head = $(head:D) ;
-            }
-        }
-    }
-    return [ regex.replace $(path:R="") / \\ ] ;
-}
-
-
-# Convert a *nix path to native.
-#
-local rule *nix-path-to-native ( path )
-{
-    if [ os.name ] = NT
-    {
-        path = [ cygwin-to-windows-path $(path) ] ;
-    }
-    return $(path) ;
-}
-
-
-# Convert an NT path to native.
-#
-local rule windows-path-to-native ( path )
-{
-    if [ os.name ] = NT
-    {
-        return $(path) ;
-    }
-    else
-    {
-        return [ windows-to-cygwin-path $(path) ] ;
-    }
-}
-
-
-# Return nonempty if path looks like a windows path, i.e. it starts with a drive
-# letter or contains backslashes.
-#
-local rule guess-windows-path ( path )
-{
-    return [ SUBST $(path) ($(.windows-drive-letter-re)|.*([\\]).*) $1 ] ;
-}
-
-
-local rule path-to-native ( paths * )
-{
-    local result ;
-
-    for local p in $(paths)
-    {
-        if [ guess-windows-path $(p) ]
-        {
-            result += [ windows-path-to-native $(p) ] ;
-        }
-        else
-        {
-            result += [ *nix-path-to-native $(p:T) ] ;
-        }
-    }
-    return $(result) ;
-}
-
-
-# Validate the version string and extract the major/minor part we care about.
-#
-local rule split-version ( version )
-{
-    local major-minor = [ MATCH ^([0-9]+)\.([0-9]+)(.*)$ : $(version) : 1 2 3 ] ;
-    if ! $(major-minor[2]) || $(major-minor[3])
-    {
-        ECHO "Warning: \"using python\" expects a two part (major, minor) version number; got" $(version) instead ;
-
-        # Add a zero to account for the missing digit if necessary.
-        major-minor += 0 ;
-    }
-
-    return $(major-minor[1]) $(major-minor[2]) ;
-}
-
-
-# Build a list of versions from 3.0 down to 1.5. Because bjam can not enumerate
-# registry sub-keys, we have no way of finding a version with a 2-digit minor
-# version, e.g. 2.10 -- let us hope that never happens.
-#
-.version-countdown = ;
-for local v in [ numbers.range 15 30 ]
-{
-    .version-countdown = [ SUBST $(v) (.)(.*) $1.$2 ] $(.version-countdown) ;
-}
-
-
-local rule windows-installed-pythons ( version ? )
-{
-    version ?= $(.version-countdown) ;
-    local interpreters ;
-
-    for local v in $(version)
-    {
-        local install-path = [
-          software-registry-value "Python\\PythonCore\\"$(v)"\\InstallPath" ] ;
-
-        if $(install-path)
-        {
-            install-path = [ windows-path-to-native $(install-path) ] ;
-            debug-message Registry indicates Python $(v) installed at \"$(install-path)\" ;
-        }
-
-        interpreters += $(:E=python:R=$(install-path)) ;
-    }
-    return $(interpreters) ;
-}
-
-
-local rule darwin-installed-pythons ( version ? )
-{
-    version ?= $(.version-countdown) ;
-
-    local prefix
-      = [ GLOB /System/Library/Frameworks /Library/Frameworks
-          : Python.framework ] ;
-
-    return $(prefix)/Versions/$(version)/bin/python ;
-}
-
-
-# Assume "python-cmd" invokes a python interpreter and invoke it to extract all
-# the information we care about from its "sys" module. Returns void if
-# unsuccessful.
-#
-local rule probe ( python-cmd )
-{
-    # Avoid invoking a Cygwin symlink on NT.
-    local skip-symlink ;
-    if [ os.name ] = NT
-    {
-        skip-symlink = [ invokes-cygwin-symlink $(python-cmd) ] ;
-    }
-
-    if $(skip-symlink)
-    {
-        debug-message -------------------------------------------------------------------- ;
-        debug-message \"$(python-cmd)\" would attempt to invoke a Cygwin symlink, ;
-        debug-message causing a bjam built for Windows to hang. ;
-        debug-message ;
-        debug-message If you intend to target a Cygwin build of Python, please ;
-        debug-message replace the path to the link with the path to a real executable ;
-        debug-message (guessing: \"$(skip-symlink)\") "in" your 'using python' line ;
-        debug-message "in" user-config.jam or site-config.jam. Do not forget to escape ;
-        debug-message backslashes ;
-        debug-message -------------------------------------------------------------------- ;
-    }
-    else
-    {
-        # Prepare a List of Python format strings and expressions that can be
-        # used to print the constants we want from the sys module.
-
-        # We do not really want sys.version since that is a complicated string,
-        # so get the information from sys.version_info instead.
-        local format = "version=%d.%d" ;
-        local exprs = "version_info[0]" "version_info[1]" ;
-
-        for local s in $(sys-elements[2-])
-        {
-            format += $(s)=%s ;
-            exprs += $(s) ;
-        }
-
-        # Invoke Python and ask it for all those values.
-        local full-cmd =
-            $(python-cmd)" -c \"from sys import *; print('"$(format:J=\\n)"' % ("$(exprs:J=,)"))\"" ;
-
-        local output = [ shell-cmd $(full-cmd) ] ;
-        if $(output)
-        {
-            # Parse the output to get all the results.
-            local nl = "
-
-" ;
-            for s in $(sys-elements)
-            {
-                # These variables are expected to be declared local in the
-                # caller, so Jam's dynamic scoping will set their values there.
-                sys.$(s) = [ SUBST $(output) \\<$(s)=([^$(nl)]+) $1 ] ;
-            }
-        }
-        return $(output) ;
-    }
-}
-
-
-# Make sure the "libraries" and "includes" variables (in an enclosing scope)
-# have a value based on the information given.
-#
-local rule compute-default-paths ( target-os : version ? : prefix ? :
-    exec-prefix ? )
-{
-    exec-prefix ?= $(prefix) ;
-
-    if $(target-os) = windows
-    {
-        # The exec_prefix is where you're supposed to look for machine-specific
-        # libraries.
-        local default-library-path = $(exec-prefix)\\libs ;
-        local default-include-path = $(:E=Include:R=$(prefix)) ;
-
-        # If the interpreter was found in a directory called "PCBuild" or
-        # "PCBuild8," assume we're looking at a Python built from the source
-        # distro, and go up one additional level to the default root. Otherwise,
-        # the default root is the directory where the interpreter was found.
-
-        # We ask Python itself what the executable path is in case of
-        # intermediate symlinks or shell scripts.
-        local executable-dir = $(sys.executable:D) ;
-
-        if [ MATCH ^(PCBuild) : $(executable-dir:D=) ]
-        {
-            debug-message "This Python appears to reside in a source distribution;" ;
-            debug-message "prepending \""$(executable-dir)"\" to default library search path" ;
-
-            default-library-path = $(executable-dir) $(default-library-path) ;
-
-            default-include-path = $(:E=PC:R=$(executable-dir:D)) $(default-include-path) ;
-
-            debug-message "and \""$(default-include-path[1])"\" to default #include path" ;
-        }
-
-        libraries ?= $(default-library-path) ;
-        includes ?= $(default-include-path) ;
-    }
-    else
-    {
-        includes ?= $(prefix)/include/python$(version) ;
-
-        local lib = $(exec-prefix)/lib ;
-        libraries ?= $(lib)/python$(version)/config $(lib) ;
-    }
-}
-
-# The version of the python interpreter to use.
-feature.feature python : : propagated ;
-feature.feature python.interpreter : : free ;
-
-toolset.flags python.capture-output PYTHON : <python.interpreter> ;
-
-#
-# Support for Python configured --with-pydebug
-#
-feature.feature python-debugging : off on : propagated ;
-builtin.variant debug-python : debug : <python-debugging>on ;
-
-
-# Return a list of candidate commands to try when looking for a Python
-# interpreter. prefix is expected to be a native path.
-#
-local rule candidate-interpreters ( version ? : prefix ? : target-os )
-{
-    local bin-path = bin ;
-    if $(target-os) = windows
-    {
-        # On Windows, look in the root directory itself and, to work with the
-        # result of a build-from-source, the PCBuild directory.
-        bin-path = PCBuild8 PCBuild "" ;
-    }
-
-    bin-path = $(bin-path:R=$(prefix)) ;
-
-    if $(target-os) in windows darwin
-    {
-        return                                            # Search:
-            $(:E=python:R=$(bin-path))                    #   Relative to the prefix, if any
-            python                                        #   In the PATH
-            [ $(target-os)-installed-pythons $(version) ] #   Standard install locations
-        ;
-    }
-    else
-    {
-        # Search relative to the prefix, or if none supplied, in PATH.
-        local unversioned = $(:E=python:R=$(bin-path:E=)) ;
-
-        # If a version was specified, look for a python with that specific
-        # version appended before looking for one called, simply, "python"
-        return $(unversioned)$(version) $(unversioned) ;
-    }
-}
-
-
-# Compute system library dependencies for targets linking with static Python
-# libraries.
-#
-# On many systems, Python uses libraries such as pthreads or libdl. Since static
-# libraries carry no library dependency information of their own that the linker
-# can extract, these extra dependencies have to be given explicitly on the link
-# line of the client.  The information about these dependencies is packaged into
-# the "python" target below.
-#
-# Even where Python itself uses pthreads, it never allows extension modules to
-# be entered concurrently (unless they explicitly give up the interpreter lock).
-# Therefore, extension modules do not need the efficiency overhead of threadsafe
-# code as produced by <threading>multi, and we handle libpthread along with
-# other libraries here. Note: this optimization is based on an assumption that
-# the compiler generates link-compatible code in both the single- and
-# multi-threaded cases, and that system libraries do not change their ABIs
-# either.
-#
-# Returns a list of usage-requirements that link to the necessary system
-# libraries.
-#
-local rule system-library-dependencies ( target-os )
-{
-    switch $(target-os)
-    {
-        case s[uo][nl]* : # solaris, sun, sunos
-            # Add a librt dependency for the gcc toolset on SunOS (the sun
-            # toolset adds -lrt unconditionally). While this appears to
-            # duplicate the logic already in gcc.jam, it does not as long as
-            # we are not forcing <threading>multi.
-
-            # On solaris 10, distutils.sysconfig.get_config_var('LIBS') yields
-            # '-lresolv -lsocket -lnsl -lrt -ldl'. However, that does not seem
-            # to be the right list for extension modules. For example, on my
-            # installation, adding -ldl causes at least one test to fail because
-            # the library can not be found and removing it causes no failures.
-
-            # Apparently, though, we need to add -lrt for gcc.
-            return <toolset>gcc:<library>rt ;
-
-        case osf : return  <library>pthread <toolset>gcc:<library>rt ;
-
-        case qnx* : return ;
-        case darwin : return ;
-        case windows : return ;
-
-        case hpux : return  <library>rt ;
-        case *bsd : return  <library>pthread <toolset>gcc:<library>util ;
-
-        case aix : return  <library>pthread <library>dl ;
-
-        case * : return  <library>pthread <library>dl
-            <toolset>gcc:<library>util <toolset-intel:platform>linux:<library>util ;
-    }
-}
-
-
-# Declare a target to represent Python's library.
-#
-local rule declare-libpython-target ( version ? : requirements * )
-{
-    # Compute the representation of Python version in the name of Python's
-    # library file.
-    local lib-version = $(version) ;
-    if <target-os>windows in $(requirements)
-    {
-        local major-minor = [ split-version $(version) ] ;
-        lib-version = $(major-minor:J="") ;
-        if <python-debugging>on in $(requirements)
-        {
-            lib-version = $(lib-version)_d ;
-        }
-    }
-
-    if ! $(lib-version)
-    {
-        ECHO *** warning: could not determine Python version, which will ;
-        ECHO *** warning: probably prevent us from linking with the python ;
-        ECHO *** warning: library.  Consider explicitly passing the version ;
-        ECHO *** warning: to 'using python'. ;
-    }
-
-    # Declare it.
-    lib python.lib : : <name>python$(lib-version) $(requirements) ;
-}
-
-
-# Implementation of init.
-local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
-    condition * : extension-suffix ? )
-{
-    local prefix ;
-    local exec-prefix ;
-    local cmds-to-try ;
-    local interpreter-cmd ;
-
-    local target-os = [ feature.get-values target-os : $(condition) ] ;
-    target-os ?= [ feature.defaults target-os ] ;
-    target-os = $(target-os:G=) ;
-
-    if $(target-os) = windows && <python-debugging>on in $(condition)
-    {
-        extension-suffix ?= _d ;
-    }
-    extension-suffix ?= "" ;
-
-    # Normalize and dissect any version number.
-    local major-minor ;
-    if $(version)
-    {
-        major-minor = [ split-version $(version) ] ;
-        version = $(major-minor:J=.) ;
-    }
-
-    local cmds-to-try ;
-
-    if ! $(cmd-or-prefix) || [ GLOB $(cmd-or-prefix) : * ]
-    {
-        # If the user did not pass a command, whatever we got was a prefix.
-        prefix = $(cmd-or-prefix) ;
-        cmds-to-try = [ candidate-interpreters $(version) : $(prefix) : $(target-os) ] ;
-    }
-    else
-    {
-        # Work with the command the user gave us.
-        cmds-to-try = $(cmd-or-prefix) ;
-
-        # On Windows, do not nail down the interpreter command just yet in case
-        # the user specified something that turns out to be a cygwin symlink,
-        # which could bring down bjam if we invoke it.
-        if $(target-os) != windows
-        {
-            interpreter-cmd = $(cmd-or-prefix) ;
-        }
-    }
-
-    # Values to use in case we can not really find anything in the system.
-    local fallback-cmd = $(cmds-to-try[1]) ;
-    local fallback-version ;
-
-    # Anything left to find or check?
-    if ! ( $(interpreter-cmd) && $(includes) && $(libraries) )
-    {
-        # Values to be extracted from python's sys module. These will be set by
-        # the probe rule, above, using Jam's dynamic scoping.
-        local sys-elements = version platform prefix exec_prefix executable ;
-        local sys.$(sys-elements) ;
-
-        # Compute the string Python's sys.platform needs to match. If not
-        # targeting Windows or cygwin we will assume only native builds can
-        # possibly run, so we will not require a match and we leave sys.platform
-        # blank.
-        local platform ;
-        switch $(target-os)
-        {
-            case windows : platform = win32 ;
-            case cygwin : platform = cygwin ;
-        }
-
-        while $(cmds-to-try)
-        {
-            # Pop top command.
-            local cmd = $(cmds-to-try[1]) ;
-            cmds-to-try = $(cmds-to-try[2-]) ;
-
-            debug-message Checking interpreter command \"$(cmd)\"... ;
-            if [ probe $(cmd) ]
-            {
-                fallback-version ?= $(sys.version) ;
-
-                # Check for version/platform validity.
-                for local x in version platform
-                {
-                    if $($(x)) && $($(x)) != $(sys.$(x))
-                    {
-                        debug-message ...$(x) "mismatch (looking for"
-                            $($(x)) but found $(sys.$(x))")" ;
-                        cmd = ;
-                    }
-                }
-
-                if $(cmd)
-                {
-                    debug-message ...requested configuration matched! ;
-
-                    exec-prefix = $(sys.exec_prefix) ;
-
-                    compute-default-paths $(target-os) : $(sys.version) :
-                        $(sys.prefix) : $(sys.exec_prefix) ;
-
-                    version = $(sys.version) ;
-                    interpreter-cmd ?= $(cmd) ;
-                    cmds-to-try = ;  # All done.
-                }
-            }
-            else
-            {
-                debug-message ...does not invoke a working interpreter ;
-            }
-        }
-    }
-
-    # Anything left to compute?
-    if $(includes) && $(libraries)
-    {
-        .configured = true ;
-    }
-    else
-    {
-        version ?= $(fallback-version) ;
-        version ?= 2.5 ;
-        exec-prefix ?= $(prefix) ;
-        compute-default-paths $(target-os) : $(version) : $(prefix:E=) ;
-    }
-
-    if ! $(interpreter-cmd)
-    {
-        fallback-cmd ?= python ;
-        debug-message No working Python interpreter found. ;
-        if [ os.name ] != NT || ! [ invokes-cygwin-symlink $(fallback-cmd) ]
-        {
-            interpreter-cmd = $(fallback-cmd) ;
-            debug-message falling back to \"$(interpreter-cmd)\" ;
-        }
-    }
-
-    includes = [ path-to-native $(includes) ] ;
-    libraries = [ path-to-native $(libraries) ] ;
-
-    debug-message "Details of this Python configuration:" ;
-    debug-message "  interpreter command:" \"$(interpreter-cmd:E=<empty>)\" ;
-    debug-message "  include path:" \"$(includes:E=<empty>)\" ;
-    debug-message "  library path:" \"$(libraries:E=<empty>)\" ;
-    if $(target-os) = windows
-    {
-        debug-message "  DLL search path:" \"$(exec-prefix:E=<empty>)\" ;
-    }
-
-    #
-    # End autoconfiguration sequence.
-    #
-    local target-requirements = $(condition) ;
-
-    # Add the version, if any, to the target requirements.
-    if $(version)
-    {
-        if ! $(version) in [ feature.values python ]
-        {
-            feature.extend python : $(version) ;
-        }
-        target-requirements += <python>$(version:E=default) ;
-    }
-
-    target-requirements += <target-os>$(target-os) ;
-
-    # See if we can find a framework directory on darwin.
-    local framework-directory ;
-    if $(target-os) = darwin
-    {
-        # Search upward for the framework directory.
-        local framework-directory = $(libraries[-1]) ;
-        while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework
-        {
-            framework-directory = $(framework-directory:D) ;
-        }
-
-        if $(framework-directory:D=) = Python.framework
-        {
-            debug-message framework directory is \"$(framework-directory)\" ;
-        }
-        else
-        {
-            debug-message "no framework directory found; using library path" ;
-            framework-directory = ;
-        }
-    }
-
-    local dll-path = $(libraries) ;
-
-    # Make sure that we can find the Python DLL on Windows.
-    if ( $(target-os) = windows ) && $(exec-prefix)
-    {
-        dll-path += $(exec-prefix) ;
-    }
-
-    #
-    # Prepare usage requirements.
-    #
-    local usage-requirements = [ system-library-dependencies $(target-os) ] ;
-    usage-requirements += <include>$(includes) <python.interpreter>$(interpreter-cmd) ;
-    if <python-debugging>on in $(condition)
-    {
-        if $(target-os) = windows
-        {
-            # In pyconfig.h, Py_DEBUG is set if _DEBUG is set. If we define
-            # Py_DEBUG we will get multiple definition warnings.
-            usage-requirements += <define>_DEBUG ;
-        }
-        else
-        {
-            usage-requirements += <define>Py_DEBUG ;
-        }
-    }
-
-    # Global, but conditional, requirements to give access to the interpreter
-    # for general utilities, like other toolsets, that run Python scripts.
-    toolset.add-requirements
-        $(target-requirements:J=,):<python.interpreter>$(interpreter-cmd) ;
-
-    # Register the right suffix for extensions.
-    register-extension-suffix $(extension-suffix) : $(target-requirements) ;
-
-    #
-    # Declare the "python" target. This should really be called
-    # python_for_embedding.
-    #
-
-    if $(framework-directory)
-    {
-        alias python
-          :
-          : $(target-requirements)
-          :
-          : $(usage-requirements) <framework>$(framework-directory)
-          ;
-    }
-    else
-    {
-        declare-libpython-target $(version) : $(target-requirements) ;
-
-        # This is an evil hack.  On, Windows, when Python is embedded, nothing
-        # seems to set up sys.path to include Python's standard library
-        # (http://article.gmane.org/gmane.comp.python.general/544986). The evil
-        # here, aside from the workaround necessitated by Python's bug, is that:
-        #
-        # a. we're guessing the location of the python standard library from the
-        #    location of pythonXX.lib
-        #
-        # b. we're hijacking the <testing.launcher> property to get the
-        #    environment variable set up, and the user may want to use it for
-        #    something else (e.g. launch the debugger).
-        local set-PYTHONPATH ;
-        if $(target-os) = windows
-        {
-            set-PYTHONPATH = [ common.prepend-path-variable-command PYTHONPATH :
-                $(libraries:D)/Lib ] ;
-        }
-
-        alias python
-          :
-          : $(target-requirements)
-          :
-            # Why python.lib must be listed here instead of along with the
-            # system libs is a mystery, but if we do not do it, on cygwin,
-            # -lpythonX.Y never appears in the command line (although it does on
-            # linux).
-          : $(usage-requirements)
-            <testing.launcher>$(set-PYTHONPATH)
-              <library-path>$(libraries) <library>python.lib
-          ;
-    }
-
-    # On *nix, we do not want to link either Boost.Python or Python extensions
-    # to libpython, because the Python interpreter itself provides all those
-    # symbols. If we linked to libpython, we would get duplicate symbols. So
-    # declare two targets -- one for building extensions and another for
-    # embedding.
-    #
-    # Unlike most *nix systems, Mac OS X's linker does not permit undefined
-    # symbols when linking a shared library. So, we still need to link against
-    # the Python framework, even when building extensions. Note that framework
-    # builds of Python always use shared libraries, so we do not need to worry
-    # about duplicate Python symbols.
-    if $(target-os) in windows cygwin darwin
-    {
-        alias python_for_extensions : python : $(target-requirements) ;
-    }
-    # On AIX we need Python extensions and Boost.Python to import symbols from
-    # the Python interpreter. Dynamic libraries opened with dlopen() do not
-    # inherit the symbols from the Python interpreter.
-    else if $(target-os) = aix
-    {
-        alias python_for_extensions
-            :
-            : $(target-requirements)
-            :
-            : $(usage-requirements) <linkflags>-Wl,-bI:$(libraries[1])/python.exp
-            ;
-    }
-    else
-    {
-        alias python_for_extensions
-            :
-            : $(target-requirements)
-            :
-            : $(usage-requirements)
-            ;
-    }
-}
-
-
-rule configured ( )
-{
-     return $(.configured) ;
-}
-
-
-type.register PYTHON_EXTENSION : : SHARED_LIB ;
-
-
-local rule register-extension-suffix ( root : condition * )
-{
-    local suffix ;
-
-    switch [ feature.get-values target-os : $(condition) ]
-    {
-        case windows : suffix = pyd ;
-        case cygwin : suffix = dll ;
-        case hpux :
-        {
-            if [ feature.get-values python : $(condition) ] in 1.5 1.6 2.0 2.1 2.2 2.3 2.4
-            {
-                suffix = sl ;
-            }
-            else
-            {
-                suffix = so ;
-            }
-        }
-        case * : suffix = so ;
-    }
-
-    type.set-generated-target-suffix PYTHON_EXTENSION : $(condition) : <$(root).$(suffix)> ;
-}
-
-
-# Unset 'lib' prefix for PYTHON_EXTENSION
-type.set-generated-target-prefix PYTHON_EXTENSION : : "" ;
-
-
-rule python-extension ( name : sources * : requirements * : default-build * :
-                        usage-requirements * )
-{
-    if [ configured ]
-    {
-        requirements += <use>/python//python_for_extensions ;
-    }
-    requirements += <suppress-import-lib>true ;
-
-    local project = [ project.current ] ;
-
-    targets.main-target-alternative
-        [ new typed-target $(name) : $(project) : PYTHON_EXTENSION
-            : [ targets.main-target-sources $(sources) : $(name) ]
-            : [ targets.main-target-requirements $(requirements) : $(project) ]
-            : [ targets.main-target-default-build $(default-build) : $(project) ]
-        ] ;
-}
-
-IMPORT python : python-extension : : python-extension ;
-
-rule py2to3
-{
-    common.copy $(>) $(<) ;
-    2to3 $(<) ;
-}
-
-actions 2to3
-{
-    2to3 -wn "$(<)"
-    2to3 -dwn "$(<)"
-}
-
-
-# Support for testing.
-type.register PY : py ;
-type.register RUN_PYD_OUTPUT ;
-type.register RUN_PYD : : TEST ;
-
-
-class python-test-generator : generator
-{
-    import set ;
-
-    rule __init__ ( * : * )
-    {
-        generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
-        self.composing = true ;
-    }
-
-    rule run ( project name ? : property-set : sources * : multiple ? )
-    {
-        local pyversion = [ $(property-set).get <python> ] ;
-        local python ;
-        local other-pythons ;
-
-        # Make new target that converting Python source by 2to3 when running with Python 3.
-        local rule make-2to3-source ( source )
-        {
-            if $(pyversion) >= 3.0
-            {
-                local a = [ new action $(source) : python.py2to3 : $(property-set) ] ;
-                local t =  [ utility.basename [ $(s).name ] ] ;
-                local p = [ new file-target $(t) : PY : $(project) : $(a) ] ;
-                return $(p) ;
-            }
-            else
-            {
-                return $(source) ;
-            }
-        }
-
-        for local s in $(sources)
-        {
-            if [ $(s).type ] = PY
-            {
-                if ! $(python)
-                {
-                    # First Python source ends up on command line.
-                    python = [ make-2to3-source $(s) ] ;
-
-                }
-                else
-                {
-                    # Other Python sources become dependencies.
-                    other-pythons += [ make-2to3-source $(s) ] ;
-                }
-            }
-        }
-
-        local extensions ;
-        for local s in $(sources)
-        {
-            if [ $(s).type ] = PYTHON_EXTENSION
-            {
-                extensions += $(s) ;
-            }
-        }
-
-        local libs ;
-        for local s in $(sources)
-        {
-            if [ type.is-derived [ $(s).type ] LIB ]
-              && ! $(s) in $(extensions)
-            {
-                libs += $(s) ;
-            }
-        }
-
-        local new-sources ;
-        for local s in $(sources)
-        {
-            if [ type.is-derived [ $(s).type ] CPP ]
-            {
-                local name = [ utility.basename [ $(s).name ] ] ;
-                if $(name) = [ utility.basename [ $(python).name ] ]
-                {
-                    name = $(name)_ext ;
-                }
-                local extension = [ generators.construct $(project) $(name) :
-                  PYTHON_EXTENSION : $(property-set) : $(s) $(libs) ] ;
-
-                # The important part of usage requirements returned from
-                # PYTHON_EXTENSION generator are xdll-path properties that will
-                # allow us to find the python extension at runtime.
-                property-set = [ $(property-set).add $(extension[1]) ] ;
-
-                # Ignore usage requirements. We're a top-level generator and
-                # nobody is going to use what we generate.
-                new-sources += $(extension[2-]) ;
-            }
-        }
-
-        property-set = [ $(property-set).add-raw <dependency>$(other-pythons) ] ;
-
-        return [ construct-result $(python) $(extensions) $(new-sources) :
-            $(project) $(name) : $(property-set) ] ;
-    }
-}
-
-
-generators.register
-  [ new python-test-generator python.capture-output : : RUN_PYD_OUTPUT ] ;
-
-generators.register-standard testing.expect-success
-  : RUN_PYD_OUTPUT : RUN_PYD ;
-
-
-# There are two different ways of spelling OS names. One is used for [ os.name ]
-# and the other is used for the <host-os> and <target-os> properties. Until that
-# is remedied, this sets up a crude mapping from the latter to the former, that
-# will work *for the purposes of cygwin/NT cross-builds only*. Could not think
-# of a better name than "translate".
-#
-.translate-os-windows = NT ;
-.translate-os-cygwin = CYGWIN ;
-local rule translate-os ( src-os )
-{
-    local x = $(.translate-os-$(src-os)) [ os.name ] ;
-    return $(x[1]) ;
-}
-
-
-# Extract the path to a single ".pyd" source. This is used to build the
-# PYTHONPATH for running bpl tests.
-#
-local rule pyd-pythonpath ( source )
-{
-    return [ on $(source) return $(LOCATE) $(SEARCH) ] ;
-}
-
-
-# The flag settings on testing.capture-output do not apply to python.capture
-# output at the moment. Redo this explicitly.
-toolset.flags python.capture-output ARGS <testing.arg> ;
-
-
-rule capture-output ( target : sources * : properties * )
-{
-    # Setup up a proper DLL search path. Here, $(sources[1]) is a python module
-    # and $(sources[2]) is a DLL. Only $(sources[1]) is passed to
-    # testing.capture-output, so RUN_PATH variable on $(sources[2]) is not
-    # consulted. Move it over explicitly.
-    RUN_PATH on $(sources[1]) = [ on $(sources[2-]) return $(RUN_PATH) ] ;
-
-    PYTHONPATH  = [ sequence.transform pyd-pythonpath : $(sources[2-]) ] ;
-    PYTHONPATH += [ feature.get-values pythonpath : $(properties) ] ;
-
-    # After test is run, we remove the Python module, but not the Python script.
-    testing.capture-output $(target) : $(sources[1]) : $(properties) :
-        $(sources[2-]) ;
-
-    # PYTHONPATH is different; it will be interpreted by whichever Python is
-    # invoked and so must follow path rules for the target os. The only OSes
-    # where we can run python for other OSes currently are NT and CYGWIN so we
-    # only need to handle those cases.
-    local target-os = [ feature.get-values target-os : $(properties) ] ;
-    # Oddly, host-os is not in properties, so grab the default value.
-    local host-os = [ feature.defaults host-os ] ;
-    host-os = $(host-os:G=) ;
-    if $(target-os) != $(host-os)
-    {
-        PYTHONPATH = [ sequence.transform $(host-os)-to-$(target-os)-path :
-            $(PYTHONPATH) ] ;
-    }
-    local path-separator = [ os.path-separator [ translate-os $(target-os) ] ] ;
-    local set-PYTHONPATH = [ common.variable-setting-command PYTHONPATH :
-        $(PYTHONPATH:J=$(path-separator)) ] ;
-    LAUNCHER on $(target) = $(set-PYTHONPATH) [ on $(target) return \"$(PYTHON)\" ] ;
-}
-
-
-rule bpl-test ( name : sources * : requirements * )
-{
-    local s ;
-    sources ?= $(name).py $(name).cpp ;
-    return [ testing.make-test run-pyd : $(sources) /boost/python//boost_python
-        : $(requirements) : $(name) ] ;
-}
-
-
-IMPORT $(__name__) : bpl-test : : bpl-test ;

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/qcc.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/qcc.jam b/ext/kenlm/jam-files/boost-build/tools/qcc.jam
deleted file mode 100644
index 3b35578..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/qcc.jam
+++ /dev/null
@@ -1,238 +0,0 @@
-#  Copyright (c) 2001 David Abrahams.
-#  Copyright (c) 2002-2003 Rene Rivera.
-#  Copyright (c) 2002-2003 Vladimir Prus.
-#
-#  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 "class" : new ;
-import common ;
-import errors ;
-import feature ;
-import generators ;
-import os ;
-import property ;
-import set ;
-import toolset ;
-import type ;
-import unix ;
-
-feature.extend toolset : qcc ;
-
-toolset.inherit-generators qcc : unix : unix.link unix.link.dll ;
-generators.override builtin.lib-generator : qcc.prebuilt ;
-toolset.inherit-flags qcc : unix ;
-toolset.inherit-rules qcc : unix ;
-
-# Initializes the qcc toolset for the given version. If necessary, command may
-# be used to specify where the compiler is located. The parameter 'options' is a
-# space-delimited list of options, each one being specified as
-# <option-name>option-value. Valid option names are: cxxflags, linkflags and
-# linker-type. Accepted values for linker-type are gnu and sun, gnu being the
-# default.
-#
-# Example:
-#   using qcc : 3.4 : : <cxxflags>foo <linkflags>bar <linker-type>sun ;
-#
-rule init ( version ? : command * : options * )
-{
-    local condition = [ common.check-init-parameters qcc : version $(version) ] ;
-    local command = [ common.get-invocation-command qcc : QCC : $(command) ] ;
-    common.handle-options qcc : $(condition) : $(command) : $(options) ;
-}
-
-
-generators.register-c-compiler qcc.compile.c++ : CPP : OBJ : <toolset>qcc ;
-generators.register-c-compiler qcc.compile.c   : C   : OBJ : <toolset>qcc ;
-generators.register-c-compiler qcc.compile.asm : ASM : OBJ : <toolset>qcc ;
-
-
-# Declare flags for compilation.
-toolset.flags qcc.compile OPTIONS <debug-symbols>on : -gstabs+ ;
-
-# Declare flags and action for compilation.
-toolset.flags qcc.compile OPTIONS <optimization>off : -O0 ;
-toolset.flags qcc.compile OPTIONS <optimization>speed : -O3 ;
-toolset.flags qcc.compile OPTIONS <optimization>space : -Os ;
-
-toolset.flags qcc.compile OPTIONS <inlining>off : -Wc,-fno-inline ;
-toolset.flags qcc.compile OPTIONS <inlining>on : -Wc,-Wno-inline ;
-toolset.flags qcc.compile OPTIONS <inlining>full : -Wc,-finline-functions -Wc,-Wno-inline ;
-
-toolset.flags qcc.compile OPTIONS <warnings>off : -w ;
-toolset.flags qcc.compile OPTIONS <warnings>all : -Wc,-Wall ;
-toolset.flags qcc.compile OPTIONS <warnings-as-errors>on : -Wc,-Werror ;
-
-toolset.flags qcc.compile OPTIONS <profiling>on : -p ;
-
-toolset.flags qcc.compile OPTIONS <cflags> ;
-toolset.flags qcc.compile.c++ OPTIONS <cxxflags> ;
-toolset.flags qcc.compile DEFINES <define> ;
-toolset.flags qcc.compile INCLUDES <include> ;
-
-toolset.flags qcc.compile OPTIONS <link>shared : -shared ;
-
-toolset.flags qcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
-
-
-rule compile.c++
-{
-    # Here we want to raise the template-depth parameter value to something
-    # higher than the default value of 17. Note that we could do this using the
-    # feature.set-default rule but we do not want to set the default value for
-    # all toolsets as well.
-    #
-    # TODO: This 'modified default' has been inherited from some 'older Boost
-    # Build implementation' and has most likely been added to make some Boost
-    # library parts compile correctly. We should see what exactly prompted this
-    # and whether we can get around the problem more locally.
-    local template-depth = [ on $(1) return $(TEMPLATE_DEPTH) ] ;
-    if ! $(template-depth)
-    {
-        TEMPLATE_DEPTH on $(1) = 128 ;
-    }
-}
-
-actions compile.c++
-{
-    "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
-}
-
-actions compile.c
-{
-    "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
-}
-
-actions compile.asm
-{
-    "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
-}
-
-
-# The class checking that we do not try to use the <runtime-link>static property
-# while creating or using a shared library, since it is not supported by qcc/
-# /libc.
-#
-class qcc-linking-generator : unix-linking-generator
-{
-    rule generated-targets ( sources + : property-set : project name ? )
-    {
-        if <runtime-link>static in [ $(property-set).raw ]
-        {
-            local m ;
-            if [ id ] = "qcc.link.dll"
-            {
-                m = "on qcc, DLL can't be build with <runtime-link>static" ;
-            }
-            if ! $(m)
-            {
-                for local s in $(sources)
-                {
-                    local type = [ $(s).type ] ;
-                    if $(type) && [ type.is-derived $(type) SHARED_LIB ]
-                    {
-                        m = "on qcc, using DLLS together with the <runtime-link>static options is not possible " ;
-                    }
-                }
-            }
-            if $(m)
-            {
-                errors.user-error $(m) : "It is suggested to use"
-                    "<runtime-link>static together with <link>static." ;
-            }
-        }
-
-        return [ unix-linking-generator.generated-targets
-            $(sources) : $(property-set) : $(project) $(name) ] ;
-    }
-}
-
-generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE
-    : <toolset>qcc ] ;
-
-generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ
-    : SHARED_LIB : <toolset>qcc ] ;
-
-generators.override qcc.prebuilt : builtin.prebuilt ;
-generators.override qcc.searched-lib-generator : searched-lib-generator ;
-
-
-# Declare flags for linking.
-# First, the common flags.
-toolset.flags qcc.link OPTIONS <debug-symbols>on : -gstabs+ ;
-toolset.flags qcc.link OPTIONS <profiling>on : -p ;
-toolset.flags qcc.link OPTIONS <linkflags> ;
-toolset.flags qcc.link LINKPATH <library-path> ;
-toolset.flags qcc.link FINDLIBS-ST <find-static-library> ;
-toolset.flags qcc.link FINDLIBS-SA <find-shared-library> ;
-toolset.flags qcc.link LIBRARIES <library-file> ;
-
-toolset.flags qcc.link FINDLIBS-SA : m ;
-
-# For <runtime-link>static we made sure there are no dynamic libraries in the
-# link.
-toolset.flags qcc.link OPTIONS <runtime-link>static : -static ;
-
-# Assuming this is just like with gcc.
-toolset.flags qcc.link RPATH : <dll-path> : unchecked ;
-toolset.flags qcc.link RPATH_LINK : <xdll-path> : unchecked ;
-
-
-# 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. For now, serialize only qcc links while it might
-    # be a good idea to serialize all links.
-    JAM_SEMAPHORE on $(targets) = <s>qcc-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-ST) -l$(FINDLIBS-SA) $(OPTIONS)
-}
-
-
-# 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
-RM = [ common.rm-command ] ;
-if [ os.name ] = NT
-{
-    RM = "if exist \"$(<[1])\" DEL \"$(<[1])\""  ;
-}
-
-
-# Declare action for creating static libraries. The 'r' letter means to add
-# files to the archive with replacement. Since we remove the archive, we do not
-# care about replacement, but there is no option to "add without replacement".
-# The 'c' letter suppresses warnings in case the archive does not exists yet.
-# That warning is produced only on some platforms, for whatever reasons.
-#
-# Use qcc driver to create archive, see
-#     http://www.qnx.com/developers/docs/6.3.2/neutrino/utilities/q/qcc.html
-actions piecemeal archive
-{
-    $(RM) "$(<)"
-    "$(CONFIG_COMMAND)" -A "$(<)" "$(>)"
-}
-
-
-rule link.dll ( targets * : sources * : properties * )
-{
-    SPACE on $(targets) = " " ;
-    JAM_SEMAPHORE on $(targets) = <s>qcc-link-semaphore ;
-}
-
-
-# Differ from 'link' above only by -shared.
-#
-actions link.dll bind LIBRARIES
-{
-    "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)"  "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS)
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/qt.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/qt.jam b/ext/kenlm/jam-files/boost-build/tools/qt.jam
deleted file mode 100644
index 8aa7ca2..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/qt.jam
+++ /dev/null
@@ -1,17 +0,0 @@
-#  Copyright (c) 2006 Vladimir Prus.
-#
-#  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)
-
-#  Forwarning toolset file to Qt GUI library. Forwards to the toolset file
-#  for the current version of Qt.
-
-import qt4 ;
-
-rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : condition * )
-{
-    qt4.init $(prefix) : $(full_bin)  : $(full_inc) : $(full_lib) : $(version) : $(condition) ;
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/boost-build/tools/qt3.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/qt3.jam b/ext/kenlm/jam-files/boost-build/tools/qt3.jam
deleted file mode 100644
index f82cf0a..0000000
--- a/ext/kenlm/jam-files/boost-build/tools/qt3.jam
+++ /dev/null
@@ -1,209 +0,0 @@
-# Copyright 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) 
-
-# Support for the Qt GUI library version 3
-# (http://www.trolltech.com/products/qt3/index.html).
-# For new developments, it is recommended to use Qt4 via the qt4 Boost.Build
-# module.
-
-import modules ;
-import feature ;
-import errors ;
-import type ;
-import "class" : new ;
-import generators ;
-import project ;
-import toolset : flags ;
-
-# Convert this module into a project, so that we can declare targets here.
-project.initialize $(__name__) ;
-project qt3 ;
-
-
-# Initialized the QT support module. The 'prefix' parameter tells where QT is
-# installed. When not given, environmental variable QTDIR should be set.
-#
-rule init ( prefix ? )
-{
-    if ! $(prefix)
-    {
-        prefix = [ modules.peek : QTDIR ] ;
-        if ! $(prefix) 
-        {
-            errors.error 
-              "QT installation prefix not given and QTDIR variable is empty" ;
-        }        
-    }
- 
-    if $(.initialized)
-    {
-        if $(prefix) != $(.prefix)
-        {
-            errors.error 
-              "Attempt the reinitialize QT with different installation prefix" ;
-        }        
-    } 
-    else
-    {            
-        .initialized = true ;
-        .prefix = $(prefix) ;
-        
-        generators.register-standard qt3.moc : H : CPP(moc_%) : <allow>qt3 ;
-        # Note: the OBJ target type here is fake, take a look at
-        # qt4.jam/uic-h-generator for explanations that apply in this case as
-        # well.
-        generators.register [ new moc-h-generator-qt3 
-            qt3.moc.cpp : MOCCABLE_CPP : OBJ : <allow>qt3 ] ;
-        
-        # The UI type is defined in types/qt.jam, and UIC_H is only used in
-        # qt.jam, but not in qt4.jam, so define it here.
-        type.register UIC_H : : H ;
-        
-        generators.register-standard qt3.uic-h : UI : UIC_H : <allow>qt3 ;
-        
-        # The following generator is used to convert UI files to CPP. It creates
-        # UIC_H from UI, and constructs CPP from UI/UIC_H. In addition, it also
-        # returns UIC_H target, so that it can be mocced.
-        class qt::uic-cpp-generator : generator
-        {
-            rule __init__ ( )
-            {
-                generator.__init__ qt3.uic-cpp : UI UIC_H : CPP : <allow>qt3 ;
-            }
-                        
-            rule run ( project name ? : properties * : sources + )
-            {
-                # Consider this:
-                #    obj test : test_a.cpp : <optimization>off ;
-                #
-                # This generator will somehow be called in this case, and,
-                # will fail -- which is okay. However, if there are <library>
-                # properties they will be converted to sources, so the size of 
-                # 'sources' will be more than 1. In this case, the base generator
-                # will just crash -- and that's not good. Just use a quick test
-                # here.
-                                
-                local result ;
-                if ! $(sources[2])
-                {    
-                    # Construct CPP as usual
-                    result = [ generator.run $(project) $(name) 
-                      : $(properties) : $(sources) ] ;
-                    
-                    # If OK, process UIC_H with moc. It's pretty clear that
-                    # the object generated with UIC will have Q_OBJECT macro.
-                    if $(result)
-                    {
-                        local action = [ $(result[1]).action ] ;
-                        local sources = [ $(action).sources ] ;
-                        local mocced = [ generators.construct $(project) $(name)
-                          : CPP : $(properties) : $(sources[2]) ] ;
-                        result += $(mocced[2-]) ;
-                    }
-                }
-                            
-                return $(result) ;
-            }               
-        }
-    
-        generators.register [ new qt::uic-cpp-generator ] ;
-        
-        # Finally, declare prebuilt target for QT library.
-        local usage-requirements = 
-             <include>$(.prefix)/include 
-             <dll-path>$(.prefix)/lib
-             <library-path>$(.prefix)/lib     
-             <allow>qt3
-             ;  
-        lib qt : : <name>qt-mt <threading>multi : : $(usage-requirements) ;
-        lib qt : : <name>qt <threading>single : : $(usage-requirements) ;        
-    }
-}
-
-class moc-h-generator-qt3 : generator
-{
-    rule __init__ ( * : * )
-    {
-        generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
-    }
-
-    rule run ( project name ? : property-set : sources * )
-    {       
-        if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_CPP
-        {                              
-            name = [ $(sources[1]).name ] ;
-            name = $(name:B) ;
-            
-            local a = [ new action $(sources[1]) : qt3.moc.cpp :
-              $(property-set) ] ;
-            
-            local target = [ 
-              new file-target $(name) : MOC : $(project) : $(a) ] ;
-            
-            local r = [ virtual-target.register $(target) ] ; 
-                                  
-            # Since this generator will return a H target, the linking generator
-            # won't use it at all, and won't set any dependency on it. However, 
-            # we need the target to be seen by bjam, so that the dependency from
-            # sources to this generated header is detected -- if Jam does not
-            # know about this target, it won't do anything.
-            DEPENDS all : [ $(r).actualize ] ;
-            
-            return $(r) ;            
-        }        
-    }    
-}
-
-
-# Query the installation directory. This is needed in at least two scenarios.
-# First, when re-using sources from the Qt-Tree. Second, to "install" custom Qt
-# plugins to the Qt-Tree.
-#
-rule directory 
-{ 
-    return $(.prefix) ; 
-} 
-
-# -f forces moc to include the processed source file. Without it, it would think
-# that .qpp is not a header and would not include it from the generated file.
-#
-actions moc 
-{
-    $(.prefix)/bin/moc -f $(>) -o $(<)
-}
-
-# When moccing .cpp files, we don't need -f, otherwise generated code will
-# include .cpp and we'll get duplicated symbols.
-#
-actions moc.cpp
-{
-    $(.prefix)/bin/moc $(>) -o $(<)
-}
-
-
-space = " " ;
-
-# Sometimes it's required to make 'plugins' available during uic invocation. To
-# help with this we add paths to all dependency libraries to uic commane line.
-# The intention is that it's possible to write
-#    
-#     exe a : ... a.ui ... : <uses>some_plugin ; 
-# 
-# and have everything work. We'd add quite a bunch of unrelated paths but it
-# won't hurt.
-#
-flags qt3.uic-h LIBRARY_PATH <xdll-path> ;
-actions uic-h
-{
-    $(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH)
-}
-
-
-flags qt3.uic-cpp LIBRARY_PATH <xdll-path> ;
-# The second target is uic-generated header name. It's placed in build dir, but
-# we want to include it using only basename.
-actions uic-cpp
-{
-    $(.prefix)/bin/uic $(>[1]) -i $(>[2]:D=) -o $(<) -L$(space)$(LIBRARY_PATH)
-}