Tag Archives: cross-compile

Cross-compiling nano with UTF-8 support for Synology

export CROSS_PREFIX=i686-pc-linux-gnu
export TARGET=i686-pc-linux-gnu
export TOOLCHAIN=/usr/local/evansport-pc-linux-gnu
export AR=${TOOLCHAIN}/bin/${CROSS_PREFIX}-ar
export AS=${TOOLCHAIN}/bin/${CROSS_PREFIX}-as
export CC=${TOOLCHAIN}/bin/${CROSS_PREFIX}-gcc
export CXX=${TOOLCHAIN}/bin/${CROSS_PREFIX}-g++
export LD=${TOOLCHAIN}/bin/${CROSS_PREFIX}-ld
export LDSHARED="${TOOLCHAIN}/bin/${CROSS_PREFIX}-gcc -shared "
export RANLIB=${TOOLCHAIN}/bin/${CROSS_PREFIX}-ranlib
export CFLAGS="-I${TOOLCHAIN}/include -O3 ${MARCH}"
export LDFLAGS="-L${TOOLCHAIN}/lib"
export PKG_CONFIG_PATH="${TOOLCHAIN}/lib/pkgconfig"

#DSM 5.0 already includes libncursesw so we can link the nano binary to this
#fetch the source which was extracted from the Synology DSM 5.0 source tarball
wget https://dl.dropboxusercontent.com/u/1188556/ncurses-5.x.zip
unzip ncurses-5.x.zip
cd ncurses-5.x
./configure --prefix=${TOOLCHAIN} --host=${TARGET} --build=x86_64-linux-gnu --with-shared --without-normal --without-progs --without-debug --enable-widec
make
make install
cd ..
wget http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
tar xvzf nano-2.2.6.tar.gz
cd nano-2.2.6
#src/nano.h:92:20: fatal error: curses.h: No such file or directory
#http://blog.csdn.net/alienspy/article/details/24135761
wget http://dl.dropboxusercontent.com/u/1188556/nano.h.patch
patch nano.h < nano.h.patch
CFLAGS="${CFLAGS} -I${TOOLCHAIN}/include/ncurses" ./configure --prefix=${TOOLCHAIN} --host=${TARGET} --build=x86_64-linux-gnu --enable-utf8 --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc
#sudo apt-get install texinfo
sed -i -e "s%^CPPFLAGS = -I/usr/include/ncursesw%CPPFLAGS = -I${TOOLCHAIN}/include/ncurses%" Makefile
sed -i -e "s%^CPPFLAGS = -I/usr/include/ncursesw%CPPFLAGS = -I${TOOLCHAIN}/include/ncurses%" src/Makefile
make
make install
#now install it to /usr/local/bin
 

nano.h.patch

--- src/nano.h.old      2014-09-17 12:16:15.006206100 +0100
+++ src/nano.h  2014-09-17 12:19:01.226206100 +0100
@@ -86,10 +86,10 @@
 #define KEY_IC SL_KEY_IC
 /* Ncurses support. */
 #elif defined(HAVE_NCURSES_H)
-#include <ncurses.h>
+#include <ncursesw/ncurses.h>
 #else
 /* Curses support. */
-#include <curses.h>
+#include <ncursesw/curses.h>
 #endif /* CURSES_H */

 #ifdef ENABLE_NLS
 

~/.nanorc

