comparison vext @ 1746:bf4a7015033e

Update vext
author Chris Cannam
date Fri, 06 Oct 2017 13:28:35 +0100
parents 669bd699082d
children 128c4544036d
comparison
equal deleted inserted replaced
1745:3587df7758e7 1746:bf4a7015033e
60 sml="mlton" 60 sml="mlton"
61 else cat 1>&2 <<EOF 61 else cat 1>&2 <<EOF
62 62
63 ERROR: No supported SML compiler or interpreter found 63 ERROR: No supported SML compiler or interpreter found
64 EOF 64 EOF
65 cat <<EOF 65 cat 1>&2 <<EOF
66 66
67 The Vext external source code manager needs a Standard ML (SML) 67 The Vext external source code manager needs a Standard ML (SML)
68 compiler or interpreter to run. 68 compiler or interpreter to run.
69 69
70 Please ensure you have one of the following SML implementations 70 Please ensure you have one of the following SML implementations
88 fi 88 fi
89 89
90 arglist="" 90 arglist=""
91 for arg in "$@"; do 91 for arg in "$@"; do
92 if [ -n "$arglist" ]; then arglist="$arglist,"; fi 92 if [ -n "$arglist" ]; then arglist="$arglist,"; fi
93 if echo "$arg" | grep -q '[^a-z]' ; then 93 if echo "$arg" | grep -q '["'"'"']' ; then
94 arglist="$arglist\"usage\"" 94 arglist="$arglist\"usage\""
95 else 95 else
96 arglist="$arglist\"$arg\"" 96 arglist="$arglist\"$arg\""
97 fi 97 fi
98 done 98 done
108 echo 'use "'"$program"'"; vext ['"$arglist"'];' | 108 echo 'use "'"$program"'"; vext ['"$arglist"'];' |
109 poly -q --error-exit 109 poly -q --error-exit
110 fi ;; 110 fi ;;
111 mlton) 111 mlton)
112 if [ ! -x "$gen_out" ]; then 112 if [ ! -x "$gen_out" ]; then
113 echo "[Precompiling Vext binary...]" 1>&2
113 echo "val _ = main ()" | cat "$program" - > "$gen_sml" 114 echo "val _ = main ()" | cat "$program" - > "$gen_sml"
114 mlton -output "$gen_out" "$gen_sml" 115 mlton -output "$gen_out" "$gen_sml"
115 fi 116 fi
116 "$gen_out" "$@" ;; 117 "$gen_out" "$@" ;;
117 smlnj) 118 smlnj)
139 val _ = OS.Process.exit (OS.Process.success); 140 val _ = OS.Process.exit (OS.Process.success);
140 EOF 141 EOF
141 ) > "$gen_sml" 142 ) > "$gen_sml"
142 CM_VERBOSE=false sml "$gen_sml" ;; 143 CM_VERBOSE=false sml "$gen_sml" ;;
143 *) 144 *)
144 echo "Unknown SML implementation name: $sml"; 145 echo "ERROR: Unknown SML implementation name: $sml" 1>&2;
145 exit 2 ;; 146 exit 2 ;;
146 esac 147 esac
147 148