From: Good Guy Date: Fri, 19 Feb 2016 21:54:30 +0000 (-0700) Subject: thirdparty lib CV build script mods X-Git-Url: http://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=0fb566814c8a2948506be87ea7ecd08128ae119b;p=goodguy%2Fhistory.git thirdparty lib CV build script mods --- diff --git a/cinelerra-5.0/cfg-cv.sh b/cinelerra-5.0/cfg-cv.sh new file mode 100755 index 00000000..0d2b5aea --- /dev/null +++ b/cinelerra-5.0/cfg-cv.sh @@ -0,0 +1,63 @@ +#!/bin/bash -x + +TOPDIR=`pwd` +THIRDPARTY=$TOPDIR/thirdparty +echo "TOPDIR=$TOPDIR" > global_config +echo "THIRDPARTY=$TOPDIR/thirdparty" >> global_config + +cpus=`grep -c "^proc" /proc/cpuinfo` +( cd $THIRDPARTY; ./configure cv; \ + export CFG_VARS='CFLAGS+=" -fPIC"'; \ + export MAK_VARS='CFLAGS+=" -fPIC"'; \ + export CFG_PARAMS="--with-pic --enable-pic --disable-asm"; \ + make -j$cpus >& log ) + +static_libs=`make -C $THIRDPARTY -s val-static_libraries` +static_includes=`make -C $THIRDPARTY -s val-static_includes` + +export LDFLAGS=`for f in $static_libs; do + if [ ! -f "$f" ]; then continue; fi; + ls $f +done | sed -e 's;/[^/]*$;;' | \ +sort -u | while read d; do + echo -n " -L$d"; +done` + +export LIBS=`for f in $static_libs; do + if [ ! -f "$f" ]; then continue; fi; + ls $f +done | sed -e 's;.*/;;' -e 's;lib\(.*\)\.a$;\1;' | \ +sort -u | while read a; do + echo -n " -l$a"; +done` + +export CFLAGS="$static_includes" +export CXXFLAGS="$static_includes" + +if [ ! -f configure ]; then + ./autogen.sh +fi +sed -e 's/^LIBX264_LIBS=""/#LIBX264_LIBS=""/' -i configure + +export MJPEG_LIBS="-L$THIRDPARTY/mjpegtools-2.1.0/utils/.libs -lmjpegutils \ + -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavfile \ + -L$THIRDPARTY/mjpegtools-2.1.0/lavtools/.libs -llavjpeg \ + -L$THIRDPARTY/mjpegtools-2.1.0/mpeg2enc/.libs -lmpeg2encpp \ + -L$THIRDPARTY/mjpegtools-2.1.0/mplex/.libs -lmplex2" +export MJPEG_CFLAGS="-I$THIRDPARTY/mjpegtools-2.1.0/. \ + -I$THIRDPARTY/mjpegtools-2.1.0/lavtools \ + -I$THIRDPARTY/mjpegtools-2.1.0/utils" + +export LIBX264_CFLAGS="-I$THIRDPARTY/x264-20151229/." +export LIBX264_LIBS="-L$THIRDPARTY/x264-20151229/. -lx264" + +for f in $MJPEG_LIBS $LIBX264_LIBS; do + LIBS=`echo "$LIBS" | sed -e "s/[ ]*\<$f\>[ ]*/ /"` +done + +echo LDFLAGS=$LDFLAGS +echo LIBS=$LIBS +echo CFLAGS=$CFLAGS + +./configure + diff --git a/cinelerra-5.0/thirdparty/Makefile b/cinelerra-5.0/thirdparty/Makefile index 89d4b5bc..6e3a2323 100644 --- a/cinelerra-5.0/thirdparty/Makefile +++ b/cinelerra-5.0/thirdparty/Makefile @@ -69,11 +69,11 @@ $(call pkg-source,$(1)): $(call pkg-config,$(1)): $(call pkg-source,$(1)) $(foreach dep,$(2),$(call bld_depends,$(dep))) @echo "CONFIGURING $(1)" cd $(1)* && \ - $($(1).cfg_vars) ./configure $($(1).cfg_params) + $($(1).cfg_vars) $(CFG_VARS) ./configure $($(1).cfg_params) $(CFG_PARAMS) touch $$@ $(call pkg-built,$(1)): $(call pkg-config,$(1)) - +$($(1).mak_vars) make -C $(1)* $($(1).mak_params) + +$($(1).mak_vars) $(MAK_VARS) make -C $(1)* $($(1).mak_params) $(MAK_PARAMS) touch $$@ endef @@ -145,6 +145,7 @@ ffmpeg.cfg_params= \ -ldl $(EXTRA_LIBS)" \ --extra-ldflags="-ldl" +a52dec.mak_params= ; cd $(call bld_path,a52dec,include); ln -sf . a52dec audiofile.cfg_params=--enable-shared=no audiofile.mak_params=LIBS="-lm -lstdc++" flac.cfg_params= --enable-shared=no @@ -152,7 +153,7 @@ flac.cflags="$(call inc_path,libogg,include) $(call ld_path,libogg,src/.libs)" giflib.cfg_params=--enable-shared=no ilmbase.cfg_params=--prefix=$(call bld_path,ilmbase,usr) ilmbase.mak_params=; make -C ilmbase* install; cd $(call bld_path,ilmbase); ln -sf lib64 usr/lib -lame.cfg_vars= CFLAGS=-O +lame.cfg_vars= CFLAGS+=" -O" lame.cfg_params=--enable-shared=no lame.mak_params= ; cd $(call bld_path,lame,include); ln -sf . lame mjpegtools.cflags="$(call inc_path,libjpeg) $(call ld_path,libjpeg,.libs)" @@ -208,6 +209,7 @@ else rules=$(eval $(1)) endif +$(call rules,$(call std-build,a52dec)) $(call rules,$(call std-build,audiofile)) $(call rules,$(call std-build,encore)) $(call rules,$(call std-build,esound,audiofile)) diff --git a/cinelerra-5.0/thirdparty/configure b/cinelerra-5.0/thirdparty/configure index 9ba5ecd6..0b145773 100755 --- a/cinelerra-5.0/thirdparty/configure +++ b/cinelerra-5.0/thirdparty/configure @@ -4,8 +4,12 @@ if [ "$1" = "static" ]; then STATIC_LIBRARIES="y" elif [ "$1" = "shared" ]; then STATIC_LIBRARIES="n" +elif [ "$1" = "cv" ]; then + STATIC_LIBRARIES="n" + libs="libogg libtheora libvorbis openexr libdv libjpeg tiff x264 mjpegtools a52dec lame libsndfile faac faad2" + forced_libs="mjpegtools x264" else - echo "usage: $0 " + echo "usage: $0 " exit 1 fi @@ -38,6 +42,9 @@ add_library() { append $sta_lib $@ } +inc_a52dec="include" +add_library a52dec \ + liba52/.libs/liba52.a inc_audiofile="." add_library audiofile \ libaudiofile/.libs/libaudiofile.a \ @@ -198,6 +205,11 @@ inc_libvpx="." add_library libvpx \ libvpx.a \ +echo "" +if [ -n "$libs" ]; then + LIBS="$libs" +fi + n=0 for lib in $LIBS; do echo -n " $lib" @@ -208,6 +220,7 @@ echo "" # dynamic library paths probe() { + if ! `echo $LIBS | grep -qw $1`; then return 0; fi local name="$1" local headers="$2" local func="$3" @@ -245,6 +258,7 @@ probe() { } # test for shared libs/header files +probe a52dec "a52.h" a52_init -la52 probe audiofile "audiofile.h" afOpenFile -laudiofile probe faac "stdint.h faac.h" faacEncGetVersion -lfaac probe faad2 "faad.h" NeAACDecInit -lfaad @@ -274,9 +288,11 @@ probe twolame "twolame.h" twolame_encode_buffer_float32_interleaved -ltwolame probe x264 "stdint.h x264.h" x264_encoder_encode -lx264 probe x265 "x265.h" x265_encoder_encode -lx265 -echo "" +if [ -n "$forced_libs" ]; then + forced_libs="encore ffmpeg giflib libuuid" +fi + # for ffmpeg link/broken disto libs -forced_libs="encore ffmpeg giflib libuuid" for name in $LIBS; do if is_in $name $forced_libs; then set - ${!name} diff --git a/cinelerra-5.0/thirdparty/src/a52dec-0.7.4.tar.xz b/cinelerra-5.0/thirdparty/src/a52dec-0.7.4.tar.xz new file mode 100644 index 00000000..6ea2d458 Binary files /dev/null and b/cinelerra-5.0/thirdparty/src/a52dec-0.7.4.tar.xz differ