source: trunk/build/lol-build @ 953

Last change on this file since 953 was 953, checked in by sam, 9 years ago

build: disable "make check" on win64 because the version of Wine installed
on the autobuilders doesn't support it yet.

  • Property svn:executable set to *
File size: 6.1 KB
Line 
1#!/bin/sh
2
3#
4# Lol Engine build script
5# Usage:
6#   lol-build <action> [<platform>]
7#
8# Where <action> is one of:
9#  - bootstrap
10#  - configure
11#  - build
12#  - check
13#  - clean
14#
15# And <platform> is one of:
16#  - linux-i386
17#  - linux-amd64
18#  - ios-arm
19#  - android-arm
20#  - ps3-ppu
21#  - windows-i386
22#  - windows-amd64
23#
24
25set -e
26
27action="$1"
28platform="$2"
29
30__init__()
31{
32    top_srcdir=$(dirname "$0")/..
33    cd $top_srcdir
34    top_srcdir="`pwd`"
35
36    case "${MSYSTEM}" in
37        MINGW32|MINGW64)
38            PATH="$PATH:./contrib/gtk-2.22.1/bin"
39            M4PATH="$M4PATH:./contrib/gtk-2.22.1/share/aclocal"
40            ;;
41    esac
42}
43
44bootstrap()
45{
46    cd $top_srcdir
47    case "$platform" in
48        ios-arm)
49            # No bootstrapping needed
50            ;;
51        android-arm)
52            # No bootstrapping needed
53            ;;
54        *)
55            PATH="$PATH" M4PATH="$M4PATH" ./bootstrap
56            ;;
57    esac
58}
59
60configure()
61{
62    cd $top_srcdir
63    case "$platform" in
64        windows-i386)
65            if test "x${MSYSTEM}" = xMINGW32; then
66                :
67            elif i586-mingw32msvc-g++ --version >/dev/null 2>&1; then
68                HOSTFLAGS=--host=i586-mingw32msvc
69                BUILDFLAGS=--build=none
70            elif i686-w64-mingw32-g++ --version >/dev/null 2>&1; then
71                HOSTFLAGS=--host=i686-w64-mingw32
72                BUILDFLAGS=--build=none
73            else
74                echo "Error: could not find win32 compiler" >&2
75                false
76            fi
77            if test "x${MSYSTEM}" = xMINGW64; then
78                # If using mingw64, we're not really cross-compiling
79                BUILDFLAGS=
80            fi
81            PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PWD/contrib/gtkglarea-2.0.1/lib/pkgconfig"
82            LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/i686-w64-mingw32"
83            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-1.2.14/lib/i686-w64-mingw32"
84            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-image-1.2.10/lib/i686-w64-mingw32"
85            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-mixer-1.2.11/lib/i686-w64-mingw32"
86            LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/lib"
87            LDFLAGS="$LDFLAGS -L$PWD/contrib/gtk-2.22.1/bin"
88            LDFLAGS="$LDFLAGS -L$PWD/contrib/gtkglarea-2.0.1/lib"
89            ;;
90        windows-amd64)
91            if test "x${MSYSTEM}" = xMINGW64; then
92                :
93            elif x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then
94                HOSTFLAGS=--host=x86_64-w64-mingw32
95                BUILDFLAGS=--build=none
96            else
97                echo "Error: could not find win64 compiler" >&2
98                false
99            fi
100            if test "x${MSYSTEM}" = xMINGW32; then
101                # If using mingw32, we're not really cross-compiling
102                BUILDFLAGS=
103            fi
104            LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/x86_64-w64-mingw32"
105            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-1.2.14/lib/x86_64-w64-mingw32"
106            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-image-1.2.10/lib/x86_64-w64-mingw32"
107            LDFLAGS="$LDFLAGS -L$PWD/contrib/sdl-mixer-1.2.11/lib/x86_64-w64-mingw32"
108            ;;
109    esac
110    case "$platform" in
111        ios-arm)
112            # No configuration needed
113            ;;
114        android-arm)
115            cd monsterz/android
116            android update project --path .
117            ;;
118        ps3-ppu)
119            PATH="$PATH" ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=none
120            ;;
121        windows-i386|windows-amd64)
122            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-1.2.14/include"
123            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-image-1.2.10/include"
124            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/sdl-mixer-1.2.11/include"
125            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/glew-1.7.0/include -DGLEW_STATIC"
126            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/glib-2.0/include"
127            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/lib/gtk-2.0/include"
128            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/glib-2.0"
129            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gtk-2.0"
130            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/cairo"
131            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/pango-1.0"
132            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/gdk-pixbuf-2.0"
133            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtk-2.22.1/include/atk-1.0"
134            CPPFLAGS="$CPPFLAGS -I$PWD/contrib/gtkglarea-2.0.1/include"
135            CPPFLAGS="$CPPFLAGS -mms-bitfields"
136            LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
137            GTK_LIBS="$GTK_LIBS -lgtkgl-2.0 -lopengl32 -lglew32 -lgdi32"
138            GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
139            GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"
140            PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS"
141            ;;
142        *)
143            PATH="$PATH" ./configure
144            ;;
145    esac
146}
147
148build()
149{
150    cd $top_srcdir
151    case "$platform" in
152        ios-arm)
153            cd monsterz/ios
154            xcodebuild -configuration Release -sdk iphonesimulator4.3
155            ;;
156        android-arm)
157            cd monsterz/android
158            ndk-build
159            ant compile
160            ;;
161        *)
162            make -j6
163            ;;
164    esac
165}
166
167check()
168{
169    cd $top_srcdir
170    case "$platform" in
171        ios-arm)
172            ;;
173        android-arm)
174            ;;
175        ps3-ppu)
176            ;;
177        windows-amd64)
178            # No support for Wine64 yet
179            ;;
180        *)
181            make check
182            ;;
183    esac
184}
185
186clean()
187{
188    cd $top_srcdir
189    case "$platform" in
190        ios-arm)
191            cd monsterz/ios
192            xcodebuild -configuration Release -sdk iphonesimulator4.3 clean
193            ;;
194        android-arm)
195            cd monsterz/android
196            ndk-build distclean
197            ant clean
198            ;;
199        *)
200            make distclean
201            ;;
202    esac
203}
204
205__init__
206echo "lol-build: executing action '$action' on platform '$platform'" >&2
207eval "$action"
208
Note: See TracBrowser for help on using the repository browser.