update cv static thirdparty lib build
[goodguy/history.git] / cinelerra-5.1 / cfg-cv.sh
1 #!/bin/bash -x
2 # cd cincv;  cfg_cv.sh /path/cin5
3 cin="$1"
4 THIRDPARTY=`pwd`/thirdparty
5
6 rm -rf thirdparty; cp -a $cin/thirdparty .
7 for f in configure.ac Makefile.am autogen.sh; do mv $f $f.cv; cp -a $cin/$f .; done
8 mv m4 m4.cv
9 rm -rf ./libzmpeg3 ./db
10 mkdir libzmpeg3 db db/utils
11
12 ./autogen.sh
13 ./configure --disable-static-build --without-ladspa-build \
14   --enable-faac=yes --enable-faad2=yes --enable-a52dec=yes \
15   --enable-mjpegtools=yes --enable-lame=yes --enable-x264=yes \
16   --enable-libogg=auto --enable-libtheora=auto --enable-libvorbis=auto \
17   --enable-openexr=auto --enable-libsndfile=auto --enable-libdv=auto \
18   --enable-libjpeg=auto --enable-tiff=auto --enable-x264=auto \
19   --disable-audiofile --disable-encore --disable-esound --disable-fdk \
20   --disable-ffmpeg --disable-fftw --disable-flac --disable-giflib --disable-ilmbase \
21   --disable-libavc1394 --disable-libraw1394 --disable-libiec61883 --disable-libvpx \
22   --disable-openjpeg --disable-twolame --disable-x265
23
24 export CFG_VARS='CFLAGS+=" -fPIC"'; \
25 export MAK_VARS='CFLAGS+=" -fPIC"'; \
26 export CFG_PARAMS="--with-pic --enable-pic --disable-asm"; \
27
28 jobs=`make -s -C thirdparty val-WANT_JOBS`
29 make -C thirdparty -j$jobs
30
31 static_libs=`make -C thirdparty -s val-static_libs`
32 static_incs=`make -C thirdparty -s val-static_incs`
33
34 ./autogen.sh clean
35 for f in configure.ac Makefile.am autogen.sh; do rm -f $f; mv $f.cv $f; done
36 mv m4.cv m4
37
38 export LDFLAGS=`for f in $static_libs; do
39   if [ ! -f "$f" ]; then continue; fi;
40   ls $f
41 done | sed -e 's;/[^/]*$;;' | \
42 sort -u | while read d; do
43  echo -n " -L$d";
44 done`
45
46 export LIBS=-lpthread `for f in $static_libs; do
47   if [ ! -f "$f" ]; then continue; fi;
48   ls $f
49 done | sed -e 's;.*/;;' -e 's;lib\(.*\)\.a$;\1;' | \
50 sort -u | while read a; do
51  echo -n " -l$a";
52 done`
53
54 export CFLAGS="$static_incs"
55 export CXXFLAGS="$static_incs"
56
57 if [ ! -f configure ]; then ./autogen.sh; fi
58 sed -e 's/^LIBX264_LIBS=""/#LIBX264_LIBS=""/' -i configure
59
60 export MJPEG_LIBS="-L$THIRDPARTY/mjpegtools-2.1.0/utils/.libs -lmjpegutils \
61   -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavfile \
62   -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavjpeg \
63   -L$THIRDPARTY/mjpegtools-2.1.0/mpeg2enc/.libs -lmpeg2encpp \
64   -L$THIRDPARTY/mjpegtools-2.1.0/mplex/.libs -lmplex2"
65 export MJPEG_CFLAGS="-I$THIRDPARTY/mjpegtools-2.1.0/. \
66   -I$THIRDPARTY/mjpegtools-2.1.0/lavtools \
67   -I$THIRDPARTY/mjpegtools-2.1.0/utils"
68
69 export LIBX264_CFLAGS="-I$THIRDPARTY/x264-20151229/."
70 export LIBX264_LIBS="-L$THIRDPARTY/x264-20151229/. -lx264"
71
72 for f in $MJPEG_LIBS $LIBX264_LIBS; do
73   LIBS=`echo "$LIBS" | sed -e "s;[ ]*\<$f\>[ ]*; ;"`
74 done
75
76 echo LDFLAGS=$LDFLAGS
77 echo LIBS=$LIBS
78 echo CFLAGS=$CFLAGS
79
80 ./configure
81
82 #make -j$jobs >& log
83 #make install DESTDIR=`pwd` >> log 2>&1
84 #export LD_LIBRARY_PATH=`pwd`/usr/local/lib
85 #cd cinelerra
86 #gdb ./.libs/cinelerra
87