#!/bin/sh _int_module="ffmpeg" _glb_home=$(kread wrk_dir ${_config_}) _glb_cwd=$(pwd) _mod_conf=${_glb_home}/$(kread conf_${_int_module} ${_config_}) _mod_home=${_glb_home}/$(kread work_dir ${_mod_conf}) cd ${_mod_home} function ffmpeg_default { echo "[FFMPEG] commands:" } function ffmpeg_update_source { local _src=$(kread sources ${_mod_conf}) local _updater=$(kread update_source_script ${_config_}) ${_updater} ${_src} return $? } function ffmpeg_update_work { local _src=$(kread sources ${_mod_conf}) [[ -d ./src ]] && rm -rf ./src cp -rfp ${_src} ./ mv "./$(basename $_src)" "./src" return $? } function ffmpeg_test { return } function ffmpeg_update_work_if_old { local _src_dir="$(kread sources ${_mod_conf})" local _dst_dir="${_mod_home}/src" [[ ! -d ${_src_dir} ]] && { wr_log "\"${_src_dir}\" not found..." return 1 } local _src_ver="$(get_src_ver ${_src_dir})" wr_log "SRC:[$_src_dir]" wr_log "SRC:[$_src_ver]" local _dst_ver="$(get_src_ver ${_dst_dir})" wr_log "DST:[$_dst_dir]" wr_log "DST:[$_dst_ver]" [[ ! "$_src_ver" = "$_dst_ver" ]] && { wr_log "Updating..." ${_int_module}_update_work return 0 } wr_log "Nothing to update." return $? } function ffmpeg_cc_prepare { [[ -d wrk ]] && rm -rf wrk mkdir wrk && cd wrk return } function ffmpeg_cc_config { wr_log "[${_int_module}_cc_config] begin" [[ -d wrk ]] && rm -rf wrk mkdir wrk && cd wrk [[ -r ../extra_opt.sh ]] && source ../extra_opt.sh _bits=${1:-"32"} source ${_my_dir_}/cc_set.sh local _cf="${_cf}" local _cross="--cpu=pentium3" local _arch="x86" [[ "x${_bits}" = "x32" ]] && _cf="${_cf} -U__STRICT_ANSI__" [[ "x${_bits}" = "x64" ]] && _cross="" [[ "x${_bits}" = "x64" ]] && _arch="x86_64" wr_log "[${_int_module}_cc_config] _bits=${_bits}; _prx=${_prx}; _idir=${_idir}; _ldir=${_ldir}; _cf=${_cf}; _lf=${_lf}" ../src/configure \ --enable-gpl \ --disable-shared \ --enable-static \ --enable-runtime-cpudetect \ --enable-memalign-hack \ --disable-debug \ --disable-swresample \ --disable-avdevice \ --enable-pthreads \ --enable-postproc \ \ ${_ffmpeg_extra_options_} \ \ --prefix=${_prx} \ --extra-cflags="-I${_idir} ${_cf}" \ --extra-ldflags="-L${_ldir} ${_lf}" \ --arch=${_arch} \ --cc="$_CC" \ --cxx="$_CXX" \ --target-os=mingw32 \ ${_cross} wr_log "[${_int_module}_cc_config] done" return $? } function ffmpeg_cc_make { wr_log "[${_int_module}_cc_make] begin" cd wrk && make -j1 wr_log "[${_int_module}_cc_make] done" return $? } function ffmpeg_cc_install { cd wrk && make install return $? } function ffmpeg_cc_post_install { _bits=${1:-"32"} source ${_my_dir_}/cc_set.sh local _dst_dir="${_mod_home}/src" local _dst_ver="$(get_src_ver ${_dst_dir})" local _tag_file=${_prx}/${_int_module}.tag mkdir -p `dirname ${_tag_file}` echo "FFMPEG: ${_dst_ver}" >${_tag_file} return $? } function ffmpeg_cc_clean { wr_log "[${_int_module}_cc_clean] begin" [[ -d wrk ]] && rm -rf wrk wr_log "[${_int_module}_cc_clean] done" return $? }