11#! /bin/bash
22#
3- # Installs the open source dependencies
3+ # Installs the open source dependencies
44# for Kinesis Video Sdk demo application
5- # and builds the demo application
5+ # and builds the demo application
66#
77
88set -e
99
1010# Confirm the tools
11- echo " Starting to build the Kinesis Video Stream Demo Application
11+ echo " Starting to build the Kinesis Video Stream Demo Application
1212 - will be using the following open source libraries and tools
1313 openssl
1414 curl
@@ -25,7 +25,7 @@ echo " Starting to build the Kinesis Video Stream Demo Application
2525 autoconf
2626 automake
2727 m4
28- also the gstreamer , gstreamer plugins and x264.
28+ also the gstreamer, gstreamer plugins, yasm, gst-libav and x264.
2929 "
3030
3131echo "
@@ -122,7 +122,7 @@ if [ ! -f $DOWNLOADS/local/lib/liblog4cplus.dylib ]; then
122122 cd $DOWNLOADS
123123 tar -xvf log4cplus-1.2.0.tar.xz
124124 cd $DOWNLOADS /log4cplus-1.2.0
125- ./configure --prefix=$DOWNLOADS /local/
125+ ./configure --prefix=$DOWNLOADS /local/
126126 make
127127 make install
128128 fi
@@ -144,7 +144,7 @@ if [ ! -f $DOWNLOADS/local/lib/libgettextlib.dylib ]; then
144144 make install
145145 fi
146146fi
147-
147+
148148
149149echo " Checking libffi at $DOWNLOADS /local/lib/libffi.a"
150150if [ ! -f $DOWNLOADS /local/lib/libffi.dylib ]; then
244244 fi
245245 cd $DOWNLOADS
246246 tar -xvf flex-2.6.4.tar.xz
247- cd $DOWNLOADS /flex-2.6.4
247+ cd $DOWNLOADS /flex-2.6.4
248248 ./configure --prefix=$DOWNLOADS /local CFLAGS=" -I$DOWNLOADS /local/include" LDFLAGS=" -L$DOWNLOADS /local/lib"
249249 make
250250 make install
281281 make
282282 make install
283283 fi
284- fi
284+ fi
285285fi
286286
287287# --------- glib ------------------------------------------
336336 fi
337337 cd $DOWNLOADS
338338 tar -xvf m4-1.4.10.tar.xz
339- cd $DOWNLOADS /m4-1.4.10
339+ cd $DOWNLOADS /m4-1.4.10
340340 ./configure --prefix=$DOWNLOADS /local CFLAGS=" -I$DOWNLOADS /local/include" LDFLAGS=" -L$DOWNLOADS /local/lib"
341341 make
342342 make install
@@ -516,7 +516,54 @@ if [ ! -f $DOWNLOADS/local/lib/gstreamer-1.0/libgstx264.dylib ]; then
516516 make install
517517 fi
518518fi
519+
520+ echo " Checking for yasm"
521+ if [ ! -f $DOWNLOADS /local/bin/yasm ]; then
522+ echo " yasm-1.3.0.tar.gz not found. Installing"
523+ if [ ! -f $DOWNLOADS /yasm-1.3.0.tar.gz ]; then
524+ cd $DOWNLOADS
525+ curl -L " https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" -o " yasm-1.3.0.tar.gz"
526+ cd $DOWNLOADS
527+ fi
528+ cd $DOWNLOADS
529+ tar -xvf yasm-1.3.0.tar.gz
530+ cd $DOWNLOADS /yasm-1.3.0
531+
532+ for d in ./* / ; do
533+ if [ -f " $d /configure.ac" ]; then
534+ (cd " $d " && ./" ${DOWNLOADS} " /local/bin/autoreconf -f -i);
535+ fi
536+ done
537+ ./configure --prefix=$DOWNLOADS /local CFLAGS=" -I$DOWNLOADS /local/include" LDFLAGS=" -L$DOWNLOADS /local/lib"
538+ make
539+ make install
540+ fi
519541
542+ echo " Checking gst-libav in $DOWNLOADS /local/lib/"
543+ if [ ! -f $DOWNLOADS /local/lib/gstreamer-1.0/libgstlibav.so]; then
544+ if [ ! -f $DOWNLOADS /local/lib/gstreamer-1.0/libgstlibav.dylib]; then
545+
546+ echo " gst-libav not found. Installing"
547+ if [ ! -f $DOWNLOADS /gst-libav-1.12.4.tar.xz]; then
548+ cd $DOWNLOADS
549+ curl -L " https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.12.4.tar.xz" -o " gst-libav-1.12.4.tar.xz"
550+ fi
551+ cd $DOWNLOADS
552+ tar -xvf gst-libav-1.12.4.tar.xz
553+ cd $DOWNLOADS /gst-libav-1.12.4
554+
555+ for d in ./* / ; do
556+ if [ -f " $d /configure.ac" ]; then
557+ (cd " $d " && ./" ${DOWNLOADS} " /local/bin/autoreconf -f -i);
558+ fi
559+ done
560+ ./configure --prefix=$DOWNLOADS /local CFLAGS=" -I$DOWNLOADS /local/include" LDFLAGS=" -L$DOWNLOADS /local/lib"
561+ make
562+ make install
563+ fi
564+ fi
565+
566+
520567sys_info=` uname -m`
521568shopt -s nocasematch
522569if [[ $sys_info =~ ^arm ]]; then
@@ -546,6 +593,7 @@ if [[ $sys_info =~ ^arm ]]; then
546593 fi
547594fi
548595
596+
549597export PKG_CONFIG_LIBDIR=" $DOWNLOADS /local/lib/pkgconfig"
550598export CMAKE_PREFIX_PATH=" $DOWNLOADS /local"
551599
@@ -558,4 +606,3 @@ echo "**********************************************************"
558606echo Success!!!
559607echo " **********************************************************"
560608
561-
0 commit comments