source: trunk/build-mingw @ 900

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

contrib: add a precompiled Win32 version of CppUnit and update build system
accordingly.

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1#!/bin/sh
2
3##  Native MinGW compilation for Lol Engine -- Sam Hocevar <sam@hocevar.net>
4
5# This can't hurt
6make distclean
7
8set -e
9
10PATH="$PATH:./contrib/gtk-2.22.1/bin"
11
12M4PATH="$M4PATH:./contrib/gtk-2.22.1/share/aclocal"
13M4PATH="$M4PATH:./contrib/cppunit-1.12.2/share/aclocal"
14export M4PATH # This looks necessary
15
16PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd`/contrib/gtkglarea-2.0.1/lib/pkgconfig"
17PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd`/contrib/cppunit-1.12.2/lib/pkgconfig"
18export PKG_CONFIG_PATH # This looks necessary, too
19
20# SDL include path
21CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-1.2.14/include"
22CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-image-1.2.10/include"
23CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-mixer-1.2.11/include"
24
25# Glew include path
26CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/glew-1.6.0/include -DGLEW_STATIC"
27
28# GTK include path
29CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/lib/glib-2.0/include"
30CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/lib/gtk-2.0/include"
31CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/glib-2.0"
32CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/gtk-2.0"
33CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/cairo"
34CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/pango-1.0"
35CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/gdk-pixbuf-2.0"
36CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/atk-1.0"
37CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtkglarea-2.0.1/include"
38
39# CppUnit include path
40CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/cppunit-1.12.2/include"
41
42# SDL library path
43LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-1.2.14/lib"
44LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-image-1.2.10/lib"
45LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-mixer-1.2.11/lib"
46
47# Glew library path
48LDFLAGS="$LDFLAGS -L`pwd`/contrib/glew-1.6.0/lib"
49
50# GTK library path
51LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtk-2.22.1/lib"
52LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtk-2.22.1/bin"
53LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtkglarea-2.0.1/lib"
54
55# CppUnit library path
56LDFLAGS="$LDFLAGS -L`pwd`/contrib/cppunit-1.12.2/lib"
57
58# Prevent issues with GTK+ internals
59CPPFLAGS="$CPPFLAGS -mms-bitfields"
60
61# We don't want our binaries to depend on MinGW
62LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
63
64# Help our build scripts a bit here
65GTK_LIBS="$GTK_LIBS -lgtkgl-2.0 -lopengl32 -lglew32 -lgdi32"
66GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
67GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"
68
69LOL_LIBS="$LOL_LIBS -lSDL_image -lSDL_mixer -lSDLmain -lSDL -lopengl32 -lglew32"
70
71# Bootstrap, configure and make
72./bootstrap
73# Only on Windows
74if test "x${MSYSTEM}" != xMINGW32; then
75  HOSTFLAGS=--host=i586-mingw32msvc
76  BUILDFLAGS=--build=none
77fi
78
79./configure $HOSTFLAGS $BUILDFLAGS \
80            CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \
81            GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS"
82make
83
Note: See TracBrowser for help on using the repository browser.