# BASIC
syntax "BAS" "\.(bas|BAS|bas.txt)$"
color red "^ +[0-9]* "
color red "\b(GO TO|GO SUB) ([0-9]+)\b"
color yellow "\b(AND|NOT|OR)\b"
color yellow "(|=|<|>|<=|>=|<>)"
color magenta "\b(FOR [a-z]|NEXT [a-z]|GO TO|GO SUB|RETURN)\b"
color brightwhite "\b(IF|THEN)\b"
color green ""(\\.|[^\"])*""
color brightcyan "\bREM .*$"

##############################################################################
#
# Syntax highlighting for XML files
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################
syntax "ml" ".*\.([jrs]?html?|xml|sgml?)$"
color white "^.+$"
color green  start="<" end=">"
color cyan   "<[^> ]+"
color cyan   ">"
color yellow start="<!DOCTYPE" end="[/]?>"
color yellow start="<!--" end="-->"
color red    "&[^;]*;"

##############################################################################
#
# Syntax highlighting for HTTP codes
#
# Author:  Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2  or later
#
# Version: 2004-02-25
#
##############################################################################
syntax "urls"
color brightmagenta   "^.*$"
color cyan      "^(1[0-9][0-9]|20[256]|30[45]).*$"
color green      "^20[03].*$"
color brightyellow   "^(201|30[0-37]).*$"
color brightred      "^(204|[45][0-9][0-9]|666).*$"

##############################################################################
#
# Syntax highlighting for CSS files
#
# Author:  Simon Rupf, simon.rupf(a)int-ag.ch
# License: GPL 2  or later
#
# Version: 2005-02-14
#
##############################################################################
syntax "css" "\.css$"
color brightred     "."
color brightyellow  start="\{" end="\}"
color brightwhite           start=":" end="[;^\{]"
color brightblue    ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
color brightblue    start="\/\*" end="\\*/"
color green         ";|:|\{|\}"

syntax "sh" "\.sh$"
#icolor brightgreen "^[0-9A-Z_]+\(\)"
#color green "\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\b"
#color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
#color green "-[Ldefgruwx]\b"
#color green "-(eq|ne|gt|lt|ge|le|s|n|z)\b"
#color brightblue "\b(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\b"
icolor brightwhite "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color brightcyan "(^|[[:space:]])#.*$"
#color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
#color cyan ""(\\.|[^"])*"" "'(\\.|[^'])*'"
#color ,green "[[:space:]]+$"

Compiling FFmpeg with libRTMP and libmp3lame for Intel, ARM and QorIQ PowerPC CPUs

Intel cross-compile for Synology NAS on Ubuntu Desktop 12.04 64bit (VirtualBox VM running on a Macbook Air):

#-----set up Synology toolchain
cd ~/Downloads
PART1="http://sourceforge.net/projects/dsgpl/files/DSM%204.0%20Tool%20Chains/"
PART2="Intel%20x86%20Linux%202.6.32%20%28Pineview%29/gcc420_glibc236_x64-GPL.tgz"
wget "${PART1}${PART2}"
tar xvzf gcc420_glibc236_x64-GPL.tgz
sudo mv x86_64-linux-gnu /usr/local
export PATH="/usr/local/x86_64-linux-gnu/bin:${PATH}"

#-----libz static lib
wget http://zlib.net/zlib-1.2.7.tar.gz
tar xvzf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --prefix=/usr/local/x86_64-linux-gnu --static
make libz.a
cp libz.a /usr/local/x86_64-linux-gnu/lib
cp *.h /usr/local/x86_64-linux-gnu/include/
cd ..

#-----libbz2 static lib
#-----seem to need 32bit libraries to build bzip2
#-----http://maketecheasier.com/run-32-bit-apps-in-64-bit-linux/2009/08/10
sudo apt-get install ia32-libs
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xvfz bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
sed -i 's/^CC=gcc/CC=x86_64-linux-gnu-gcc/g' Makefile
sed -i 's/^AR=ar rc/AR=x86_64-linux-gnu-ar rc/g' Makefile
sed -i 's/^RANLIB=ranlib/RANLIB=x86_64-linux-gnu-ranlib/g' Makefile
make
make install PREFIX=/usr/local/x86_64-linux-gnu
cd ..

#-----libmp3lame static lib
sudo apt-get install nasm
wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
tar xvzf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix=/usr/local/x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --build=x86_64-linux-gnu --enable-static --disable-shared --disable-decoder --enable-nasm
make
make install
cd..

#-----libssl & libcrypto static libs
wget http://www.openssl.org/source/openssl-0.9.8v.tar.gz
tar xvzf openssl-0.9.8v.tar.gz
cd openssl-0.9.8v
./config --prefix=/usr/local/x86_64-linux-gnu no-shared
sed -i 's/^CC= gcc/CC= x86_64-linux-gnu-gcc/g' Makefile
sed -i 's/^AR= ar /AR= x86_64-linux-gnu-ar /g' Makefile
sed -i 's/^ARD=ar /ARD=x86_64-linux-gnu-ar /g' Makefile
sed -i 's/^RANLIB= \/usr\/bin\/ranlib/RANLIB=x86_64-linux-gnu-ranlib/g' Makefile
sed -i 's/^MAKEDEPPROG= gcc/MAKEDEPPROG= x86_64-linux-gnu-gcc /g' Makefile
make
make install
cd ..

#-----librtmp 2.4 static lib
wget http://download.serviio.org/opensource/rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
tar xvfz rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
cd rtmpdump
#-----move all static libs to a separate folder to force compiler to use them
#-----http://www.gossamer-threads.com/lists/apache/dev/265052
mkdir /tmp/lib
cp /usr/local/x86_64-linux-gnu/lib/*.a /tmp/lib
#-----fix Makefile (won't compile without libdl linked)
#-----http://forum.luahub.com/index.php?topic=2390.0
sed -i.bak -e '/^LIB_OPENSSL\=/s/lcrypto/lcrypto \-ldl/' Makefile
make CROSS_COMPILE=x86_64-linux-gnu- SYS=posix prefix=/usr/local/x86_64-linux-gnu INC=-I/usr/local/x86_64-linux-gnu XLDFLAGS=-L/tmp/lib SHARED=
make install prefix=/usr/local/x86_64-linux-gnu SHARED=
cd ..

#-----gather all static libs again ready for FFmpeg compile
cp /usr/local/x86_64-linux-gnu/lib/*.a /tmp/lib
#-----remove unsupported URL line from pkgconfig/librtmp.pc
#-----pkg-config --exists --print-errors librtmp
sed -i -e '/^URL/d' /usr/local/x86_64-linux-gnu/lib/pkgconfig/librtmp.pc
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/x86_64-linux-gnu/lib/pkgconfig"

#-----FFmpeg 0.11.1
wget http://download.serviio.org/opensource/ffmpeg-N-41860-g6fd0b55.tar.gz
tar xvzf ffmpeg-N-41860-g6fd0b55.tar.gz
cd ffmpeg
echo N-41860-g6fd0b55 > RELEASE
#-----Intel CPU-specific options
#-----pkg-config needs to be defined because with cross-prefix it assumes x86_64-linux-gnu-pkg-config which doesn't exist, and then librtmp won't be detected
sudo apt-get install yasm
./configure --arch=x86_64 --enable-ssse3 --cross-prefix=x86_64-linux-gnu- --target-os=linux --prefix=/usr/local/x86_64-linux-gnu --extra-cflags='-I/usr/local/x86_64-linux-gnu/include' --extra-ldflags='-L/tmp/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-pthreads --enable-libmp3lame --enable-librtmp --pkg-config=pkg-config --extra-version=Serviio
make
./ffmpeg
 

ARM cross-compile for Synology NAS on Ubuntu Desktop 12.04 64bit (VirtualBox VM running on a Macbook Air):

#-----set up Synology toolchain
cd ~/Downloads
PART1="http://sourceforge.net/projects/dsgpl/files/DSM%204.1%20Tool%20Chains/"
PART2="Marvell%2088F628x%20Linux%202.6.32/gcc421_glibc25_88f6281-GPL.tgz"
wget "${PART1}${PART2}"
tar xvzf gcc421_glibc25_88f6281-GPL.tgz
sudo mv arm-none-linux-gnueabi /usr/local
export PATH=/usr/local/arm-none-linux-gnueabi/bin:$PATH
export AR=arm-none-linux-gnueabi-ar
export CC=arm-none-linux-gnueabi-gcc
export CXX=arm-none-linux-gnueabi-g++
export LD=arm-none-linux-gnueabi-ld
export RANLIB=arm-none-linux-gnueabi-ranlib
export CFLAGS="-I/usr/local/arm-none-linux-gnueabi/include"
export LDFLAGS="-L/usr/local/arm-none-linux-gnueabi/lib"

#-----libz static lib
wget http://zlib.net/zlib-1.2.7.tar.gz
tar xvzf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --prefix=/usr/local/arm-none-linux-gnueabi --static
make libz.a
cp libz.a /usr/local/arm-none-linux-gnueabi/lib
cp *.h /usr/local/arm-none-linux-gnueabi/include/
cd ..

#-----libbz2 static lib
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xvfz bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
sed -i 's/^CC=gcc/CC=arm-none-linux-gnueabi-gcc/g' Makefile
sed -i 's/^AR=ar/AR=arm-none-linux-gnueabi-ar/g' Makefile
sed -i 's/^RANLIB=ranlib/RANLIB=arm-none-linux-gnueabi-ranlib/g' Makefile
#remove the tests - we can't run the native binaries
sed -i 's/^\(all: libbz2\.a bzip2 bzip2recover\) test/\1/' Makefile
make
make install PREFIX=/usr/local/arm-none-linux-gnueabi
cd ..

#-----libmp3lame static lib
wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
tar xvzf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix=/usr/local/arm-none-linux-gnueabi --host=arm-none-linux-gnueabi --build=x86_64-linux-gnu --enable-static --disable-shared --disable-decoder
make
make install
cd ..

#-----libssl & libcrypto static libs
wget http://www.openssl.org/source/openssl-0.9.8v.tar.gz
tar xvzf openssl-0.9.8v.tar.gz
cd openssl-0.9.8v
#Some kind of strange issue where cross compilation parameters are ignored
#unless this fix is used http://marc.waeckerlin.org/computer/blog/openssl_fuer_windows_mingw_unter_linux_crosscomilieren
sed -i 's/\(die \"target already defined - \$target (offending arg\)/#\1/' Configure
./config --prefix=/usr/local/arm-none-linux-gnueabi no-shared linux-generic32
make
make install
cd ..

#-----librtmp 2.4 static lib
wget http://download.serviio.org/opensource/rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
tar xvfz rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
cd rtmpdump
#-----move all static libs to a separate folder to force compiler to use them
#-----http://www.gossamer-threads.com/lists/apache/dev/265052
mkdir /tmp/lib
cp /usr/local/arm-none-linux-gnueabi/lib/*.a /tmp/lib
#-----fix Makefile (won't compile without libdl linked)
#-----http://forum.luahub.com/index.php?topic=2390.0
sed -i.bak -e '/^LIB_OPENSSL\=/s/lcrypto/lcrypto \-ldl/' Makefile
make CROSS_COMPILE=arm-none-linux-gnueabi- SYS=posix prefix=/usr/local/arm-none-linux-gnueabi INC=-I/usr/local/arm-none-linux-gnueabi XLDFLAGS=-L/tmp/lib SHARED=
make install prefix=/usr/local/arm-none-linux-gnueabi SHARED=
cd ..

#-----gather all static libs again ready for FFmpeg compile
cp /usr/local/arm-none-linux-gnueabi/lib/*.a /tmp/lib
#-----remove unsupported URL line from pkgconfig/librtmp.pc
#-----pkg-config --exists --print-errors librtmp
sed -i -e '/^URL/d' /usr/local/arm-none-linux-gnueabi/lib/pkgconfig/librtmp.pc
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/arm-none-linux-gnueabi/lib/pkgconfig"

#-----FFmpeg
wget http://download.serviio.org/opensource/ffmpeg-N-42368-gbf53863.tar.gz
tar xvzf ffmpeg-N-42368-gbf53863.tar.gz
cd ffmpeg
#-----fixed point maths modification for mpeg audio encoder
sed -i "s/^#define USE_FLOATS//" libavcodec/mpegaudioenc.c
#-----Marvell Kirkwood mv6282 CPU is based on the ARMv5TE core which has DSP and thumb instruction support
#-----http://www.arm.com/products/processors/technologies/dsp-simd.php
#-----http://www.marvell.com/embedded-processors/kirkwood/assets/88f6282-3_pb.pdf
#-----ARMv5TE CPU-specific options (based on inspecting 'configure' source https://github.com/FFmpeg/FFmpeg/blob/master/configure)
#-----pkg-config needs to be defined because with cross-prefix it assumes arm-none-linux-gnueabi-pkg-config which doesn't exist, and then librtmp won't be detected
#-----zmbv encoder refuses to cross compile here so it's disabled
./configure --arch=arm --cpu=armv5te --cross-prefix=arm-none-linux-gnueabi- --target-os=linux --prefix=/usr/local/arm-none-linux-gnueabi --extra-cflags='-I/usr/local/arm-none-linux-gnueabi/include' --extra-ldflags='-L/tmp/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-pthreads --enable-libmp3lame --enable-librtmp --disable-encoder=zmbv --pkg-config=pkg-config --extra-version=Serviio
make

./ffmpeg

Freescale QorIQ P1022 PowerPC cross-compile for Synology NAS on Ubuntu Desktop 12.04 64bit (VirtualBox VM running on a Macbook Air):

#-----set up Synology toolchain
cd ~/Downloads
PART1="http://sourceforge.net/projects/dsgpl/files/DSM%204.1%20Tool%20Chains/"
PART2="PowerPC%20QorIQ%20Linux%202.6.32/gcc4374_eglibc2874_qoriq-GPL.tgz"
wget "${PART1}${PART2}"
tar xvzf gcc4374_eglibc2874_qoriq-GPL.tgz
sudo mv powerpc-none-linux-gnuspe /usr/local
export PATH=/usr/local/powerpc-none-linux-gnuspe/bin:$PATH
export AR=powerpc-none-linux-gnuspe-ar
export CC=powerpc-none-linux-gnuspe-gcc
export CXX=powerpc-none-linux-gnuspe-g++
export LD=powerpc-none-linux-gnuspe-ld
export RANLIB=powerpc-none-linux-gnuspe-ranlib
export CFLAGS="-I/usr/local/powerpc-none-linux-gnuspe/include"
export LDFLAGS="-L/usr/local/powerpc-none-linux-gnuspe/lib"

#-----libz static lib
wget http://zlib.net/zlib-1.2.7.tar.gz
tar xvzf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --prefix=/usr/local/powerpc-none-linux-gnuspe --static
make libz.a
cp libz.a /usr/local/powerpc-none-linux-gnuspe/lib
cp *.h /usr/local/powerpc-none-linux-gnuspe/include/
cd ..

#-----libbz2 static lib
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xvfz bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
sed -i 's/^CC=gcc/CC=powerpc-none-linux-gnuspe-gcc/g' Makefile
sed -i 's/^AR=ar/AR=powerpc-none-linux-gnuspe-ar/g' Makefile
sed -i 's/^RANLIB=ranlib/RANLIB=powerpc-none-linux-gnuspe-ranlib/g' Makefile
#remove the tests - we can't run the native binaries
sed -i 's/^\(all: libbz2\.a bzip2 bzip2recover\) test/\1/' Makefile
make
make install PREFIX=/usr/local/powerpc-none-linux-gnuspe
cd ..

#-----libmp3lame static lib
wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
tar xvzf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix=/usr/local/powerpc-none-linux-gnuspe --host=powerpc-none-linux-gnuspe --build=x86_64-linux-gnu --enable-static --disable-shared --disable-decoder
make
make install
cd..

#-----libssl & libcrypto static libs
wget http://www.openssl.org/source/openssl-0.9.8v.tar.gz
tar xvzf openssl-0.9.8v.tar.gz
cd openssl-0.9.8v
#Some kind of strange issue where cross compilation parameters are ignored
#unless this fix is used http://marc.waeckerlin.org/computer/blog/openssl_fuer_windows_mingw_unter_linux_crosscomilieren
sed -i 's/\(die \"target already defined - \$target (offending arg\)/#\1/' Configure
./config --prefix=/usr/local/powerpc-none-linux-gnuspe no-shared linux-ppc
make
make install
cd ..

#-----librtmp 2.4 static lib
wget http://download.serviio.org/opensource/rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
tar xvfz rtmpdump-c58cfb3e9208c6e6bc1aa18f1b1d650d799084e5.tar.gz
cd rtmpdump
#-----move all static libs to a separate folder to force compiler to use them
#-----http://www.gossamer-threads.com/lists/apache/dev/265052
mkdir /tmp/lib
cp /usr/local/powerpc-none-linux-gnuspe/lib/*.a /tmp/lib
#-----fix Makefile (won't compile without libdl linked)
#-----http://forum.luahub.com/index.php?topic=2390.0
sed -i.bak -e '/^LIB_OPENSSL\=/s/lcrypto/lcrypto \-ldl/' Makefile
make CROSS_COMPILE=powerpc-none-linux-gnuspe- SYS=posix prefix=/usr/local/powerpc-none-linux-gnuspe INC=-I/usr/local/powerpc-none-linux-gnuspe XLDFLAGS=-L/tmp/lib SHARED=
make install prefix=/usr/local/powerpc-none-linux-gnuspe SHARED=
cd ..

#-----gather all static libs again ready for FFmpeg compile
cp /usr/local/powerpc-none-linux-gnuspe/lib/*.a /tmp/lib
#-----remove unsupported URL line from pkgconfig/librtmp.pc
#-----pkg-config --exists --print-errors librtmp
sed -i -e '/^URL/d' /usr/local/powerpc-none-linux-gnuspe/lib/pkgconfig/librtmp.pc
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/powerpc-none-linux-gnuspe/lib/pkgconfig"

#-----FFmpeg
wget http://download.serviio.org/opensource/ffmpeg-N-42368-gbf53863.tar.gz
tar xvzf ffmpeg-N-42368-gbf53863.tar.gz
cd ffmpeg
#-----QorIQ P1022 CPU is based on the PowerPC e500v2 core which has Signal Processing Engine which is not a classic FPU design
#-----some QorIQ models have e500mc cores with true FPUs but these are not used in 2013 series Synology NAS
#-----http://en.wikipedia.org/wiki/QorIQ
#-----http://cache.freescale.com/files/32bit/doc/fact_sheet/QP1022FS.pdf?fpsp=1
#-----PowerPC e500v2 CPU-specific options (based on inspecting source https://github.com/FFmpeg/FFmpeg/blob/master/configure)
#-----pkg-config needs to be defined because with cross-prefix it assumes powerpc-none-linux-gnuspe-pkg-config which doesn't exist, and then librtmp won't be detected
./configure --arch=ppc --cpu=e500v2 --cross-prefix=powerpc-none-linux-gnuspe- --target-os=linux --prefix=/usr/local/powerpc-none-linux-gnuspe --extra-cflags='-I/usr/local/powerpc-none-linux-gnuspe/include' --extra-ldflags='-L/tmp/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-pthreads --enable-libmp3lame --enable-librtmp --pkg-config=pkg-config --extra-version=Serviio
make
./ffmpeg