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