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:15 UTC
[27/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/engine/compile.c
----------------------------------------------------------------------
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/engine/compile.c b/ext/kenlm/jam-files/engine/compile.c
deleted file mode 100644
index db46937..0000000
--- a/ext/kenlm/jam-files/engine/compile.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Copyright 1993, 2000 Christopher Seiwald.
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-/* This file is ALSO:
- * Copyright 2001-2004 David Abrahams.
- * 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)
- */
-
-/*
- * compile.c - compile parsed jam statements
- *
- * External routines:
- * evaluate_rule() - execute a rule invocation
- *
- * Internal routines:
- * debug_compile() - printf with indent to show rule expansion
- */
-
-#include "jam.h"
-#include "compile.h"
-
-#include "builtins.h"
-#include "class.h"
-#include "constants.h"
-#include "hash.h"
-#include "hdrmacro.h"
-#include "make.h"
-#include "modules.h"
-#include "parse.h"
-#include "rules.h"
-#include "search.h"
-#include "strings.h"
-#include "variable.h"
-
-#include <assert.h>
-#include <stdarg.h>
-#include <string.h>
-
-
-static void debug_compile( int which, char const * s, FRAME * );
-
-/* Internal functions from builtins.c */
-void backtrace( FRAME * );
-void backtrace_line( FRAME * );
-void print_source_line( FRAME * );
-void unknown_rule( FRAME *, char const * key, module_t *, OBJECT * rule_name );
-
-
-/*
- * evaluate_rule() - execute a rule invocation
- */
-
-LIST * evaluate_rule( RULE * rule, OBJECT * rulename, FRAME * frame )
-{
- LIST * result = L0;
- profile_frame prof[ 1 ];
- module_t * prev_module = frame->module;
-
- if ( DEBUG_COMPILE )
- {
- /* Try hard to indicate in which module the rule is going to execute. */
- char buf[ 256 ] = "";
- if ( rule->module->name )
- {
- strncat( buf, object_str( rule->module->name ), sizeof( buf ) -
- 1 );
- strncat( buf, ".", sizeof( buf ) - 1 );
- if ( strncmp( buf, object_str( rule->name ), strlen( buf ) ) == 0 )
- {
- buf[ 0 ] = 0;
- }
- }
- strncat( buf, object_str( rule->name ), sizeof( buf ) - 1 );
- debug_compile( 1, buf, frame );
-
- lol_print( frame->args );
- printf( "\n" );
- }
-
- if ( rule->procedure && rule->module != prev_module )
- {
- /* Propagate current module to nested rule invocations. */
- frame->module = rule->module;
- }
-
- /* Record current rule name in frame. */
- if ( rule->procedure )
- {
- frame->rulename = object_str( rulename );
- /* And enter record profile info. */
- if ( DEBUG_PROFILE )
- profile_enter( function_rulename( rule->procedure ), prof );
- }
-
- /* Check traditional targets $(<) and sources $(>). */
- if ( !rule->actions && !rule->procedure )
- unknown_rule( frame, NULL, frame->module, rule->name );
-
- /* If this rule will be executed for updating the targets then construct the
- * action for make().
- */
- if ( rule->actions )
- {
- TARGETS * t;
-
- /* The action is associated with this instance of this rule. */
- ACTION * const action = (ACTION *)BJAM_MALLOC( sizeof( ACTION ) );
- memset( (char *)action, '\0', sizeof( *action ) );
-
- action->rule = rule;
- action->targets = targetlist( (TARGETS *)0, lol_get( frame->args, 0 ) );
- action->sources = targetlist( (TARGETS *)0, lol_get( frame->args, 1 ) );
- action->refs = 1;
-
- /* If we have a group of targets all being built using the same action
- * then we must not allow any of them to be used as sources unless they
- * are all up to date and their action does not need to be run or their
- * action has had a chance to finish its work and build all of them
- * anew.
- *
- * Without this it might be possible, in case of a multi-process build,
- * for their action, triggered to building one of the targets, to still
- * be running when another target in the group reports as done in order
- * to avoid triggering the same action again and gets used prematurely.
- *
- * As a quick-fix to achieve this effect we make all the targets list
- * each other as 'included targets'. More precisely, we mark the first
- * listed target as including all the other targets in the list and vice
- * versa. This makes anyone depending on any of those targets implicitly
- * depend on all of them, thus making sure none of those targets can be
- * used as sources until all of them have been built. Note that direct
- * dependencies could not have been used due to the 'circular
- * dependency' issue.
- *
- * TODO: Although the current implementation solves the problem of one
- * of the targets getting used before its action completes its work, it
- * also forces the action to run whenever any of the targets in the
- * group is not up to date even though some of them might not actually
- * be used by the targets being built. We should see how we can
- * correctly recognize such cases and use that to avoid running the
- * action if possible and not rebuild targets not actually depending on
- * targets that are not up to date.
- *
- * TODO: Current solution using fake INCLUDES relations may cause
- * actions to be run when the affected targets are built by multiple
- * actions. E.g. if we have the following actions registered in the
- * order specified:
- * (I) builds targets A & B
- * (II) builds target B
- * and we want to build a target depending on target A, then both
- * actions (I) & (II) will be run, even though the second one does not
- * have any direct relationship to target A. Consider whether this is
- * desired behaviour or not. It could be that Boost Build should (or
- * possibly already does) run all actions registered for a given target
- * if any of them needs to be run in which case our INCLUDES relations
- * are not actually causing any actions to be run that would not have
- * been run without them.
- */
- if ( action->targets )
- {
- TARGET * const t0 = action->targets->target;
- for ( t = action->targets->next; t; t = t->next )
- {
- target_include( t->target, t0 );
- target_include( t0, t->target );
- }
- }
-
- /* Append this action to the actions of each target. */
- for ( t = action->targets; t; t = t->next )
- t->target->actions = actionlist( t->target->actions, action );
-
- action_free( action );
- }
-
- /* Now recursively compile any parse tree associated with this rule.
- * function_refer()/function_free() call pair added to ensure the rule does
- * not get freed while in use.
- */
- if ( rule->procedure )
- {
- FUNCTION * const function = rule->procedure;
- function_refer( function );
- result = function_run( function, frame, stack_global() );
- function_free( function );
- }
-
- if ( DEBUG_PROFILE && rule->procedure )
- profile_exit( prof );
-
- if ( DEBUG_COMPILE )
- debug_compile( -1, 0, frame );
-
- return result;
-}
-
-
-/*
- * Call the given rule with the specified parameters. The parameters should be
- * of type LIST* and end with a NULL pointer. This differs from 'evaluate_rule'
- * in that frame for the called rule is prepared inside 'call_rule'.
- *
- * This function is useful when a builtin rule (in C) wants to call another rule
- * which might be implemented in Jam.
- */
-
-LIST * call_rule( OBJECT * rulename, FRAME * caller_frame, ... )
-{
- va_list va;
- LIST * result;
-
- FRAME inner[ 1 ];
- frame_init( inner );
- inner->prev = caller_frame;
- inner->prev_user = caller_frame->module->user_module
- ? caller_frame
- : caller_frame->prev_user;
- inner->module = caller_frame->module;
-
- va_start( va, caller_frame );
- for ( ; ; )
- {
- LIST * const l = va_arg( va, LIST * );
- if ( !l )
- break;
- lol_add( inner->args, l );
- }
- va_end( va );
-
- result = evaluate_rule( bindrule( rulename, inner->module ), rulename, inner );
-
- frame_free( inner );
-
- return result;
-}
-
-
-/*
- * debug_compile() - printf with indent to show rule expansion
- */
-
-static void debug_compile( int which, char const * s, FRAME * frame )
-{
- static int level = 0;
- static char indent[ 36 ] = ">>>>|>>>>|>>>>|>>>>|>>>>|>>>>|>>>>|";
-
- if ( which >= 0 )
- {
- int i;
-
- print_source_line( frame );
-
- i = ( level + 1 ) * 2;
- while ( i > 35 )
- {
- fputs( indent, stdout );
- i -= 35;
- }
-
- printf( "%*.*s ", i, i, indent );
- }
-
- if ( s )
- printf( "%s ", s );
-
- level += which;
-}
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/compile.h
----------------------------------------------------------------------
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/engine/compile.h b/ext/kenlm/jam-files/engine/compile.h
deleted file mode 100644
index c70f98b..0000000
--- a/ext/kenlm/jam-files/engine/compile.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 1993, 2000 Christopher Seiwald.
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-/* This file is ALSO:
- * Copyright 2001-2004 David Abrahams.
- * 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)
- */
-
-/*
- * compile.h - compile parsed jam statements
- */
-
-#ifndef COMPILE_DWA20011022_H
-#define COMPILE_DWA20011022_H
-
-#include "frames.h"
-#include "lists.h"
-#include "object.h"
-#include "rules.h"
-
-void compile_builtins();
-
-LIST * evaluate_rule( RULE * rule, OBJECT * rulename, FRAME * );
-LIST * call_rule( OBJECT * rulename, FRAME * caller_frame, ... );
-
-/* Flags for compile_set(), etc */
-
-#define ASSIGN_SET 0x00 /* = assign variable */
-#define ASSIGN_APPEND 0x01 /* += append variable */
-#define ASSIGN_DEFAULT 0x02 /* set only if unset */
-
-/* Flags for compile_setexec() */
-
-#define EXEC_UPDATED 0x01 /* executes updated */
-#define EXEC_TOGETHER 0x02 /* executes together */
-#define EXEC_IGNORE 0x04 /* executes ignore */
-#define EXEC_QUIETLY 0x08 /* executes quietly */
-#define EXEC_PIECEMEAL 0x10 /* executes piecemeal */
-#define EXEC_EXISTING 0x20 /* executes existing */
-
-/* Conditions for compile_if() */
-
-#define EXPR_NOT 0 /* ! cond */
-#define EXPR_AND 1 /* cond && cond */
-#define EXPR_OR 2 /* cond || cond */
-#define EXPR_EXISTS 3 /* arg */
-#define EXPR_EQUALS 4 /* arg = arg */
-#define EXPR_NOTEQ 5 /* arg != arg */
-#define EXPR_LESS 6 /* arg < arg */
-#define EXPR_LESSEQ 7 /* arg <= arg */
-#define EXPR_MORE 8 /* arg > arg */
-#define EXPR_MOREEQ 9 /* arg >= arg */
-#define EXPR_IN 10 /* arg in arg */
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/constants.c
----------------------------------------------------------------------
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/engine/constants.c b/ext/kenlm/jam-files/engine/constants.c
deleted file mode 100644
index 891d322..0000000
--- a/ext/kenlm/jam-files/engine/constants.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2011 Steven Watanabe
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-/*
- * constants.c - constant objects
- *
- * External functions:
- *
- * constants_init() - initialize constants
- * constants_done() - free constants
- *
- */
-
-#include "constants.h"
-
-
-void constants_init( void )
-{
- constant_empty = object_new( "" );
- constant_dot = object_new( "." );
- constant_plus = object_new( "+" );
- constant_star = object_new( "*" );
- constant_question_mark = object_new( "?" );
- constant_ok = object_new( "ok" );
- constant_true = object_new( "true" );
- constant_name = object_new( "__name__" );
- constant_bases = object_new( "__bases__" );
- constant_class = object_new( "__class__" );
- constant_typecheck = object_new( ".typecheck" );
- constant_builtin = object_new( "(builtin)" );
- constant_HCACHEFILE = object_new( "HCACHEFILE" );
- constant_HCACHEMAXAGE = object_new( "HCACHEMAXAGE" );
- constant_HDRSCAN = object_new( "HDRSCAN" );
- constant_HDRRULE = object_new( "HDRRULE" );
- constant_BINDRULE = object_new( "BINDRULE" );
- constant_LOCATE = object_new( "LOCATE" );
- constant_SEARCH = object_new( "SEARCH" );
- constant_JAM_SEMAPHORE = object_new( "JAM_SEMAPHORE" );
- constant_TIMING_RULE = object_new( "__TIMING_RULE__" );
- constant_ACTION_RULE = object_new( "__ACTION_RULE__" );
- constant_JAMSHELL = object_new( "JAMSHELL" );
- constant_TMPDIR = object_new( "TMPDIR" );
- constant_TMPNAME = object_new( "TMPNAME" );
- constant_TMPFILE = object_new( "TMPFILE" );
- constant_STDOUT = object_new( "STDOUT" );
- constant_STDERR = object_new( "STDERR" );
- constant_JAMDATE = object_new( "JAMDATE" );
- constant_JAM_TIMESTAMP_RESOLUTION = object_new( "JAM_TIMESTAMP_RESOLUTION" );
- constant_JAM_VERSION = object_new( "JAM_VERSION" );
- constant_JAMUNAME = object_new( "JAMUNAME" );
- constant_ENVIRON = object_new( ".ENVIRON" );
- constant_ARGV = object_new( "ARGV" );
- constant_all = object_new( "all" );
- constant_PARALLELISM = object_new( "PARALLELISM" );
- constant_KEEP_GOING = object_new( "KEEP_GOING" );
- constant_other = object_new( "[OTHER]" );
- constant_total = object_new( "[TOTAL]" );
- constant_FILE_DIRSCAN = object_new( "FILE_DIRSCAN" );
- constant_MAIN = object_new( "MAIN" );
- constant_MAIN_MAKE = object_new( "MAIN_MAKE" );
- constant_MAKE_MAKE0 = object_new( "MAKE_MAKE0" );
- constant_MAKE_MAKE1 = object_new( "MAKE_MAKE1" );
- constant_MAKE_MAKE0SORT = object_new( "MAKE_MAKE0SORT" );
- constant_BINDMODULE = object_new( "BINDMODULE" );
- constant_IMPORT_MODULE = object_new( "IMPORT_MODULE" );
- constant_BUILTIN_GLOB_BACK = object_new( "BUILTIN_GLOB_BACK" );
- constant_timestamp = object_new( "timestamp" );
- constant_python = object_new("__python__");
- constant_python_interface = object_new( "python_interface" );
- constant_extra_pythonpath = object_new( "EXTRA_PYTHONPATH" );
- constant_MAIN_PYTHON = object_new( "MAIN_PYTHON" );
-}
-
-void constants_done( void )
-{
- object_free( constant_empty );
- object_free( constant_dot );
- object_free( constant_plus );
- object_free( constant_star );
- object_free( constant_question_mark );
- object_free( constant_ok );
- object_free( constant_true );
- object_free( constant_name );
- object_free( constant_bases );
- object_free( constant_class );
- object_free( constant_typecheck );
- object_free( constant_builtin );
- object_free( constant_HCACHEFILE );
- object_free( constant_HCACHEMAXAGE );
- object_free( constant_HDRSCAN );
- object_free( constant_HDRRULE );
- object_free( constant_BINDRULE );
- object_free( constant_LOCATE );
- object_free( constant_SEARCH );
- object_free( constant_JAM_SEMAPHORE );
- object_free( constant_TIMING_RULE );
- object_free( constant_ACTION_RULE );
- object_free( constant_JAMSHELL );
- object_free( constant_TMPDIR );
- object_free( constant_TMPNAME );
- object_free( constant_TMPFILE );
- object_free( constant_STDOUT );
- object_free( constant_STDERR );
- object_free( constant_JAMDATE );
- object_free( constant_JAM_TIMESTAMP_RESOLUTION );
- object_free( constant_JAM_VERSION );
- object_free( constant_JAMUNAME );
- object_free( constant_ENVIRON );
- object_free( constant_ARGV );
- object_free( constant_all );
- object_free( constant_PARALLELISM );
- object_free( constant_KEEP_GOING );
- object_free( constant_other );
- object_free( constant_total );
- object_free( constant_FILE_DIRSCAN );
- object_free( constant_MAIN );
- object_free( constant_MAIN_MAKE );
- object_free( constant_MAKE_MAKE0 );
- object_free( constant_MAKE_MAKE1 );
- object_free( constant_MAKE_MAKE0SORT );
- object_free( constant_BINDMODULE );
- object_free( constant_IMPORT_MODULE );
- object_free( constant_BUILTIN_GLOB_BACK );
- object_free( constant_timestamp );
- object_free( constant_python );
- object_free( constant_python_interface );
- object_free( constant_extra_pythonpath );
- object_free( constant_MAIN_PYTHON );
-}
-
-OBJECT * constant_empty;
-OBJECT * constant_dot;
-OBJECT * constant_plus;
-OBJECT * constant_star;
-OBJECT * constant_question_mark;
-OBJECT * constant_ok;
-OBJECT * constant_true;
-OBJECT * constant_name;
-OBJECT * constant_bases;
-OBJECT * constant_class;
-OBJECT * constant_typecheck;
-OBJECT * constant_builtin;
-OBJECT * constant_HCACHEFILE;
-OBJECT * constant_HCACHEMAXAGE;
-OBJECT * constant_HDRSCAN;
-OBJECT * constant_HDRRULE;
-OBJECT * constant_BINDRULE;
-OBJECT * constant_LOCATE;
-OBJECT * constant_SEARCH;
-OBJECT * constant_JAM_SEMAPHORE;
-OBJECT * constant_TIMING_RULE;
-OBJECT * constant_ACTION_RULE;
-OBJECT * constant_JAMSHELL;
-OBJECT * constant_TMPDIR;
-OBJECT * constant_TMPNAME;
-OBJECT * constant_TMPFILE;
-OBJECT * constant_STDOUT;
-OBJECT * constant_STDERR;
-OBJECT * constant_JAMDATE;
-OBJECT * constant_JAM_VERSION;
-OBJECT * constant_JAMUNAME;
-OBJECT * constant_ENVIRON;
-OBJECT * constant_ARGV;
-OBJECT * constant_all;
-OBJECT * constant_PARALLELISM;
-OBJECT * constant_KEEP_GOING;
-OBJECT * constant_other;
-OBJECT * constant_total;
-OBJECT * constant_FILE_DIRSCAN;
-OBJECT * constant_MAIN;
-OBJECT * constant_MAIN_MAKE;
-OBJECT * constant_MAKE_MAKE0;
-OBJECT * constant_MAKE_MAKE1;
-OBJECT * constant_MAKE_MAKE0SORT;
-OBJECT * constant_BINDMODULE;
-OBJECT * constant_IMPORT_MODULE;
-OBJECT * constant_BUILTIN_GLOB_BACK;
-OBJECT * constant_timestamp;
-OBJECT * constant_JAM_TIMESTAMP_RESOLUTION;
-OBJECT * constant_python;
-OBJECT * constant_python_interface;
-OBJECT * constant_extra_pythonpath;
-OBJECT * constant_MAIN_PYTHON;
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/constants.h
----------------------------------------------------------------------
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/engine/constants.h b/ext/kenlm/jam-files/engine/constants.h
deleted file mode 100644
index 60d7073..0000000
--- a/ext/kenlm/jam-files/engine/constants.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2011 Steven Watanabe
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-/*
- * constants.h - constant objects
- */
-
-#ifndef BOOST_JAM_CONSTANTS_H
-#define BOOST_JAM_CONSTANTS_H
-
-#include "object.h"
-
-void constants_init( void );
-void constants_done( void );
-
-extern OBJECT * constant_empty; /* "" */
-extern OBJECT * constant_dot; /* "." */
-extern OBJECT * constant_plus; /* "+" */
-extern OBJECT * constant_star; /* "*" */
-extern OBJECT * constant_question_mark; /* "?" */
-extern OBJECT * constant_ok; /* "ok" */
-extern OBJECT * constant_true; /* "true" */
-extern OBJECT * constant_name; /* "__name__" */
-extern OBJECT * constant_bases; /* "__bases__" */
-extern OBJECT * constant_class; /* "__class__" */
-extern OBJECT * constant_typecheck; /* ".typecheck" */
-extern OBJECT * constant_builtin; /* "(builtin)" */
-extern OBJECT * constant_HCACHEFILE; /* "HCACHEFILE" */
-extern OBJECT * constant_HCACHEMAXAGE; /* "HCACHEMAXAGE" */
-extern OBJECT * constant_HDRSCAN; /* "HDRSCAN" */
-extern OBJECT * constant_HDRRULE; /* "HDRRULE" */
-extern OBJECT * constant_BINDRULE; /* "BINDRULE" */
-extern OBJECT * constant_LOCATE; /* "LOCATE" */
-extern OBJECT * constant_SEARCH; /* "SEARCH" */
-extern OBJECT * constant_JAM_SEMAPHORE; /* "JAM_SEMAPHORE" */
-extern OBJECT * constant_TIMING_RULE; /* "__TIMING_RULE__" */
-extern OBJECT * constant_ACTION_RULE; /* "__ACTION_RULE__" */
-extern OBJECT * constant_JAMSHELL; /* "JAMSHELL" */
-extern OBJECT * constant_TMPDIR; /* "TMPDIR" */
-extern OBJECT * constant_TMPNAME; /* "TMPNAME" */
-extern OBJECT * constant_TMPFILE; /* "TMPFILE" */
-extern OBJECT * constant_STDOUT; /* "STDOUT" */
-extern OBJECT * constant_STDERR; /* "STDERR" */
-extern OBJECT * constant_JAMDATE; /* "JAMDATE" */
-extern OBJECT * constant_JAM_TIMESTAMP_RESOLUTION; /* "JAM_TIMESTAMP_RESOLUTION" */
-extern OBJECT * constant_JAM_VERSION; /* "JAM_VERSION" */
-extern OBJECT * constant_JAMUNAME; /* "JAMUNAME" */
-extern OBJECT * constant_ENVIRON; /* ".ENVIRON" */
-extern OBJECT * constant_ARGV; /* "ARGV" */
-extern OBJECT * constant_all; /* "all" */
-extern OBJECT * constant_PARALLELISM; /* "PARALLELISM" */
-extern OBJECT * constant_KEEP_GOING; /* "KEEP_GOING" */
-extern OBJECT * constant_other; /* "[OTHER]" */
-extern OBJECT * constant_total; /* "[TOTAL]" */
-extern OBJECT * constant_FILE_DIRSCAN; /* "FILE_DIRSCAN" */
-extern OBJECT * constant_MAIN; /* "MAIN" */
-extern OBJECT * constant_MAIN_MAKE; /* "MAIN_MAKE" */
-extern OBJECT * constant_MAKE_MAKE0; /* "MAKE_MAKE0" */
-extern OBJECT * constant_MAKE_MAKE1; /* "MAKE_MAKE1" */
-extern OBJECT * constant_MAKE_MAKE0SORT; /* "MAKE_MAKE0SORT" */
-extern OBJECT * constant_BINDMODULE; /* "BINDMODULE" */
-extern OBJECT * constant_IMPORT_MODULE; /* "IMPORT_MODULE" */
-extern OBJECT * constant_BUILTIN_GLOB_BACK; /* "BUILTIN_GLOB_BACK" */
-extern OBJECT * constant_timestamp; /* "timestamp" */
-extern OBJECT * constant_python; /* "__python__" */
-extern OBJECT * constant_python_interface; /* "python_interface" */
-extern OBJECT * constant_extra_pythonpath; /* "EXTRA_PYTHONPATH" */
-extern OBJECT * constant_MAIN_PYTHON; /* "MAIN_PYTHON" */
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/cwd.c
----------------------------------------------------------------------
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/engine/cwd.c b/ext/kenlm/jam-files/engine/cwd.c
deleted file mode 100644
index 7ebe970..0000000
--- a/ext/kenlm/jam-files/engine/cwd.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2002. Vladimir Prus
- * Copyright 2005. Rene Rivera
- * 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)
- */
-
-#include "cwd.h"
-
-#include "jam.h"
-#include "mem.h"
-#include "pathsys.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-
-/* MinGW on Windows declares PATH_MAX in limits.h */
-#if defined( NT ) && !defined( __GNUC__ )
-# include <direct.h>
-# define PATH_MAX _MAX_PATH
-#else
-# include <unistd.h>
-# if defined( __COMO__ )
-# include <linux/limits.h>
-# endif
-#endif
-
-#ifndef PATH_MAX
-# define PATH_MAX 1024
-#endif
-
-
-static OBJECT * cwd_;
-
-
-void cwd_init( void )
-{
- int buffer_size = PATH_MAX;
- char * cwd_buffer = 0;
- int error;
-
- assert( !cwd_ );
-
- do
- {
- char * const buffer = BJAM_MALLOC_RAW( buffer_size );
- cwd_buffer = getcwd( buffer, buffer_size );
- error = errno;
- if ( cwd_buffer )
- {
- /* We store the path using its canonical/long/key format. */
- OBJECT * const cwd = object_new( cwd_buffer );
- cwd_ = path_as_key( cwd );
- object_free( cwd );
- }
- buffer_size *= 2;
- BJAM_FREE_RAW( buffer );
- }
- while ( !cwd_ && error == ERANGE );
-
- if ( !cwd_ )
- {
- perror( "can not get current working directory" );
- exit( EXITBAD );
- }
-}
-
-
-OBJECT * cwd( void )
-{
- assert( cwd_ );
- return cwd_;
-}
-
-
-void cwd_done( void )
-{
- assert( cwd_ );
- object_free( cwd_ );
- cwd_ = NULL;
-}
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/cwd.h
----------------------------------------------------------------------
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/engine/cwd.h b/ext/kenlm/jam-files/engine/cwd.h
deleted file mode 100644
index 886714a..0000000
--- a/ext/kenlm/jam-files/engine/cwd.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2002. 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)
- */
-
-/*
- * cwd.h - manages the current working folder information
- */
-
-#ifndef CWD_H
-#define CWD_H
-
-#include "object.h"
-
-
-/* cwd() - returns the current working folder */
-OBJECT * cwd( void );
-
-/* cwd_init() - initialize the cwd module functionality
- *
- * The current working folder can not change in Boost Jam so this function
- * gets the current working folder information from the OS and stores it
- * internally.
- *
- * Expected to be called at program startup before the program's current
- * working folder has been changed
- */
-void cwd_init( void );
-
-/* cwd_done() - cleans up the cwd module functionality */
-void cwd_done( void );
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debian/changelog
----------------------------------------------------------------------
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/engine/debian/changelog b/ext/kenlm/jam-files/engine/debian/changelog
deleted file mode 100644
index 2908428..0000000
--- a/ext/kenlm/jam-files/engine/debian/changelog
+++ /dev/null
@@ -1,72 +0,0 @@
-bjam (3.1.12-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Rene Rivera <gr...@redshift-software.com> Sat, 01 Oct 2005 00:00:00 +0000
-
-bjam (3.1.11-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Rene Rivera <gr...@redshift-software.com> Sat, 30 Apr 2005 00:00:00 +0000
-
-bjam (3.1.10-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Rene Rivera <gr...@redshift-software.com> Tue, 1 Jun 2004 05:42:35 +0000
-
-bjam (3.1.9-2) unstable; urgency=low
-
- * Use default value of BOOST_BUILD_PATH is not is set in environment.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Wed, 17 Dec 2003 16:44:35 +0300
-
-bjam (3.1.9-1) unstable; urgency=low
-
- * Implement NATIVE_FILE builtin and several native rules.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Thu, 11 Dec 2003 13:15:26 +0300
-
-bjam (3.1.8-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Tue, 4 Nov 2003 20:50:43 +0300
-
-bjam (3.1.7-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Thu, 11 Sep 2003 10:45:44 +0400
-
-bjam (3.1.6-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Tue, 1 Jul 2003 09:12:18 +0400
-
-bjam (3.1.5-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Mon, 19 May 2003 14:05:13 +0400
-
-bjam (3.1.3-2) unstable; urgency=low
-
- * Changed Debian package to be similar to Jam's package.
-
- -- Vladimir Prus <gh...@cs.msu.su> Thu, 10 Oct 2002 18:43:26 +0400
-
-bjam (3.1.3-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Vladimir Prus <gh...@zigzag.lvk.cs.msu.su> Fri, 4 Oct 2002 18:16:54 +0400
-
-bjam (3.1.2-1) unstable; urgency=low
-
- * Initial Release.
-
- -- Vladimir Prus <gh...@cs.msu.su> Wed, 14 Aug 2002 14:08:00 +0400
-
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debian/control
----------------------------------------------------------------------
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/engine/debian/control b/ext/kenlm/jam-files/engine/debian/control
deleted file mode 100644
index c7f1519..0000000
--- a/ext/kenlm/jam-files/engine/debian/control
+++ /dev/null
@@ -1,16 +0,0 @@
-Source: bjam
-Section: devel
-Priority: optional
-Maintainer: Vladimir Prus <gh...@cs.msu.su>
-Build-Depends: debhelper (>> 3.0.0), docbook-to-man, bison
-Standards-Version: 3.5.2
-
-Package: bjam
-Architecture: any
-Depends: ${shlibs:Depends}
-Description: Build tool
- Boost.Jam is a portable build tool with its own interpreted language, which
- allows to implement rather complex logic in a readable way and without
- resorting to external programs. It is a descendant of Jam/MR tool modified to
- suit the needs of Boost.Build. In particular, modules and rule parameters
- were added, as well as several new builtins.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debian/copyright
----------------------------------------------------------------------
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/engine/debian/copyright b/ext/kenlm/jam-files/engine/debian/copyright
deleted file mode 100644
index f72e4e3..0000000
--- a/ext/kenlm/jam-files/engine/debian/copyright
+++ /dev/null
@@ -1,25 +0,0 @@
-This package was debianized by Vladimir Prus <gh...@cs.msu.su> on
-Wed, 17 July 2002, 19:27:00 +0400.
-
-Copyright:
-
- /+\
- +\ Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
- \+/
-
- This is Release 2.4 of Jam/MR, a make-like program.
-
- License is hereby granted to use this software and distribute it
- freely, as long as this copyright notice is retained and modifications
- are clearly marked.
-
- ALL WARRANTIES ARE HEREBY DISCLAIMED.
-
-Some portions are also:
-
- Copyright 2001-2006 David Abrahams.
- Copyright 2002-2006 Rene Rivera.
- Copyright 2003-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)
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debian/jam.man.sgml
----------------------------------------------------------------------
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/engine/debian/jam.man.sgml b/ext/kenlm/jam-files/engine/debian/jam.man.sgml
deleted file mode 100644
index ee21d4d..0000000
--- a/ext/kenlm/jam-files/engine/debian/jam.man.sgml
+++ /dev/null
@@ -1,236 +0,0 @@
-<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.sgml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.sgml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.sgml
- docbook-to-man $< > $@
- -->
-
- <!ENTITY dhfirstname "<firstname>Yann</firstname>">
- <!ENTITY dhsurname "<surname>Dirson</surname>">
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY dhdate "<date>mai 23, 2001</date>">
- <!ENTITY dhemail "<email>dirson@debian.org</email>">
- <!ENTITY dhusername "Yann Dirson">
- <!ENTITY dhpackage "jam">
-
- <!ENTITY debian "<productname>Debian GNU/Linux</productname>">
- <!ENTITY gnu "<acronym>GNU</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- <copyright>
- <year>2001</year>
- <holder>&dhusername;</holder>
- </copyright>
- &dhdate;
- </refentryinfo>
-
- <refmeta>
- <refentrytitle>JAM</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
-
- <refnamediv>
- <refname>Jam/MR</refname>
- <refpurpose>Make(1) Redux</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>jam</command>
-
- <arg><option>-a</option></arg>
- <arg><option>-n</option></arg>
- <arg><option>-v</option></arg>
-
- <arg><option>-d <replaceable/debug/</option></arg>
- <arg><option>-f <replaceable/jambase/</option></arg>
- <arg><option>-j <replaceable/jobs/</option></arg>
- <arg><option>-o <replaceable/actionsfile/</option></arg>
- <arg><option>-s <replaceable/var/=<replaceable/value/</option></arg>
- <arg><option>-t <replaceable/target/</option></arg>
-
- <arg repeat><option><replaceable/target/</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>DESCRIPTION</title>
-
- <para>Jam is a program construction tool, like make(1).</para>
-
- <para>Jam recursively builds target files from source files, using
- dependency information and updating actions expressed in the
- Jambase file, which is written in jam's own interpreted language.
- The default Jambase is compiled into jam and provides a
- boilerplate for common use, relying on a user-provide file
- "Jamfile" to enumerate actual targets and sources.</para>
- </refsect1>
-
- <refsect1>
- <title>OPTIONS</title>
-
- <variablelist>
- <varlistentry>
- <term><option/-a/</term>
- <listitem>
- <para>Build all targets anyway, even if they are up-to-date.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d <replaceable/n/</option></term>
- <listitem>
- <para>Enable cummulative debugging levels from 1 to
- <replaceable/n/. Interesting values are:
-
- <glosslist>
- <glossentry><glossterm/1/ <glossdef><simpara/Show
- actions (the default)/</glossdef></glossentry>
-
- <glossentry><glossterm/2/ <glossdef><simpara/Show
- "quiet" actions and display all action
- text/</glossdef></glossentry>
-
- <glossentry><glossterm/3/ <glossdef><simpara>Show
- dependency analysis, and target/source
- timestamps/paths</simpara></glossdef></glossentry>
-
- <glossentry><glossterm/4/ <glossdef><simpara/Show shell
- arguments/</glossdef></glossentry>
-
- <glossentry><glossterm/5/ <glossdef><simpara/Show rule
- invocations and variable
- expansions/</glossdef></glossentry>
-
- <glossentry><glossterm/6/ <glossdef><simpara>Show
- directory/header file/archive
- scans</simpara></glossdef></glossentry>
-
- <glossentry><glossterm/7/ <glossdef><simpara/Show
- variable settings/</glossdef></glossentry>
-
- <glossentry><glossterm/8/ <glossdef><simpara/Show
- variable fetches/</glossdef></glossentry>
-
- <glossentry><glossterm/9/ <glossdef><simpara/Show
- variable manipulation, scanner
- tokens/</glossdef></glossentry>
- </glosslist>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d +<replaceable/n/</option></term>
- <listitem>
- <para>Enable debugging level <replaceable/n/.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option/-d 0/</term>
- <listitem>
- <para>Turn off all debugging levels. Only errors are not
- suppressed.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-f <replaceable/jambase/</option></term>
- <listitem>
- <para>Read <replaceable/jambase/ instead of using the
- built-in Jambase. Only one <option/-f/ flag is permitted,
- but the <replaceable/jambase/ may explicitly include other
- files.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-j <replaceable/n/</option></term>
- <listitem>
- <para>Run up to <replaceable/n/ shell commands concurrently
- (UNIX and NT only). The default is 1.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option/-n/</term>
- <listitem>
- <para>Don't actually execute the updating actions, but do
- everything else. This changes the debug level default to
- <option/-d2/.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-o <replaceable/file/</option></term>
- <listitem>
- <para>Write the updating actions to the specified file
- instead of running them (or outputting them, as on the
- Mac).</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-s <replaceable/var/=<replaceable/value/</option></term>
- <listitem>
- <para>Set the variable <replaceable/var/ to
- <replaceable/value/, overriding both internal variables and
- variables imported from the environment. </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-t <replaceable/target/</option></term>
- <listitem>
- <para>Rebuild <replaceable/target/ and everything that
- depends on it, even if it is up-to-date.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option/-v/</term>
- <listitem>
- <para>Print the version of jam and exit.</para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </refsect1>
-
- <refsect1>
- <title>SEE ALSO</title>
-
- <para>Jam is documented fully in HTML pages available on Debian
- systems from
- <filename>/usr/share/doc/jam/Jam.html</filename>.</para>
- </refsect1>
-
- <refsect1>
- <title>AUTHOR</title>
-
- <para>This manual page was created by &dhusername; &dhemail; from
- the <filename/Jam.html/ documentation, for the &debian; system
- (but may be used by others).</para>
- </refsect1>
-</refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-sgml-omittag:t
-sgml-shorttag:t
-End:
--->
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debian/rules
----------------------------------------------------------------------
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/engine/debian/rules b/ext/kenlm/jam-files/engine/debian/rules
deleted file mode 100755
index 756052a..0000000
--- a/ext/kenlm/jam-files/engine/debian/rules
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-# GNU copyright 2001 by Yann Dirson.
-
-# This is the debian/rules file for packages jam and ftjam
-# It should be usable with both packages without any change
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This is the debhelper compatability version to use.
-export DH_COMPAT=3
-
-topdir=$(shell pwd)
-
-jam=bjam
-binname=bjam
-
-build: build-stamp
-build-stamp: debian/jam.1
- dh_testdir
-
- ./build.sh
-
- touch build-stamp
-
-%.1: %.man.sgml
- /usr/bin/docbook-to-man $< > $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
- rm -rf bin.*
- rm -f jam0 debian/jam.1
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- install -d ${topdir}/debian/${jam}/usr/bin
- install -m755 bin.linuxx86/bjam ${topdir}/debian/${jam}/usr/bin/
- install -d ${topdir}/debian/${jam}/usr/share/man/man1/
- install -m644 debian/jam.1 ${topdir}/debian/${jam}/usr/share/man/man1/${binname}.1
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installdocs README RELNOTES Jambase *.html
-# dh_installemacsen
-# dh_undocumented
- dh_installchangelogs
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debug.c
----------------------------------------------------------------------
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/engine/debug.c b/ext/kenlm/jam-files/engine/debug.c
deleted file mode 100644
index 2a65655..0000000
--- a/ext/kenlm/jam-files/engine/debug.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2005. Rene Rivera
- * 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)
- */
-
-#include "jam.h"
-#include "debug.h"
-
-#include "hash.h"
-
-
-static profile_frame * profile_stack = 0;
-static struct hash * profile_hash = 0;
-static profile_info profile_other = { 0 };
-static profile_info profile_total = { 0 };
-
-
-profile_frame * profile_init( OBJECT * rulename, profile_frame * frame )
-{
- if ( DEBUG_PROFILE ) profile_enter( rulename, frame );
- return frame;
-}
-
-
-void profile_enter( OBJECT * rulename, profile_frame * frame )
-{
- if ( DEBUG_PROFILE )
- {
- clock_t start = clock();
- profile_info * p;
-
- if ( !profile_hash && rulename )
- profile_hash = hashinit( sizeof( profile_info ), "profile" );
-
- if ( rulename )
- {
- int found;
- p = (profile_info *)hash_insert( profile_hash, rulename, &found );
- if ( !found )
- {
- p->name = rulename;
- p->cumulative = 0;
- p->net = 0;
- p->num_entries = 0;
- p->stack_count = 0;
- p->memory = 0;
- }
- }
- else
- {
- p = &profile_other;
- }
-
- ++p->num_entries;
- ++p->stack_count;
-
- frame->info = p;
-
- frame->caller = profile_stack;
- profile_stack = frame;
-
- frame->entry_time = clock();
- frame->overhead = 0;
- frame->subrules = 0;
-
- /* caller pays for the time it takes to play with the hash table */
- if ( frame->caller )
- frame->caller->overhead += frame->entry_time - start;
- }
-}
-
-
-void profile_memory( long mem )
-{
- if ( DEBUG_PROFILE )
- if ( profile_stack && profile_stack->info )
- profile_stack->info->memory += mem;
-}
-
-
-void profile_exit( profile_frame * frame )
-{
- if ( DEBUG_PROFILE )
- {
- /* Cumulative time for this call. */
- clock_t const t = clock() - frame->entry_time - frame->overhead;
- /* If this rule is already present on the stack, do not add the time for
- * this instance.
- */
- if ( frame->info->stack_count == 1 )
- frame->info->cumulative += t;
- /* Net time does not depend on presense of the same rule in call stack.
- */
- frame->info->net += t - frame->subrules;
-
- if ( frame->caller )
- {
- /* Caller's cumulative time must account for this overhead. */
- frame->caller->overhead += frame->overhead;
- frame->caller->subrules += t;
- }
- /* Pop this stack frame. */
- --frame->info->stack_count;
- profile_stack = frame->caller;
- }
-}
-
-
-static void dump_profile_entry( void * p_, void * ignored )
-{
- profile_info * p = (profile_info *)p_;
- unsigned long mem_each = ( p->memory / ( p->num_entries ? p->num_entries : 1
- ) );
- double cumulative = p->cumulative;
- double net = p->net;
- double q = p->net;
- q /= ( p->num_entries ? p->num_entries : 1 );
- cumulative /= CLOCKS_PER_SEC;
- net /= CLOCKS_PER_SEC;
- q /= CLOCKS_PER_SEC;
- if ( !ignored )
- {
- profile_total.cumulative += p->net;
- profile_total.memory += p->memory;
- }
- printf( "%10ld %12.6f %12.6f %12.8f %10ld %10ld %s\n", p->num_entries,
- cumulative, net, q, p->memory, mem_each, object_str( p->name ) );
-}
-
-
-void profile_dump()
-{
- if ( profile_hash )
- {
- printf( "%10s %12s %12s %12s %10s %10s %s\n", "--count--", "--gross--",
- "--net--", "--each--", "--mem--", "--each--", "--name--" );
- hashenumerate( profile_hash, dump_profile_entry, 0 );
- profile_other.name = constant_other;
- dump_profile_entry( &profile_other, 0 );
- profile_total.name = constant_total;
- dump_profile_entry( &profile_total, (void *)1 );
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/debug.h
----------------------------------------------------------------------
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/engine/debug.h b/ext/kenlm/jam-files/engine/debug.h
deleted file mode 100644
index 4151d27..0000000
--- a/ext/kenlm/jam-files/engine/debug.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2005. Rene Rivera
- * 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)
- */
-
-#ifndef BJAM_DEBUG_H
-#define BJAM_DEBUG_H
-
-#include "constants.h"
-#include "object.h"
-#include <time.h>
-
-
-typedef struct profile_info
-{
- /* name of rule being called */
- OBJECT * name;
- /* cumulative time spent in rule */
- clock_t cumulative;
- /* time spent in rule proper */
- clock_t net;
- /* number of time rule was entered */
- unsigned long num_entries;
- /* number of the times this function is present in stack */
- unsigned long stack_count;
- /* bytes of memory allocated by the call */
- unsigned long memory;
-} profile_info;
-
-typedef struct profile_frame
-{
- /* permanent storage where data accumulates */
- profile_info * info;
- /* overhead for profiling in this call */
- clock_t overhead;
- /* time of last entry to rule */
- clock_t entry_time;
- /* stack frame of caller */
- struct profile_frame * caller;
- /* time spent in subrules */
- clock_t subrules;
-} profile_frame;
-
-profile_frame * profile_init( OBJECT * rulename, profile_frame * );
-void profile_enter( OBJECT * rulename, profile_frame * );
-void profile_memory( long mem );
-void profile_exit( profile_frame * );
-void profile_dump();
-
-#define PROFILE_ENTER( scope ) profile_frame PROF_ ## scope, *PROF_ ## scope ## _p = profile_init( constant_ ## scope, &PROF_ ## scope )
-#define PROFILE_EXIT( scope ) profile_exit( PROF_ ## scope ## _p )
-
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/execcmd.c
----------------------------------------------------------------------
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/engine/execcmd.c b/ext/kenlm/jam-files/engine/execcmd.c
deleted file mode 100644
index f751cbf..0000000
--- a/ext/kenlm/jam-files/engine/execcmd.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 1993, 1995 Christopher Seiwald.
- * Copyright 2007 Noel Belcourt.
- *
- * Utility functions shared between different exec*.c platform specific
- * implementation modules.
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-#include "jam.h"
-#include "execcmd.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-
-
-/* Internal interrupt counter. */
-static int intr;
-
-
-/* Constructs a list of command-line elements using the format specified by the
- * given shell list.
- *
- * Given argv array should have at least MAXARGC + 1 elements.
- * Slot numbers may be between 0 and 998 (inclusive).
- *
- * Constructed argv list will be zero terminated. Character arrays referenced by
- * the argv structure elements will be either elements from the give shell list,
- * internal static buffers or the given command string and should thus not
- * considered owned by or released via the argv structure and should be
- * considered invalidated by the next argv_from_shell() call.
- *
- * Shell list elements:
- * - Starting with '%' - represent the command string.
- * - Starting with '!' - represent the slot number (increased by one).
- * - Anything else - used as a literal.
- * - If no '%' element is found, the command string is appended as an extra.
- */
-
-void argv_from_shell( char const * * argv, LIST * shell, char const * command,
- int const slot )
-{
- static char jobno[ 4 ];
-
- int i;
- int gotpercent = 0;
- LISTITER iter = list_begin( shell );
- LISTITER end = list_end( shell );
-
- assert( 0 <= slot );
- assert( slot < 999 );
- sprintf( jobno, "%d", slot + 1 );
-
- for ( i = 0; iter != end && i < MAXARGC; ++i, iter = list_next( iter ) )
- {
- switch ( object_str( list_item( iter ) )[ 0 ] )
- {
- case '%': argv[ i ] = command; ++gotpercent; break;
- case '!': argv[ i ] = jobno; break;
- default : argv[ i ] = object_str( list_item( iter ) );
- }
- }
-
- if ( !gotpercent )
- argv[ i++ ] = command;
-
- argv[ i ] = NULL;
-}
-
-
-/* Returns whether the given command string contains lines longer than the given
- * maximum.
- */
-int check_cmd_for_too_long_lines( char const * command, int const max,
- int * const error_length, int * const error_max_length )
-{
- while ( *command )
- {
- size_t const l = strcspn( command, "\n" );
- if ( l > max )
- {
- *error_length = l;
- *error_max_length = max;
- return EXEC_CHECK_LINE_TOO_LONG;
- }
- command += l;
- if ( *command )
- ++command;
- }
- return EXEC_CHECK_OK;
-}
-
-
-/* Checks whether the given shell list is actually a request to execute raw
- * commands without an external shell.
- */
-int is_raw_command_request( LIST * shell )
-{
- return !list_empty( shell ) &&
- !strcmp( object_str( list_front( shell ) ), "%" ) &&
- list_next( list_begin( shell ) ) == list_end( shell );
-}
-
-
-/* Returns whether an interrupt has been detected so far. */
-
-int interrupted( void )
-{
- return intr != 0;
-}
-
-
-/* Internal interrupt handler. */
-
-void onintr( int disp )
-{
- ++intr;
- printf( "...interrupted\n" );
-}
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/6da3961b/ext/kenlm/jam-files/engine/execcmd.h
----------------------------------------------------------------------
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/engine/execcmd.h b/ext/kenlm/jam-files/engine/execcmd.h
deleted file mode 100644
index ab145aa..0000000
--- a/ext/kenlm/jam-files/engine/execcmd.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 1993, 1995 Christopher Seiwald.
- *
- * This file is part of Jam - see jam.c for Copyright information.
- */
-
-/*
- * execcmd.h - execute a shell script.
- *
- * Defines the interface to be implemented in platform specific implementation
- * modules as well as different shared utility functions prepared in the
- * execcmd.c module.
- */
-
-#ifndef EXECCMD_H
-#define EXECCMD_H
-
-#include "lists.h"
-#include "strings.h"
-#include "timestamp.h"
-
-
-typedef struct timing_info
-{
- double system;
- double user;
- timestamp start;
- timestamp end;
-} timing_info;
-
-typedef void (* ExecCmdCallback)
-(
- void * const closure,
- int const status,
- timing_info const * const,
- char const * const cmd_stdout,
- char const * const cmd_stderr,
- int const cmd_exit_reason
-);
-
-/* Status codes passed to ExecCmdCallback routines. */
-#define EXEC_CMD_OK 0
-#define EXEC_CMD_FAIL 1
-#define EXEC_CMD_INTR 2
-
-int exec_check
-(
- string const * command,
- LIST * * pShell,
- int * error_length,
- int * error_max_length
-);
-
-/* exec_check() return codes. */
-#define EXEC_CHECK_OK 101
-#define EXEC_CHECK_NOOP 102
-#define EXEC_CHECK_LINE_TOO_LONG 103
-#define EXEC_CHECK_TOO_LONG 104
-
-void exec_cmd
-(
- string const * command,
- ExecCmdCallback func,
- void * closure,
- LIST * shell
-);
-
-void exec_wait();
-
-
-/******************************************************************************
- * *
- * Utility functions defined in the execcmd.c module. *
- * *
- ******************************************************************************/
-
-/* Constructs a list of command-line elements using the format specified by the
- * given shell list.
- */
-void argv_from_shell( char const * * argv, LIST * shell, char const * command,
- int const slot );
-
-/* Interrupt routine bumping the internal interrupt counter. Needs to be
- * registered by platform specific exec*.c modules.
- */
-void onintr( int disp );
-
-/* Returns whether an interrupt has been detected so far. */
-int interrupted( void );
-
-/* Checks whether the given shell list is actually a request to execute raw
- * commands without an external shell.
- */
-int is_raw_command_request( LIST * shell );
-
-/* Utility worker for exec_check() checking whether all the given command lines
- * are under the specified length limit.
- */
-int check_cmd_for_too_long_lines( char const * command, int const max,
- int * const error_length, int * const error_max_length );
-
-#endif