From: Richard W.M. Jones Date: Thu, 19 Sep 2013 09:21:51 +0000 (+0100) Subject: goaljobs: Allow --package to specify OCaml packages. X-Git-Tag: 0.2~21 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=d279dc7cd16fec8bc839bc962ed910263bf457ce;p=goaljobs.git goaljobs: Allow --package to specify OCaml packages. --- diff --git a/goaljobs b/goaljobs index b7f929a..89e15e3 100755 --- a/goaljobs +++ b/goaljobs @@ -18,7 +18,7 @@ unset CDPATH -TEMP=`getopt -o 'gI:o:' --long 'help,pkgdir:' -n goaljobs -- "$@"` +TEMP=`getopt -o 'gI:o:' --long 'help,package:,pkgdir:' -n goaljobs -- "$@"` if [ $? -ne 0 ]; then echo "goaljobs: could not parse command line arguments" exit 1 @@ -47,6 +47,10 @@ while true; do -o) output="$2" shift 2;; + --package) + passthru[i++]="-package" + passthru[i++]="$2" + shift 2;; --pkgdir) pkgdir="$2" shift 2;; @@ -137,8 +141,8 @@ fi # Compile the input file(s). echo \ -ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -o "$output" -ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -o "$output" +ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -linkpkg -o "$output" +ocamlfind $best "${passthru[@]}" "${pkg[@]}" "$@" $main -linkpkg -o "$output" mainbase="$(echo $main | sed s,\.ml$,,)" rm -f "$mainbase"*