4 THIRDPARTY=$TOPDIR/thirdparty
5 echo "TOPDIR=$TOPDIR" > global_config
6 echo "THIRDPARTY=$TOPDIR/thirdparty" >> global_config
8 cpus=`grep -c "^proc" /proc/cpuinfo`
9 ( cd $THIRDPARTY; ./configure cv; \
10 export CFG_VARS='CFLAGS+=" -fPIC"'; \
11 export MAK_VARS='CFLAGS+=" -fPIC"'; \
12 export CFG_PARAMS="--with-pic --enable-pic --disable-asm"; \
15 static_libs=`make -C $THIRDPARTY -s val-static_libraries`
16 static_includes=`make -C $THIRDPARTY -s val-static_includes`
18 export LDFLAGS=`for f in $static_libs; do
19 if [ ! -f "$f" ]; then continue; fi;
21 done | sed -e 's;/[^/]*$;;' | \
22 sort -u | while read d; do
26 export LIBS=`for f in $static_libs; do
27 if [ ! -f "$f" ]; then continue; fi;
29 done | sed -e 's;.*/;;' -e 's;lib\(.*\)\.a$;\1;' | \
30 sort -u | while read a; do
34 export CFLAGS="$static_includes"
35 export CXXFLAGS="$static_includes"
37 if [ ! -f configure ]; then
40 sed -e 's/^LIBX264_LIBS=""/#LIBX264_LIBS=""/' -i configure
42 export MJPEG_LIBS="-L$THIRDPARTY/mjpegtools-2.1.0/utils/.libs -lmjpegutils \
43 -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavfile \
44 -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavjpeg \
45 -L$THIRDPARTY/mjpegtools-2.1.0/mpeg2enc/.libs -lmpeg2encpp \
46 -L$THIRDPARTY/mjpegtools-2.1.0/mplex/.libs -lmplex2"
47 export MJPEG_CFLAGS="-I$THIRDPARTY/mjpegtools-2.1.0/. \
48 -I$THIRDPARTY/mjpegtools-2.1.0/lavtools \
49 -I$THIRDPARTY/mjpegtools-2.1.0/utils"
51 export LIBX264_CFLAGS="-I$THIRDPARTY/x264-20151229/."
52 export LIBX264_LIBS="-L$THIRDPARTY/x264-20151229/. -lx264"
54 for f in $MJPEG_LIBS $LIBX264_LIBS; do
55 LIBS=`echo "$LIBS" | sed -e "s/[ ]*\<$f\>[ ]*/ /"`