forked from ozonesecurity/ozonebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ozone-build.sh
executable file
·48 lines (40 loc) · 2.13 KB
/
ozone-build.sh
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
#!/bin/bash
if [ -z "$INSTALLDIR" ];
then
echo "Please set variable \$INSTALLDIR to the base path where oZone is to be installed";
exit;
fi
OZBUILDMODE="Release"
DLIBBUILDMODE="Release"
if [ "$1" == 'help' ] || [ "$1" == 'h' ]; then
echo "usage: $0 [release|debug|alldebug]"
echo ""
echo "release - no debugging symbols/optimizations enabled"
echo "debug - ozone libs will be built with debugging symbols, dlib will be built in release mode"
echo "alldebug - both ozone and dlib will be built in debug mode. Note Dlib can get very slow"
echo ""
exit
fi
if [ "$1" == "debug" ];
then
DLIBBUILDMODE="Release"
OZBUILDMODE="Debug"
fi
if [ "$1" == "alldebug" ];
then
DLIBBUILDMODE="Debug"
OZBUILDMODE="Debug"
fi
echo "dlib build mode is: ${DLIBBUILDMODE}"
echo "Ozone build mode is: ${OZBUILDMODE}"
mkdir -p $INSTALLDIR
git submodule update --init --recursive
echo "==================== Building OPENH264 ====================="
( cd externals/openh264/ && make PREFIX="$INSTALLDIR" install )
echo "==================== Building FFMPEG ====================="
#( cd externals/ffmpeg && PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig ./configure --enable-shared --enable-libv4l2 --enable-libopenh264 --prefix=$INSTALLDIR && make install )
( cd externals/ffmpeg && PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig ./configure --enable-shared --enable-libv4l2 --enable-libopenh264 --enable-libfreetype --enable-libfontconfig --prefix=$INSTALLDIR && make install )
echo "==================== Building DLIB ====================="
( cd externals/dlib && mkdir -p build && cd build && cmake .. -DCMAKE_PREFIX_PATH=$INSTALLDIR -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_INSTALL_RPATH=$INSTALLDIR/lib -DUSE_AVX_INSTRUCTIONS=ON -DCMAKE_VERBOSE_MAKEFILE=ON && cmake --build . --config ${DLIBBUILDMODE} && make install )
echo "==================== Building OZONE ====================="
( cd server && cmake -DCMAKE_INCLUDE_PATH=$INSTALLDIR/include -DCMAKE_PREFIX_PATH=$INSTALLDIR -DOZ_EXAMPLES=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_INSTALL_RPATH=$INSTALLDIR/lib -DCMAKE_BUILD_TYPE=${BUILDMODE} . && make install )