Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / cfg-cv.sh
1 #!/bin/bash -x
2
3 TOPDIR=`pwd`
4 THIRDPARTY=$TOPDIR/thirdparty
5 echo "TOPDIR=$TOPDIR" > global_config
6 echo "THIRDPARTY=$TOPDIR/thirdparty" >> global_config
7
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"; \
13   make -j$cpus >& log )
14
15 static_libs=`make -C $THIRDPARTY -s val-static_libraries`
16 static_includes=`make -C $THIRDPARTY -s val-static_includes`
17
18 export LDFLAGS=`for f in $static_libs; do
19   if [ ! -f "$f" ]; then continue; fi;
20   ls $f
21 done | sed -e 's;/[^/]*$;;' | \
22 sort -u | while read d; do
23  echo -n " -L$d";
24 done`
25
26 export LIBS=`for f in $static_libs; do
27   if [ ! -f "$f" ]; then continue; fi;
28   ls $f
29 done | sed -e 's;.*/;;' -e 's;lib\(.*\)\.a$;\1;' | \
30 sort -u | while read a; do
31  echo -n " -l$a";
32 done`
33
34 export CFLAGS="$static_includes"
35 export CXXFLAGS="$static_includes"
36
37 if [ ! -f configure ]; then
38   ./autogen.sh
39 fi
40 sed -e 's/^LIBX264_LIBS=""/#LIBX264_LIBS=""/' -i configure
41
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"
50
51 export LIBX264_CFLAGS="-I$THIRDPARTY/x264-20151229/."
52 export LIBX264_LIBS="-L$THIRDPARTY/x264-20151229/. -lx264"
53
54 for f in $MJPEG_LIBS $LIBX264_LIBS; do
55   LIBS=`echo "$LIBS" | sed -e "s/[ ]*\<$f\>[ ]*/ /"`
56 done
57
58 echo LDFLAGS=$LDFLAGS
59 echo LIBS=$LIBS
60 echo CFLAGS=$CFLAGS
61
62 ./configure
63