Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[rbp] added RaspberryPI crosscompile env

  • Loading branch information...
commit a24e3b8273737b68e12e4da27cbb9b4e5b31b448 1 parent 35821fa
huceke authored
Showing with 119 additions and 0 deletions.
  1. +23 −0 tools/rbp/Makefile
  2. +55 −0 tools/rbp/depends.mk
  3. +41 −0 tools/rbp/setup-sdk.sh
View
23 tools/rbp/Makefile
@@ -0,0 +1,23 @@
+include Makefile.include
+include depends.mk
+
+SOURCE=../../
+
+ifeq ($(USE_BUILDROOT),1)
+ export PATH:=$(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(SYSROOT)/usr/bin:$(PATH)
+endif
+
+CONFIGURE=./configure --prefix=$(PREFIX) --build=$(BUILD) --host=$(HOST)
+
+all: configure
+
+clean:
+distclean:
+ cd $(SOURCE);
+
+configure:
+ cd $(SOURCE); ./bootstrap
+ cd $(SOURCE); $(CONFIGURE)
+ cd $(SOURCE); make -j $(JOBS)
+ cd $(SOURCE); make install
+ cd $(SOURCE); make zip
View
55 tools/rbp/depends.mk
@@ -0,0 +1,55 @@
+ifeq ($(USE_BUILDROOT),1)
+ export CFLAGS=-pipe -O3 -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
+ export HOST=arm-unknown-linux-gnueabi
+ export BUILD=i686-linux
+ export PREFIX=$(XBMCPREFIX)
+ export SYSROOT=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot
+ export CFLAGS+=-isystem$(SYSROOT)/usr/include -isystem$(SYSROOT)/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(PREFIX)/include -isystem$(PREFIX)/usr/include/mysql --sysroot=$(SYSROOT)
+ export CXXFLAGS=$(CFLAGS) --sysroot=$(SYSROOT)
+ export CPPFLAGS=$(CFLAGS) --sysroot=$(SYSROOT)
+ export LDFLAGS=-L$(SYSROOT)/opt/vc/lib -L$(XBMCPREFIX)/lib
+ export LD=$(TOOLCHAIN)/bin/$(HOST)-ld
+ export CC=$(TOOLCHAIN)/bin/$(HOST)-gcc
+ export CXX=$(TOOLCHAIN)/bin/$(HOST)-g++
+ export OBJDUMP=$(TOOLCHAIN)/bin/$(HOST)-objdump
+ export RANLIB=$(TOOLCHAIN)/bin/$(HOST)-ranlib
+ export STRIP=$(TOOLCHAIN)/bin/$(HOST)-strip
+ export AR=$(TOOLCHAIN)/bin/$(HOST)-ar
+ export CXXCPP=$(CXX) -E
+ export PKG_CONFIG_PATH=$(PREFIX)/lib/pkgconfig
+ export PYTHON_VERSION=2.7
+ export PATH:=$(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)
+ export TEXTUREPACKER_NATIVE_ROOT=/usr
+ export PYTHON_LDFLAGS=-L$(SDKSTAGE)/usr/lib -lpython$(PYTHON_VERSION) -lpthread -ldl -lutil -lm
+else
+ export CFLAGS=-pipe -O3 -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=softfp -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations
+ export HOST=arm-bcm2708-linux-gnueabi
+ export BUILD=i686-linux
+ export PREFIX=${XBMCPREFIX}
+ export TARGETFS
+ export SYSROOT=/usr/local/bcm-gcc/arm-bcm2708-linux-gnueabi/sys-root
+ export RLINK_PATH=-Wl,-rpath-link,${SYSROOT}/lib -Wl,-rpath-link,${TARGETFS}/lib -Wl,-rpath-link,${TARGETFS}/usr/lib -Wl,-rpath-link,${TARGETFS}/opt/vc/
+ export CFLAGS+=-isystem${XBMCPREFIX}/include -isystem${SDKSTAGE}/usr/include -isystem${SDKSTAGE}/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem${SDKSTAGE}/opt/vc
+ export CFLAGS+=-L${XBMCPREFIX}/lib -L${SYSROOT}/lib -L${TARGETFS}/lib -L${TARGETFS}/usr/lib -L${TARGETFS}/opt/vc/lib ${RLINK_PATH}
+ export CXXFLAGS=${CFLAGS}
+ export CPPFLAGS=${CFLAGS}
+ export LDFLAGS=${RLINK_PATH} -L${TARGETFS}/lib -L${TARGETFS}/usr/lib -L${XBMCPREFIX}/lib
+ export LD=${TOOLCHAIN}/bin/${HOST}-ld
+ export AR=${TOOLCHAIN}/bin/${HOST}-ar
+ export CC=${TOOLCHAIN}/bin/${HOST}-gcc
+ export CXX=${TOOLCHAIN}/bin/${HOST}-g++
+ export CXXCPP=${CXX} -E
+ export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
+ export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
+ export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
+ #export ACLOCAL=aclocal -I ${SDKSTAGE}/usr/share/aclocal -I ${TARGETFS}/usr/share/aclocal-1.11
+ export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig:${SDKSTAGE}/lib/pkgconfig:${SDKSTAGE}/usr/lib/pkgconfig
+ export PKG_CONFIG_PATH=$(PREFIX)/bin/pkg-config
+ export PYTHON_VERSION=2.6
+ export PATH:=${PREFIX}/bin:$(PATH):${TOOLCHAIN}/bin
+ export TEXTUREPACKER_NATIVE_ROOT=/usr
+ export PYTHON_LDFLAGS=-L$(SDKSTAGE)/usr/lib -lpython$(PYTHON_VERSION)
+endif
+export PYTHON_CPPFLAGS=-I$(SDKSTAGE)/usr/include/python$(PYTHON_VERSION)
+export PYTHON_SITE_PKG=$(SDKSTAGE)/usr/lib/python$(PYTHON_VERSION)/site-packages
+export PYTHON_NOVERSIONCHECK=no-check
View
41 tools/rbp/setup-sdk.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+SCRIPT_PATH=$(cd `dirname $0` && pwd)
+
+USE_BUILDROOT=1
+
+if [ "$USE_BUILDROOT" = "1" ]; then
+ BUILDROOT=/opt/xbmc-bcm/buildroot-rbp
+ TARBALLS=/opt/xbmc-tarballs
+ XBMCPREFIX=/opt/xbmc-bcm/xbmc-bin
+
+ SDKSTAGE=$BUILDROOT/output/staging
+ TARGETFS=$BUILDROOT/output/target
+ TOOLCHAIN=$BUILDROOT/output/host/usr/
+else
+ TARBALLS=/opt/xbmc-tarballs
+ SDKSTAGE=/opt/bcm-rootfs
+ XBMCPREFIX=/opt/xbmc-bcm/xbmc-bin
+ TARGETFS=/opt/bcm-rootfs
+ TOOLCHAIN=/usr/local/bcm-gcc
+ BUILDROOT=/opt/bcm-rootfs
+fi
+
+sudo mkdir -p $XBMCPREFIX
+sudo chmod 777 $XBMCPREFIX
+mkdir -p $XBMCPREFIX/lib
+mkdir -p $XBMCPREFIX/include
+
+echo "SDKSTAGE=$SDKSTAGE" > $SCRIPT_PATH/Makefile.include
+echo "XBMCPREFIX=$XBMCPREFIX" >> $SCRIPT_PATH/Makefile.include
+echo "TARGETFS=$TARGETFS" >> $SCRIPT_PATH/Makefile.include
+echo "TOOLCHAIN=$TOOLCHAIN" >> $SCRIPT_PATH/Makefile.include
+echo "BUILDROOT=$BUILDROOT" >> $SCRIPT_PATH/Makefile.include
+echo "USE_BUILDROOT=$USE_BUILDROOT" >> $SCRIPT_PATH/Makefile.include
+echo "BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs" >> $SCRIPT_PATH/Makefile.include
+echo "TARBALLS_LOCATION=$TARBALLS" >> $SCRIPT_PATH/Makefile.include
+echo "RETRIEVE_TOOL=/usr/bin/curl" >> $SCRIPT_PATH/Makefile.include
+echo "RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output \$(TARBALLS_LOCATION)/\$(ARCHIVE)" >> $SCRIPT_PATH/Makefile.include
+echo "ARCHIVE_TOOL=/bin/tar" >> $SCRIPT_PATH/Makefile.include
+echo "ARCHIVE_TOOL_FLAGS=xf" >> $SCRIPT_PATH/Makefile.include
+echo "JOBS=$((`grep -c processor /proc/cpuinfo -1`))" >> $SCRIPT_PATH/Makefile.include
Please sign in to comment.
Something went wrong with that request. Please try again.