-
Notifications
You must be signed in to change notification settings - Fork 127
/
configure.rpi
executable file
·128 lines (101 loc) · 3.42 KB
/
configure.rpi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/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
enable vmir
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 -D_FILE_OFFSET_BITS=64
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