Skip to content

Commit

Permalink
Add Stasik0's prepare-native-raspbian.sh script to help building on t…
Browse files Browse the repository at this point in the history
…he Pi
  • Loading branch information
popcornmix committed Mar 26, 2013
1 parent aec02f4 commit 5b36923
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ development headers to install on the running Pi system for the crosscompiling.

Edit Makefile.include and change the settings according your locations.

### Compiling on the Pi

You can also compile it on the PI the native way ;)

Running OMXPlayer
-----------------

make ffmpeg
make
make dist
Expand All @@ -39,6 +32,15 @@ Installing OMXPlayer
Copy over `omxplayer-dist/*` to the Pi `/`. You may want to specify a valid font
path inside the `omxplayer` shell script.

### Compiling on the Pi

You can also compile it on the PI the native way ;)
Run this script (which will install packages and update firmware)
./prepare-native-raspbian.sh
and build with
make ffmpeg
make

Using OMXPlayer
---------------

Expand Down
54 changes: 54 additions & 0 deletions prepare-native-raspbian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh

echo "Patching makefiles..."
echo "FLOAT=hard
CFLAGS += -mfloat-abi=hard -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -O3 -mstructure-size-boundary=32 -mno-sched-prolog -march=armv6zk
BUILDROOT :=/usr/local/src/omxplayer
TOOLCHAIN :=/usr/
LD := \$(TOOLCHAIN)/bin/ld
CC := \$(TOOLCHAIN)/bin/gcc
CXX := \$(TOOLCHAIN)/bin/g++
OBJDUMP := \$(TOOLCHAIN)/bin/objdump
RANLIB := \$(TOOLCHAIN)/bin/ranlib
STRIP := \$(TOOLCHAIN)/bin/strip
AR := \$(TOOLCHAIN)/bin/ar
CXXCP := \$(CXX) -E
LDFLAGS += -L/opt/vc/lib -L/lib -L/usr/lib -lfreetype
INCLUDES += -I/opt/vc/include/interface/vcos/pthreads \
-I/opt/vc/include \
-I/opt/vc/include/interface/vmcs_host \
-I/usr/include \
-I/usr/include/freetype2" > Makefile.include

sed -i '/--enable-cross-compile \\/d;' Makefile.ffmpeg
sed -i 's/ --cross-prefix=$(HOST)-//g;' Makefile.ffmpeg
sed -i 's/ --disable-debug \\/ --disable-debug /g;' Makefile.ffmpeg

sed -i 's/$(HOST)-//g;' Makefile.*
sed -i 's/ -j9//g;' Makefile.*
sed -i 's/#arm-unknown-linux-gnueabi-strip/arm-unknown-linux-gnueabi-strip/g;' Makefile
sed -i 's/arm-unknown-linux-gnueabi-strip/strip/g;' Makefile

echo "
install: dist
cp omxplayer-dist/* / -r" >> Makefile

echo "Installing packages..."
sudo apt-get update
sudo apt-get -y install ca-certificates git-core subversion binutils libva1 libpcre3-dev libidn11-dev libboost1.50-dev libfreetype6-dev libusb-1.0-0-dev
sudo apt-get -y install gcc-4.7 g++-4.7
pushd /usr/bin && sudo rm gcc && sudo ln -s gcc-4.7 gcc && sudo rm g++ && sudo ln -s g++-4.7 g++ && popd


echo "Installing the rpi-update script..."
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
echo "Updating firmware..."
sudo rpi-update

echo "In order to compile ffmpeg you need to set memory_split to 16 for 256MB RAM PIs (0 does not work) or to at most 256 for 512MB RAM PIs, respectively. Otherwise there is not enough RAM to compile ffmpeg. Please do the apropriate in the raspi-config and select finish to reboot your RPi. Warning: to run compiled omxplayer please start raspi-config again and set memory_split to at least 128. [Press RETURN to continue]"
read -r REPLY
sudo raspi-config

0 comments on commit 5b36923

Please sign in to comment.