Browse Source

build: fix the Raspberry Pi build and add a build script for it.

legacy
Sam Hocevar sam 12 years ago
parent
commit
03e83798eb
4 changed files with 37 additions and 14 deletions
  1. +10
    -0
      build/build-raspi
  2. +6
    -0
      build/lol-build
  3. +20
    -13
      configure.ac
  4. +1
    -1
      tutorial/11_fractal.cpp

+ 10
- 0
build/build-raspi View File

@@ -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


+ 6
- 0
build/lol-build View File

@@ -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-*)


+ 20
- 13
configure.ac View File

@@ -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")




+ 1
- 1
tutorial/11_fractal.cpp View File

@@ -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;


Loading…
Cancel
Save