File: appveyor_build.sh

package info (click to toggle)
ocaml 4.05.0-11
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 27,060 kB
  • sloc: ml: 199,255; ansic: 44,187; sh: 5,611; makefile: 4,958; lisp: 4,223; asm: 4,220; awk: 306; perl: 87; fortran: 21; cs: 9; sed: 9
file content (95 lines) | stat: -rw-r--r-- 3,379 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
#**************************************************************************
#*                                                                        *
#*                                 OCaml                                  *
#*                                                                        *
#*                         Christophe Troestler                           *
#*                                                                        *
#*   Copyright 2015 Christophe Troestler                                  *
#*                                                                        *
#*   All rights reserved.  This file is distributed under the terms of    *
#*   the GNU Lesser General Public License version 2.1, with the          *
#*   special exception on linking described in the file LICENSE.          *
#*                                                                        *
#**************************************************************************

function run {
    NAME=$1
    shift
    echo "-=-=- $NAME -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
    $@
    CODE=$?
    if [ $CODE -ne 0 ]; then
        echo "-=-=- $NAME failed! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
        exit $CODE
    else
        echo "-=-=- End of $NAME -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
    fi
}

PREFIX="C:/Program Files/OCaml"

wmic cpu get name

if [[ $1 = "msvc32-only" ]] ; then
  cd $APPVEYOR_BUILD_FOLDER/flexdll-0.35
  make MSVC_DETECT=0 CHAINS=msvc MSVC_FLAGS="-nologo -MD -D_CRT_NO_DEPRECATE -GS- -WX" support
  cp flexdll*_msvc.obj "$PREFIX/bin/flexdll"

  cd $APPVEYOR_BUILD_FOLDER/../build-msvc32
  cp config/m-nt.h config/m.h
  cp config/s-nt.h config/s.h

  eval $(tools/msvs-promote-path)

  PREFIX="C:/Program Files/OCaml-msmvc32"
  echo "Edit config/Makefile to set PREFIX=$PREFIX"
  sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/\(BYTE\|NATIVE\)CCCOMPOPTS=./s/\r\?$/ -WX\0/" config/Makefile.msvc > config/Makefile

  run "make world" make world
  run "make runtimeopt" make runtimeopt
  run "make -C otherlibs/systhreads libthreadsnat.lib" make -C otherlibs/systhreads libthreadsnat.lib

  exit 0
fi

cd $APPVEYOR_BUILD_FOLDER

git worktree add ../build-mingw32 -b appveyor-build-mingw32
git worktree add ../build-msvc32 -b appveyor-build-msvc32

cd ../build-mingw32
git submodule update --init flexdll

cd $APPVEYOR_BUILD_FOLDER

tar -xzf flexdll.tar.gz
cd flexdll-0.35
make MSVC_DETECT=0 CHAINS=msvc64 support
cp flexdll*_msvc64.obj "$PREFIX/bin/flexdll"
cd ..

cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h

echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/\(BYTE\|NATIVE\)CCCOMPOPTS=./s/\r\?$/ -WX\0/" config/Makefile.msvc64 > config/Makefile
#run "Content of config/Makefile" cat config/Makefile

run "make world" make world
run "make bootstrap" make bootstrap
run "make opt" make opt
run "make opt.opt" make opt.opt

cd ../build-mingw32

cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h

PREFIX="C:/Program Files/OCaml-mingw32"
echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -e "s|PREFIX=.*|PREFIX=$PREFIX|" -e "/\(BYTE\|NATIVE\)CCCOMPOPTS=./s/\r\?$/ -Werror\0/" config/Makefile.mingw > config/Makefile
#run "Content of config/Makefile" cat config/Makefile

run "make flexdll" make flexdll
run "make world.opt" make world.opt