From 160102ba0329cc947c41b7a9c69b78050805cc65 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 10 Sep 2011 19:33:10 +0000 Subject: [PATCH] build: new lol-build script for easier autobuilds. --- .gitignore | 2 + Makefile.am | 2 +- build-mingw | 72 +----------------- build-mingw64 | 72 +----------------- build-ps3 | 21 +----- build/bitten.xml | 113 ++-------------------------- build/lol-build | 188 +++++++++++++++++++++++++++++++++++++++++++++++ test/Makefile.am | 4 +- 8 files changed, 207 insertions(+), 267 deletions(-) create mode 100755 build/lol-build diff --git a/.gitignore b/.gitignore index b05be2da..aa8d1d59 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,8 @@ win32/Release win32/*.vcxproj.user win32/*.sdf win32/*.suo +# Android cruft +monsterz/android/assets # Do not exclude anything in contrib; this is currently one level # more than our current max !contrib/* diff --git a/Makefile.am b/Makefile.am index 6530623f..cc034e8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = src test deushax monsterz tools gfx DIST_SUBDIRS = $(SUBDIRS) -EXTRA_DIST = bootstrap build-linux build-mingw +EXTRA_DIST = bootstrap build-linux build-mingw build-mingw64 build-ps3 build/lol-build AUTOMAKE_OPTIONS = dist-bzip2 bench: diff --git a/build-mingw b/build-mingw index 7fa9f0d6..ae76dd5a 100755 --- a/build-mingw +++ b/build-mingw @@ -1,75 +1,9 @@ #!/bin/sh -## Native MinGW compilation for Lol Engine -- Sam Hocevar - # 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/i686-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=i686-w64-mingw32 - BUILDFLAGS=--build=none -fi - -./configure $HOSTFLAGS $BUILDFLAGS \ - CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" \ - GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS" -make -j6 +./build/lol-build bootstrap windows-i386 +./build/lol-build configure windows-i386 +./build/lol-build build windows-i386 diff --git a/build-mingw64 b/build-mingw64 index 66d745c1..8c45a51d 100755 --- a/build-mingw64 +++ b/build-mingw64 @@ -1,75 +1,9 @@ #!/bin/sh -## Native MinGW compilation for Lol Engine -- Sam Hocevar - # 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 +./build/lol-build bootstrap windows-amd64 +./build/lol-build configure windows-amd64 +./build/lol-build build windows-amd64 diff --git a/build-ps3 b/build-ps3 index 6acc15d7..27423471 100755 --- a/build-ps3 +++ b/build-ps3 @@ -1,24 +1,9 @@ #!/bin/sh -## Native PS3 compilation for Lol Engine -- Sam Hocevar - # This can't hurt make distclean -set -e - -# Only on Windows -if test "x${MSYSTEM}" = xMINGW32; then - PATH="$PATH:./contrib/gtk-2.22.1/bin" - 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 -fi - -# Bootstrap, configure and make -# NOTE: ensure that $CELL_SDK is set and ppu-lv2-g++ is in the path -./bootstrap -./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=none -make -j6 +./build/lol-build bootstrap ps3-ppu +./build/lol-build configure ps3-ppu +./build/lol-build build ps3-ppu diff --git a/build/bitten.xml b/build/bitten.xml index 6bb7d7af..b23637c6 100644 --- a/build/bitten.xml +++ b/build/bitten.xml @@ -2,122 +2,21 @@ xmlns:svn="http://bitten.edgewall.org/tools/svn" xmlns:c="http://bitten.edgewall.org/tools/c"> - + - + - + - + - + - + diff --git a/build/lol-build b/build/lol-build new file mode 100755 index 00000000..29a3d535 --- /dev/null +++ b/build/lol-build @@ -0,0 +1,188 @@ +#!/bin/sh + +# +# Lol Engine build script +# Usage: +# lol-build [] +# +# Where is one of: +# - bootstrap +# - configure +# - build +# - check +# - clean +# +# And is one of: +# - linux-i386 +# - linux-amd64 +# - ios-arm +# - android-arm +# - ps3-ppu +# - windows-i386 +# - windows-amd64 +# + +set -e + +action="$1" +platform="$2" + +top_srcdir=$(dirname "$0")/.. +cd $top_srcdir +top_srcdir="`pwd`" + +bootstrap() +{ + cd $top_srcdir + case "$platform" in + ios-arm) + # No bootstrapping needed + ;; + android-arm) + # No bootstrapping needed + ;; + windows-i386|windows-amd64) + PATH="$PATH:./contrib/gtk-2.22.1/bin" + M4PATH="$M4PATH:./contrib/gtk-2.22.1/share/aclocal" + PATH="$PATH" M4PATH="$M4PATH" ./bootstrap + ;; + *) + ./bootstrap + ;; + esac +} + +configure() +{ + cd $top_srcdir + case "$platform" in + windows-i386) + if test "x${SYSTEM}" = xMINGW32; then + : + elif i586-mingw32msvc-g++ --version >/dev/null 2>&1; then + HOSTFLAGS=--host=i586-mingw32msvc + BUILDFLAGS=--build=none + elif i686-w64-mingw32-g++ --version >/dev/null 2>&1; then + HOSTFLAGS=--host=i686-w64-mingw32 + BUILDFLAGS=--build=none + else + echo "Error: could not find win32 compiler" + false + fi + LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/i686-w64-mingw32" + ;; + windows-amd64) + if test "x${SYSTEM}" = xMINGW64; then + : + elif x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then + HOSTFLAGS=--host=x86_64-w64-mingw32 + BUILDFLAGS=--build=none + else + echo "Error: could not find win64 compiler" + false + fi + LDFLAGS="$LDFLAGS -L$PWD/contrib/glew-1.7.0/lib/x86_64-w64-mingw32" + ;; + esac + case "$platform" in + ios-arm) + # No configuration needed + ;; + android-arm) + cd monsterz/android + android update project --path . + ;; + ps3-ppu) + ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=none + ;; + windows-i386|windows-amd64) + PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PWD/contrib/gtkglarea-2.0.1/lib/pkgconfig" + 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" + CPPFLAGS="$CPPFLAGS -I$PWD/contrib/glew-1.7.0/include -DGLEW_STATIC" + 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" + 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" + 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" + CPPFLAGS="$CPPFLAGS -mms-bitfields" + LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" + 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" + PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" LOL_LIBS="$LOL_LIBS" + ;; + *) + ./configure + ;; + esac +} + +build() +{ + cd $top_srcdir + case "$platform" in + ios-arm) + cd monsterz/ios + xcodebuild -configuration Release -sdk iphonesimulator4.3 + ;; + android-arm) + cd monsterz/android + ndk-build + ant compile + ;; + *) + make -j6 + ;; + esac +} + +check() +{ + cd $top_srcdir + case "$platform" in + ios-arm) + ;; + android-arm) + ;; + ps3-ppu) + ;; + *) + make check + ;; + esac +} + +clean() +{ + cd $top_srcdir + case "$platform" in + ios-arm) + cd monsterz/ios + xcodebuild -configuration Release -sdk iphonesimulator4.3 clean + ;; + android-arm) + cd monsterz/android + ndk-build distclean + ant clean + ;; + *) + make distclean + ;; + esac +} + +eval "$action" + diff --git a/test/Makefile.am b/test/Makefile.am index 81401890..e6968649 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -4,15 +4,13 @@ AM_CPPFLAGS = -I$(top_srcdir)/src bench: benchsuite$(EXEEXT) ./benchsuite$(EXEEXT) -all-local: quad$(EXEEXT) benchsuite$(EXEEXT) +all-local: $(noinst_PROGRAMS) test x$(MAKE_FSELF) = xno || make_fself quad$(EXEEXT) quad.self test x$(MAKE_FSELF) = xno || make_fself sandbox$(EXEEXT) sandbox.self test x$(MAKE_FSELF) = xno || make_fself benchsuite$(EXEEXT) benchsuite.self test x$(MAKE_FSELF) = xno || make_fself testsuite$(EXEEXT) testsuite.self CLEANFILES = $(noinst_PROGRAMS:%=%.self) $(noinst_PROGRAMS:%=%.exe) -#quad.self sandbox.self benchsuite.self testsuite.self \ -# quad.exe sandbox.exe benchsuite.exe testsuite.exe noinst_PROGRAMS = quad sandbox benchsuite testsuite