瀏覽代碼

build: add a Win64 cross-build script and upgrade glew to 1.7.0.

legacy
Sam Hocevar sam 13 年之前
父節點
當前提交
301bc29d3c
共有 3 個檔案被更改,包括 80 行新增5 行删除
  1. +3
    -3
      build-mingw
  2. +75
    -0
      build-mingw64
  3. +2
    -2
      win32/Contribs.props

+ 3
- 3
build-mingw 查看文件

@@ -21,7 +21,7 @@ CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-image-1.2.10/include"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-mixer-1.2.11/include"

# Glew include path
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/glew-1.6.0/include -DGLEW_STATIC"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/glew-1.7.0/include -DGLEW_STATIC"

# GTK include path
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/lib/glib-2.0/include"
@@ -40,7 +40,7 @@ LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-image-1.2.10/lib"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-mixer-1.2.11/lib"

# Glew library path
LDFLAGS="$LDFLAGS -L`pwd`/contrib/glew-1.6.0/lib"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/glew-1.7.0/lib/i686-w64-mingw32"

# GTK library path
LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtk-2.22.1/lib"
@@ -64,7 +64,7 @@ LOL_LIBS="$LOL_LIBS -lSDL_image -lSDL_mixer -lSDLmain -lSDL -lopengl32 -lglew32"
./bootstrap
# Only on Windows
if test "x${MSYSTEM}" != xMINGW32; then
HOSTFLAGS=--host=i586-mingw32msvc
HOSTFLAGS=--host=i686-w64-mingw32
BUILDFLAGS=--build=none
fi



+ 75
- 0
build-mingw64 查看文件

@@ -0,0 +1,75 @@
#!/bin/sh

## Native MinGW compilation for Lol Engine -- Sam Hocevar <sam@hocevar.net>

# This can't hurt
make distclean

set -e

PATH="$PATH:./contrib/gtk-2.22.1/bin"

M4PATH="$M4PATH:./contrib/gtk-2.22.1/share/aclocal"
export M4PATH # This looks necessary

PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd`/contrib/gtkglarea-2.0.1/lib/pkgconfig"
export PKG_CONFIG_PATH # This looks necessary, too

# SDL include path
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-1.2.14/include"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-image-1.2.10/include"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/sdl-mixer-1.2.11/include"

# Glew include path
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/glew-1.7.0/include -DGLEW_STATIC"

# GTK include path
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/lib/glib-2.0/include"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/lib/gtk-2.0/include"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/glib-2.0"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/gtk-2.0"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/cairo"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/pango-1.0"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/gdk-pixbuf-2.0"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtk-2.22.1/include/atk-1.0"
CPPFLAGS="$CPPFLAGS -I`pwd`/contrib/gtkglarea-2.0.1/include"

# SDL library path
LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-1.2.14/lib"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-image-1.2.10/lib"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/sdl-mixer-1.2.11/lib"

# Glew library path
LDFLAGS="$LDFLAGS -L`pwd`/contrib/glew-1.7.0/lib/x86_64-w64-mingw32"

# GTK library path
LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtk-2.22.1/lib"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtk-2.22.1/bin"
LDFLAGS="$LDFLAGS -L`pwd`/contrib/gtkglarea-2.0.1/lib"

# Prevent issues with GTK+ internals
CPPFLAGS="$CPPFLAGS -mms-bitfields"

# We don't want our binaries to depend on MinGW
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"

# Help our build scripts a bit here
GTK_LIBS="$GTK_LIBS -lgtkgl-2.0 -lopengl32 -lglew32 -lgdi32"
GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"

LOL_LIBS="$LOL_LIBS -lSDL_image -lSDL_mixer -lSDLmain -lSDL -lopengl32 -lglew32"

# Bootstrap, configure and make
./bootstrap
# Only on Windows
if test "x${MSYSTEM}" != xMINGW32; then
HOSTFLAGS=--host=x86_64-w64-mingw32
BUILDFLAGS=--build=none
fi

./configure $HOSTFLAGS $BUILDFLAGS \
CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \
GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS"
make -j6


+ 2
- 2
win32/Contribs.props 查看文件

@@ -3,7 +3,7 @@
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<ContribDir>$(SolutionDir)\..\contrib</ContribDir>
<GlewDir>$(ContribDir)\glew-1.6.0</GlewDir>
<GlewDir>$(ContribDir)\glew-1.7.0</GlewDir>
<GtkDir>$(ContribDir)\gtk-2.22.1</GtkDir>
<GtkGlDir>$(ContribDir)\gtkglarea-2.0.1</GtkGlDir>
<SdlDir>$(ContribDir)\sdl-1.2.14</SdlDir>
@@ -12,7 +12,7 @@
<GlIncludes>$(GlewDir)\include</GlIncludes>
<GtkIncludes>$(GtkDir)\lib\glib-2.0\include;$(GtkDir)\lib\gtk-2.0\include;$(GtkDir)\include\glib-2.0;$(GtkDir)\include\gtk-2.0;$(GtkDir)\include\cairo;$(GtkDir)\include\pango-1.0;$(GtkDir)\include\gdk-pixbuf-2.0;$(GtkDir)\include\atk-1.0;$(GtkGlDir)\include</GtkIncludes>
<SdlIncludes>$(SdlDir)\include;$(SdlImageDir)\include;$(SdlMixerDir)\include</SdlIncludes>
<GlLibs>$(GlewDir)\lib</GlLibs>
<GlLibs>$(GlewDir)\lib\i686-w64-mingw32</GlLibs>
<GtkLibs>$(GtkDir)\lib;$(GtkDir)\bin;$(GtkGlDir)\lib</GtkLibs>
<SdlLibs>$(SdlDir)\lib;$(SdlImageDir)\lib;$(SdlMixerDir)\lib</SdlLibs>
<GlDeps>opengl32.lib;glew32.lib</GlDeps>


Loading…
取消
儲存