3 # This script calls MLton.
8 lib
=`cd "$dir/../lib/mlton" && pwd`
14 while [ "$#" -gt 0 -a "$1" != "--" ]; do
15 rargs
[${#rargs[@]}]="$1"
18 if [ "$#" -gt 0 -a "$1" == "--" ]; then
21 echo '@MLton missing --'
30 mlton_mlton
="$lib/mlton-compile$EXE"
31 if [ -x "$mlton_mlton" ]; then
32 exec "$mlton_mlton" @MLton ram-slop
0.5 "${rargs[@]}" -- "$@"
37 if $smlnj -h >/dev
/null
2>&1; then
38 smlnj_heap_suffix
=`echo 'TextIO.output (TextIO.stdErr, SMLofNJ.SysInfo.getHeapSuffix ());' | $smlnj 2>&1 1> /dev/null`
39 mlton_smlnj_heap
="$lib/mlton-smlnj.$smlnj_heap_suffix"
40 if [ -s "$mlton_smlnj_heap" ]; then
41 exec "$smlnj" @SMLload
="$mlton_smlnj_heap" "$@"
46 mlton_polyml
="$lib/mlton-polyml$EXE"
47 if [ -x "$mlton_polyml" ]; then
48 exec "$mlton_polyml" "$@"
56 echo 'Unable to run MLton. Check that lib is set properly.' >&2
62 # You may need to set 'GMP_INC_DIR' so the C compiler can find gmp.h.
64 if [ -n "$GMP_INC_DIR" ]; then
65 gmpCCOpts
="-cc-opt -I$GMP_INC_DIR"
67 # You may need to set 'GMP_LIB_DIR' so the C compiler can find libgmp.
69 if [ -n "$GMP_LIB_DIR" ]; then
70 gmpLinkOpts
="-link-opt -L$GMP_LIB_DIR -target-link-opt netbsd -Wl,-R$GMP_LIB_DIR"
74 -ar-script "$lib/static-library" \
76 -cc-opt '-std=gnu11 -fno-common' \
77 -cc-opt '-O1 -fomit-frame-pointer -fno-strict-aliasing' \
79 -cc-opt-quote "-I$lib/include" \
80 -link-opt '-lm -lgmp' \
81 $gmpCCOpts $gmpLinkOpts \
83 -llvm-opt-opt '-mem2reg -O2' \
84 -mlb-path-var 'SML_LIB $(LIB_MLTON_DIR)/sml' \
85 -target-as-opt amd64
'-m64' \
86 -target-as-opt x86
'-m32' \
87 -target-cc-opt alpha \
88 '-mieee -mbwx -mtune=ev6 -mfp-rounding-mode=d' \
89 -target-cc-opt amd64
'-m64' \
90 -target-cc-opt aix
'-maix64' \
91 -target-cc-opt ia64-hpux
"-mlp64" \
92 -target-cc-opt ia64
"-mtune=itanium2" \
93 -target-cc-opt sparc
'-m32 -mcpu=v8 -Wa,-xarch=v8plusa' \
102 -target-link-opt amd64
'-m64' \
103 -target-link-opt alpha \
104 '-mieee -mbwx -mtune=ev6 -mfp-rounding-mode=d' \
105 -target-link-opt aix
'-maix64' \
106 -target-link-opt ia64-hpux
"-mlp64" \
107 -target-link-opt linux
'-Wl,-znoexecstack' \
108 -target-link-opt mingw \
109 '-lws2_32 -lkernel32 -lpsapi -lnetapi32 -lwinmm' \
110 -target-link-opt mingw
'-Wl,--enable-stdcall-fixup' \
111 -target-link-opt solaris
'-lnsl -lsocket -lrt' \
112 -target-link-opt x86
'-m32' \
113 -profile-exclude '\$\(SML_LIB\)' \