forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_ocaml.cmd
36 lines (27 loc) · 1.3 KB
/
install_ocaml.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
REM Download and install OCaml and flexlink (unless it was already done).
REM Prepare the environment variables,... to use it. OCaml is installed
REM at %OCAMLROOT%
REM
REM If you are using Cygwin, install it in C:\cygwin first and then
REM execute this script. Execute bash with the option "-l".
REM set OCAMLROOT=%PROGRAMFILES%/OCaml
set OCAMLROOT=C:/PROGRA~1/OCaml
set OCAMLURL=https://github.com/Chris00/ocaml-appveyor/releases/download/0.2/ocaml-4.08.zip
REM Cygwin is always installed on AppVeyor. Its path must come
REM before the one of Git but after those of MSCV and OCaml.
set Path=C:\cygwin\bin;%Path%
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
set Path=%OCAMLROOT%\bin;%OCAMLROOT%\bin\flexdll;%Path%
set CAML_LD_LIBRARY_PATH=%OCAMLROOT%/lib/stublibs
set CYGWINBASH=C:\cygwin\bin\bash.exe
if not exist "%OCAMLROOT%/bin/ocaml.exe" (
echo Downloading OCaml...
appveyor DownloadFile "%OCAMLURL%" -FileName "C:\PROGRA~1\ocaml.zip"
%CYGWINBASH% -lc "cd /cygdrive/c/Program\ Files && unzip -q ocaml.zip"
del C:\PROGRA~1\ocaml.zip
)
if exist %CYGWINBASH% (
REM Make sure that "link" is the MSVC one and not the Cynwin one.
%CYGWINBASH% -lc "eval $(/cygdrive/c/Program\ Files/OCaml/tools/msvs-promote-path)"> ~/.bash_profile"
)
set <NUL /p=Ready to use OCaml & ocamlc -version