File: run.sh

package info (click to toggle)
linksem 0.8%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,376 kB
  • sloc: asm: 9,188; ansic: 5,856; ml: 2,918; yacc: 1,310; lex: 721; sh: 119; makefile: 63
file content (26 lines) | stat: -rwxr-xr-x 648 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

# useful vars:
# EXT       -- ".opt" or ""
# DEBUGGER  -- e.g. "gdb --args" or "ocamldebug"

EXT="${EXT:-.opt}"

export OCAMLRUNPARAM=b

get_basename () {
 dir="$( dirname "$0" )"
 echo "dir is $dir" 1>&2
 basename "$( case "$dir" in (.) pwd ;; (*) echo "$dir" ;; esac)" | sed 's/-.*//'
}

basename="$(get_basename)"
echo "basename is $basename" 1>&2

outfile=`mktemp`
echo "outfile is $outfile" 1>&2

cd "$(dirname "$0")" && \
eval CAML_LD_LIBRARY_PATH=`pwd`/../../contrib/ocaml-uint/_build/lib:`pwd`/../../../lem/ocaml-lib/dependencies/zarith \
exec $DEBUGGER $( cat ./"$basename".repeat-cmd | sed 's#ld#../../src/main_link${EXT}#' )