Permalink
Browse files

[rbp] added raspberrypi support to our configure system

  • Loading branch information...
1 parent 8bd067d commit 6b37a4c8ec605689aee9b8625aec0c41764f21b4 @huceke huceke committed Aug 10, 2012
Showing with 63 additions and 3 deletions.
  1. +63 −3 configure.in
View
66 configure.in
@@ -184,6 +184,12 @@ AC_ARG_WITH([arch],
[use_arch=$withval],
[use_arch=no])
+AC_ARG_WITH([platform],
+ [AS_HELP_STRING([--with-platform],
+ [use a pre-configured config for common arm boards])],
+ [use_platform=$withval],
+ [use_platform=none])
+
AC_ARG_WITH([cpu],
[AS_HELP_STRING([--with-cpu],
[build with given cpu passing to ffmpeg (default is no)])],
@@ -475,7 +481,7 @@ AC_ARG_ENABLE([libcap],
AC_ARG_ENABLE([player],
[AS_HELP_STRING([--enable-player],
- [enable additional players from a list of comma separated names, (default is none, choices are amlplayer)])],
+ [enable additional players from a list of comma separated names, (default is none, choices are amlplayer, omxplayer)])],
[add_players=$enableval],
[add_players=no])
@@ -639,11 +645,38 @@ if test "$target_platform" = "target_android" ; then
AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer])
fi
+case $use_platform in
+ raspberry-pi)
+ target_platform=target_raspberry_pi
+ use_neon=no
+ use_texturepacker=yes
+ use_texturepacker_native=yes
+ use_arch="arm"
+ use_cpu=arm1176jzf-s
+ use_armv5te="yes"
+ use_armv6t2="no"
+ use_armv6="yes"
+ use_armvfp="yes"
+ use_hardcoded_tables="yes"
+ use_alsa="yes"
+ USE_TEXTUREPACKER_NATIVE_ROOT="$TEXTUREPACKER_NATIVE_ROOT"
+ ARCH="arm"
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI")
+ AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer])
+ USE_OMXLIB=1; AC_DEFINE([HAVE_OMXLIB],[1],["Define to 1 if OMX libs is enabled"])
+ CFLAGS="$CFLAGS"
+ CXXFLAGS="$CXXFLAGS"
+ ;;
+ *)
+ use_alsa="yes"
+esac
+
if test "$build_shared_lib" = "yes"; then
final_message="$final_message\n Shared lib\tYes"
AC_SUBST(USE_LIBXBMC,1)
fi
+
# platform debug flags
if test "$use_debug" = "yes"; then
final_message="$final_message\n Debugging:\tYes"
@@ -703,6 +736,9 @@ if test "$host_vendor" = "apple" ; then
LIBS="$LIBS -framework QuartzCore"
fi
USE_EXTERNAL_FFMPEG=1
+elif test "$target_platform" = "target_raspberry_pi"; then
+ ARCH="arm"
+ use_arch="arm"
elif test "$use_arch" = "arm"; then
CFLAGS="$CFLAGS -mno-apcs-stack-check"
CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check"
@@ -792,8 +828,15 @@ if test "$use_gles" = "yes"; then
AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
else
- AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library))
- AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
+ if test "$target_platform" = "target_raspberry_pi"; then
+ AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."])
+ AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
+ AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
+ LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm"
+ else
+ AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library))
+ AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
+ fi
fi
else
if test "$use_gl" = "yes"; then
@@ -1019,6 +1062,10 @@ AS_CASE([x$use_libvorbisenc],
# WebServer
if test "$use_webserver" = "yes"; then
+if test "$target_platform" = "target_raspberry_pi"; then
+ AC_CHECK_LIB([gpg-error], [main],, AC_MSG_ERROR($missing_library))
+ AC_CHECK_LIB([gcrypt], [main],, AC_MSG_ERROR($missing_library))
+fi
AC_CHECK_LIB([microhttpd], [main],, AC_MSG_ERROR($missing_library))
fi
@@ -1627,6 +1674,10 @@ if test "$host_vendor" = "apple" ; then
use_openmax="no"
USE_OPENMAX=0
AC_MSG_NOTICE($openmax_disabled)
+elif test "$target_platform" = "target_raspberry_pi"; then
+ use_openmax="no"
+ USE_OPENMAX=0
+ AC_MSG_NOTICE($openmax_disabled)
else
if test "$use_gles" = "yes" && test "$use_openmax" = "auto"; then
PKG_CHECK_MODULES([OPENMAX], [libomxil-bellagio],
@@ -1654,6 +1705,9 @@ case $add_players in
AC_CHECK_HEADER([amlplayer/amports/amstream.h],, AC_MSG_ERROR($missing_headers))
XB_ADD_PLAYER([AMLPLAYER], [amlplayer])
;;
+ *omxplayer*)
+ XB_ADD_PLAYER([OMXPLAYER], [omxplayer])
+ ;;
esac
# platform specific bin utilities
@@ -2123,6 +2177,7 @@ OUTPUT_FILES="Makefile \
xbmc/cores/AudioEngine/Makefile \
xbmc/cores/paplayer/Makefile \
xbmc/cores/amlplayer/Makefile \
+ xbmc/cores/omxplayer/Makefile \
lib/timidity/Makefile \
lib/xbadpcm/Makefile \
lib/asap/Makefile \
@@ -2368,6 +2423,10 @@ XB_CONFIG_MODULE([lib/ffmpeg], [
`if test "$use_arch" != "no"; then echo --arch=$use_arch; fi`\
`if test "$use_cpu" != "no"; then echo --cpu=$use_cpu; fi`\
`if test "$use_neon" = "yes"; then echo --enable-neon; else echo --disable-neon; fi`\
+ `if test "$use_armv5te" = "yes"; then echo --enable-armv5te; else echo --disable-armv5te; fi`\
@theuni
theuni Sep 20, 2012

@huceke this breaks other arm builds.

ffmpeg should be figuring out which arm instructions to use based on the cpu it's provided with (we already pass that in). We'll need to revert this unless you can give an example of something that's not detected correctly.

@huceke
huceke Sep 21, 2012

With arm flags :

grep ARM lib/ffmpeg/config.h
#define ARCH_ARM 1
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 0
#define HAVE_ARMVFP 1

Without arm flags :

grep ARM lib/ffmpeg/config.h
#define ARCH_ARM 1
#define HAVE_ARMV5TE 1
#define HAVE_ARMV6 1
#define HAVE_ARMV6T2 0
#define HAVE_ARMVFP 1

So i assume it should be save for the PI to revert the arm configure flags.

Please leave use_hardcoded_tables alone. This is needed on the PI. Without hardcoded tables ffmpeg crashes on the PI.

@theuni
theuni Sep 21, 2012

Perfect, thanks.

@pieh
pieh Sep 21, 2012

friendly reminder here, arm flags are still there and because of that we can't play stuff on android now ( http://pastebin.com/EkJDJRX8 )
removing them fix that on android, but I would like someone who actually know what he's doing to look at it ;)

+ `if test "$use_armv6t2" = "yes"; then echo --enable-armv6t2; else echo --disable-armv6t2; fi`\
+ `if test "$use_armv6" = "yes"; then echo --enable-armv6; else echo --disable-armv6; fi`\
+ `if test "$use_armvfp" = "yes"; then echo --enable-armvfp; else echo --disable-armvfp; fi`\
--target-os=$ffmpeg_target_os \
--disable-muxers \
--enable-muxer=spdif \
@@ -2393,6 +2452,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [
--enable-protocol=http \
--enable-pthreads \
--enable-runtime-cpudetect \
+ `if test "$use_hardcoded_tables" = "yes"; then echo --enable-hardcoded-tables; else echo --disable-hardcoded-tables; fi`\
`if test "$target_platform" = "target_android" && test "$host_cpu" = "i686"; then echo --disable-mmx; fi #workaround for gcc 4.6 bug` \
`if test "$target_platform" = "target_android"; then echo '--custom-libname-with-major="\$(SLIBPREF)\$(FULLNAME)-\$(LIBMAJOR)-${ARCH}\$(SLIBSUF)"'; \
else echo '--custom-libname-with-major="\$(FULLNAME)-\$(LIBMAJOR)-${ARCH}\$(SLIBSUF)"'; fi` \

0 comments on commit 6b37a4c

Please sign in to comment.