File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 5757(rule
5858 (targets linking_main.sexp)
5959 (action (with-stdout-to %{targets}
60- (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} laolao_stubs threads camlrun))))
60+ (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} %{ocaml-config:system} laolao_stubs threads camlrun))))
6161(rule
6262 (targets linking_client.sexp)
6363 (action (with-stdout-to %{targets}
64- (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} threads camlrun))))
64+ (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} %{ocaml-config:system} threads camlrun))))
6565(rule
6666 (targets linking_server.sexp)
6767 (action (with-stdout-to %{targets}
68- (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} laolao_stubs threadsnat))))
68+ (run ./linking_flags.sh %{env:LINKING_MODE=dynamic} -- laolao_stubs threadsnat))))
Original file line number Diff line number Diff line change @@ -7,16 +7,28 @@ set -ue
77
88LC_ALL=C
99
10+ help_exit () {
11+ echo " Usage: $0 dynamic|static linux|macosx [extra-libs]" >&2
12+ exit 2
13+ }
14+
15+ [ $# -lt 2 ] && help_exit
16+
1017echo " ;; generated by $0 "
1118
1219case " $1 " in
1320 dynamic) echo " ()" ; exit 0;;
1421 static) ;;
15- * ) echo " Invalid linking mode '$1 '. Usage: $0 dynamic|static [extra-libs] " >&2 ; exit 2
22+ * ) echo " Invalid linking mode '$1 '." ; help_exit
1623esac
1724
1825shift
19- EXTRA_LIBS=" $* "
26+ case " $1 " in
27+ macosx) shift ; EXTRA_LIBS=" curses $* " ;;
28+ linux) shift ; EXTRA_LIBS=" $* " ;;
29+ --) shift ; EXTRA_LIBS=" $* " ;;
30+ * ) echo " Not supported %{ocamlc-config:system} '$1 '." ; help_exit
31+ esac
2032
2133# # Static linking configuration ##
2234
You can’t perform that action at this time.
0 commit comments