Fetching contributors…
Cannot retrieve contributors at this time
executable file 128 lines (100 sloc) 3.38 KB
#!/bin/bash
PLATFORM="rpi"
DEFAULT_UI="glw"
CONFIGURE_POSTFIX="rpi"
source support/configure.inc
enable sqlite_internal
enable glw_backend_opengl_es
enable glw
enable polarssl
enable librtmp
enable httpserver
enable dvd
enable libfreetype
enable stdin
enable realpath
enable bspatch
enable libcec
enable avahi
enable connman
show_help(){
common_help
exit 1
}
[ -f project.config ] && source project.config
for opt do
optval="${opt#*=}"
case "$opt" in
--help) show_help
;;
--toolchain=*) TOOLCHAIN="$optval"
;;
--vcroot=*) VCROOT="$optval"
;;
--sysroot=*) SYSROOT="$optval"
;;
*)
common_opt $opt $optval
esac
done
[ -z "$TOOLCHAIN" ] && die_cause "--toolchain not specified"
CC=${TOOLCHAIN}gcc
CXX=${TOOLCHAIN}g++
setup_env "$@"
LIBAV_CFLAGS="-I${EXT_INSTALL_DIR}/include"
LIBAV_LDFLAGS="-L${EXT_INSTALL_DIR}/lib"
LIBAV_ARCH_FLAGS="--cross-prefix=${TOOLCHAIN} --enable-cross-compile --arch=arm --target-os=linux"
if [ -n "$SYSROOT" ]; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += --sysroot=$SYSROOT"
echo >>${CONFIG_MAK} "CFLAGS_cfg += --sysroot=$SYSROOT"
LIBAV_CFLAGS="--sysroot=$SYSROOT ${LIBAV_CFLAGS}"
LIBAV_LDFLAGS="--sysroot=$SYSROOT ${LIBAV_LDFLAGS}"
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/pkgconfig"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs zlib`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags zlib`
echo "Using zlib: `pkg-config --modversion zlib`"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs freetype2`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags freetype2`
echo "Using freetype: `pkg-config --modversion freetype2`"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gthread-2.0`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags gthread-2.0`
echo "Using gthread: `pkg-config --modversion gthread-2.0`"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gio-2.0`
echo >>${CONFIG_MAK} "CFLAGS_cfg += " `pkg-config --cflags gio-2.0`
echo "Using gio: `pkg-config --modversion gio-2.0`"
if enabled avahi; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs avahi-client`
echo >>${CONFIG_MAK} "CFLAGS_AVAHI += "`pkg-config --cflags avahi-client`
echo "Using AVAHI client: `pkg-config --modversion avahi-client`"
fi
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -lbz2"
if [ -z "$VCROOT" ]; then
VCROOT="${SYSROOT}/usr"
fi
else
zlib_setup
bzip2_setup
freetype_setup --host=arm-linux-gnueabihf
fi
ext_setup
cat >> ${CONFIG_MAK} <<EOF
CFLAGS_std += -fgnu89-inline
CFLAGS_std += -funwind-tables
CFLAGS_cfg += -DOMX_SKIP64BIT
CFLAGS_cfg += -DSTOS
CFLAGS_cfg += -I${VCROOT}/include
CFLAGS_cfg += -I${VCROOT}/include/IL
CFLAGS_cfg += -I${VCROOT}/include/interface/vcos/pthreads/
CFLAGS_cfg += -I${VCROOT}/include/interface/vmcs_host/linux
LDFLAGS_cfg += -L${VCROOT}/lib
LDFLAGS_cfg += -lvchostif -lopenmaxil -lGLESv2 -lEGL -lvcos -lbcm_host -lvchiq_arm
LDFLAGS_cfg += -lpthread -lrt -ldl
EOF
echo >>${CONFIG_H} "#define SHOWTIME_LIBDIR \"/stos/mnt/showtime/lib\""
if enabled release; then
# the rpi firmware have assignment to variables that are only
# referenced via asserts so we need this to work around that
echo >>${CONFIG_MAK} "CFLAGS_cfg += -Wno-error=unused-but-set-variable"
fi
finalize