Repository: incubator-joshua
Updated Branches:
  refs/heads/master 574360b6b -> e7583e7dc


removed build_kenlm.sh dependency on $JOSHUA


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/e7583e7d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/e7583e7d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/e7583e7d

Branch: refs/heads/master
Commit: e7583e7dc686caa49e0f93c4c406372d776d2141
Parents: 574360b
Author: Matt Post <p...@cs.jhu.edu>
Authored: Tue Oct 18 09:14:24 2016 -0400
Committer: Matt Post <p...@cs.jhu.edu>
Committed: Tue Oct 18 09:14:24 2016 -0400

----------------------------------------------------------------------
 jni/build_kenlm.sh          |  3 +++
 scripts/misc/canonical_path | 10 ++++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/e7583e7d/jni/build_kenlm.sh
----------------------------------------------------------------------
diff --git a/jni/build_kenlm.sh b/jni/build_kenlm.sh
index 5cf7178..9e006d8 100755
--- a/jni/build_kenlm.sh
+++ b/jni/build_kenlm.sh
@@ -22,6 +22,9 @@ export CXXFLAGS+=" -O3 -fPIC -DHAVE_ZLIB"
 export LDFLAGS+=" -lz -lbz2 -llzma"
 export CXX=${CXX:-g++}
 
+export JOSHUA=$($JOSHUA/scripts/misc/canonical_path $(dirname $0)/..)
+echo "Using JOSHUA=$JOSHUA"
+
 cd $JOSHUA/ext/kenlm
 [[ ! -d build ]] && mkdir build
 cd build

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/e7583e7d/scripts/misc/canonical_path
----------------------------------------------------------------------
diff --git a/scripts/misc/canonical_path b/scripts/misc/canonical_path
new file mode 100755
index 0000000..7a21e93
--- /dev/null
+++ b/scripts/misc/canonical_path
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import os
+import argparse
+
+parser = argparse.ArgumentParser(description='Return canonical path')
+parser.add_argument('file', help='File or directory to absolutize')
+args = parser.parse_args()
+
+print os.path.realpath(args.file)

Reply via email to