diff --git a/build/build-raspi b/build/build-raspi new file mode 100755 index 00000000..9b44223c --- /dev/null +++ b/build/build-raspi @@ -0,0 +1,10 @@ +#!/bin/sh + +# This can't hurt +make distclean + +set -e +./build/lol-build bootstrap raspi-arm +./build/lol-build configure raspi-arm +./build/lol-build build raspi-arm + diff --git a/build/lol-build b/build/lol-build index 0eb2e276..f8ce5d27 100755 --- a/build/lol-build +++ b/build/lol-build @@ -23,6 +23,7 @@ # - ps3-ppu # - win*-i386 # - win*-amd64 +# - raspi-arm # set -e @@ -131,6 +132,9 @@ configure() cd monsterz/android android update project --path . ;; + raspi-arm) + ./configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib" + ;; nacl-i386) ./configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" ;; @@ -197,6 +201,8 @@ check() ;; android-arm) ;; + raspi-arm) + ;; ps3-ppu) ;; nacl-*) diff --git a/configure.ac b/configure.ac index 40d53c72..79b27aef 100644 --- a/configure.ac +++ b/configure.ac @@ -169,19 +169,19 @@ fi dnl Use the Raspberry Pi libraries? if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then -AC_CHECK_HEADER(bcm_host.h, - [AC_MSG_RESULT(yes) - AC_CHECK_LIB(bcm_host, main, - [ac_cv_my_have_gl="yes" - ac_cv_my_stop_looking_for_gl="yes" - AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) - GL_LIBS="-lGLESv2_static -lkhrn_static -lvcos -lvchiq_arm -lbcm_host"])], - [AC_MSG_RESULT(no)]) + AC_CHECK_HEADERS(bcm_host.h, + [AC_CHECK_LIB(vcos, main, + [ac_cv_my_have_gl="yes" + ac_cv_my_stop_looking_for_gl="yes" + AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) + dnl FIXME: -lEGL does not belong here but the configure test fails + dnl when cross-compiling, so we add it manually here. + GL_LIBS="-lGLESv2 -lEGL -lvcos -lvchiq_arm -lbcm_host"])]) fi dnl Use the PS3 PSGL? if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then - AC_CHECK_HEADER(PSGL/psgl.h, + AC_CHECK_HEADERS(PSGL/psgl.h, [ac_cv_my_have_gl="yes" ac_cv_my_stop_looking_for_gl="yes"]) fi @@ -351,18 +351,25 @@ AC_LANG_POP(C++) AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no") -dnl Use EGL? +dnl Use EGL? ac_cv_my_have_egl="no" PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:]) if test "${ac_cv_my_have_egl}" != "no"; then AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl) EGL_LIBS="${EGL_LIBS} -lX11" fi -dnl Use the Raspberry Pi libraries? -AC_CHECK_LIB(EGL_static, main, +AC_CHECK_LIB(EGL, main, + [ac_cv_my_have_egl="yes" + AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl) + EGL_LIBS="-lEGL"]) +dnl Raspberry Pi is different, check for it with extra libs; also we +dnl look for a different function to bypass autoconf caching +AC_CHECK_LIB(EGL, eglGetDisplay, [ac_cv_my_have_egl="yes" AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl) - EGL_LIBS="-lEGL_static"]) + EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"], + [:], + [-lvcos -lvchiq_arm -lbcm_host -lGLESv2]) AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no") diff --git a/tutorial/11_fractal.cpp b/tutorial/11_fractal.cpp index b61c5d9f..25495d60 100644 --- a/tutorial/11_fractal.cpp +++ b/tutorial/11_fractal.cpp @@ -39,7 +39,7 @@ extern D3DDevice *g_d3ddevice; static GLint const INTERNAL_FORMAT = GL_ARGB_SCE; static GLenum const TEXTURE_FORMAT = GL_BGRA; static GLenum const TEXTURE_TYPE = GL_UNSIGNED_INT_8_8_8_8_REV; -#elif defined __native_client__ +#elif defined __native_client__ || defined HAVE_GLES_2X static GLint const INTERNAL_FORMAT = GL_RGBA; static GLenum const TEXTURE_FORMAT = GL_RGBA; static GLenum const TEXTURE_TYPE = GL_UNSIGNED_BYTE;