From 23d17010356cf3833e97918f32cb20ce791382a4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 22 Aug 2011 12:29:55 +0000 Subject: [PATCH] build: allow to properly cross-compile for PS3 on Mingw. --- build-ps3 | 9 +++++++++ configure.ac | 56 ++++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/build-ps3 b/build-ps3 index 548663a7..3cb484ed 100755 --- a/build-ps3 +++ b/build-ps3 @@ -4,6 +4,15 @@ 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 diff --git a/configure.ac b/configure.ac index 101d124c..24488e39 100644 --- a/configure.ac +++ b/configure.ac @@ -165,32 +165,32 @@ AC_CHECK_FUNCS(glBegin) LIBS="${save_LIBS}" dnl Use SDL? (always required on Linux or Win32) -ac_cv_my_have_sdl="yes" -AC_PATH_PROG(SDL_CONFIG, sdl-config, no) -if test "${SDL_CONFIG}" != "no" -a "x$cross_compiling" != xyes; then - SDL_CFLAGS="${SDL_CFLAGS} `sdl-config --cflags`" - SDL_LIBS="${SDL_LIBS} `sdl-config --libs`" -fi -SDL_CFLAGS="${SDL_CFLAGS} ${GL_CFLAGS}" -SDL_LIBS="${SDL_LIBS} ${GL_LIBS}" -PKG_CHECK_MODULES(SDL, sdl, [:], - [SDL_LIBS="${SDL_LIBS} -lSDL"]) -PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:], - [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"]) -PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:], - [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"]) -SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" -SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" - -save_CPPFLAGS="${CPPFLAGS}" -CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}" -AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"]) -AC_CHECK_HEADERS(SDL_image.h, [:], [ac_cv_my_have_sdl="no"]) -CPPFLAGS="${save_CPPFLAGS}" -if test "${ac_cv_my_have_sdl}" = "no"; then - AC_MSG_WARN([[One of SDL, SDL_Image or SDL_Mixer not found]]) -else - AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL) +ac_cv_my_have_sdl="no" +if test "x$cross_compiling" != xyes; then + ac_cv_my_have_sdl="yes" + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + if test "${SDL_CONFIG}" != "no" -a "x$cross_compiling" != xyes; then + SDL_CFLAGS="${SDL_CFLAGS} `sdl-config --cflags`" + SDL_LIBS="${SDL_LIBS} `sdl-config --libs`" + fi + PKG_CHECK_MODULES(SDL, sdl, [:], + [SDL_LIBS="${SDL_LIBS} -lSDL"]) + PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [:], + [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"]) + PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [:], + [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"]) + SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}" + SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}" + save_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS}" + AC_CHECK_HEADERS(SDL_mixer.h, [:], [ac_cv_my_have_sdl="no"]) + AC_CHECK_HEADERS(SDL_image.h, [:], [ac_cv_my_have_sdl="no"]) + CPPFLAGS="${save_CPPFLAGS}" + if test "${ac_cv_my_have_sdl}" = "no"; then + AC_MSG_WARN([[One of SDL, SDL_Image or SDL_Mixer not found]]) + else + AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL) + fi fi AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes") @@ -249,8 +249,8 @@ AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes") dnl How to use the Lol Engine inside this tree LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src" -LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS" -LOL_LIBS="$LOL_LIBS $SDL_LIBS $EGL_LIBS $LIBPNG_LIBS" +LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS" +LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS" AC_SUBST(MATH_LIBS) AC_SUBST(LOL_CFLAGS)