Install the goaljobs.a file, used for native code linking.
[goaljobs.git] / goaljobs
index b7f929a..756d527 100755 (executable)
--- 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;;
@@ -118,7 +122,9 @@ echo "Goaljobs.init ()" >> $main
 declare -a pkg
 if [ "$pkgdir" = "" ]; then
     pkg[0]="-package"
-    pkg[1]="goaljobs,goaljobs.syntax"
+    pkg[1]="goaljobs"
+    pkg[2]="-syntax"
+    pkg[3]="goaljobs"
 else
     # Get the dependencies manually.  Note that calendar requires
     # unix & str.
@@ -137,8 +143,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"*