Skip to content
Snippets Groups Projects
configure 157 KiB
Newer Older
  • Learn to ignore specific revisions
  • enabled yasm && cp_if_changed $TMPASM config.asm
    
    
    cat > $TMPH <<EOF
    /* Generated by ffconf */
    #ifndef AVUTIL_AVCONFIG_H
    #define AVUTIL_AVCONFIG_H
    EOF
    
    
    print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
    
    
    echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
    
    cp_if_changed $TMPH libavutil/avconfig.h
    
    
    if test -n "$WARNINGS"; then
        printf "\n$WARNINGS"
        enabled fatal_warnings && exit 1
    fi
    
    # build pkg-config files
    
    pkgconfig_generate(){
    
        name=$1
        shortname=${name#lib}${build_suffix}
        comment=$2
        version=$3
        libs=$4
        requires=$5
        enabled ${name#lib} || return 0
        mkdir -p $name
    
        cat <<EOF > $name/$name${build_suffix}.pc
    
    exec_prefix=\${prefix}
    
    Name: $name
    Description: $comment
    Version: $version
    
    Requires: $(enabled shared || echo $requires)
    
    Requires.private: $(enabled shared && echo $requires)
    
    Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
    
    Libs.private: $(enabled shared && echo $libs)
    
    Cflags: -I\${includedir}
    
    
    mkdir -p doc/examples/pc-uninstalled
    includedir=${source_path}
    [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
    
        cat <<EOF > doc/examples/pc-uninstalled/$name.pc
    
    libdir=\${pcfiledir}/../../../$name
    includedir=${includedir}
    
    Name: $name
    Description: $comment
    Version: $version
    Requires: $requires
    
    Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
    
    lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    enabled libavfilter_deps_avcodec    && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
    enabled libavfilter_deps_avformat   && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
    enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
    enabled libavfilter_deps_swscale    && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
    enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
    enabled libavfilter_deps_postproc   && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
    lavfi_libs=${lavfi_libs%, }
    
    lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
    enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
    
    pkgconfig_generate libavutil     "FFmpeg utility library"               "$LIBAVUTIL_VERSION"     "$LIBM"
    pkgconfig_generate libavcodec    "FFmpeg codec library"                 "$LIBAVCODEC_VERSION"    "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    pkgconfig_generate libavformat   "FFmpeg container format library"      "$LIBAVFORMAT_VERSION"   "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
    pkgconfig_generate libavdevice   "FFmpeg device handling library"       "$LIBAVDEVICE_VERSION"   "$extralibs" "$lavd_libs"
    pkgconfig_generate libavfilter   "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION"   "$extralibs" "$lavfi_libs"
    pkgconfig_generate libpostproc   "FFmpeg postprocessing library"        "$LIBPOSTPROC_VERSION"   ""           "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    pkgconfig_generate libavresample "Libav audio resampling library"       "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    pkgconfig_generate libswscale    "FFmpeg image rescaling library"       "$LIBSWSCALE_VERSION"    "$LIBM"      "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    pkgconfig_generate libswresample "FFmpeg audio resampling library"      "$LIBSWRESAMPLE_VERSION" "$LIBM"      "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
    
    
    fix_ffmpeg_remote(){
        git_remote_from=$1
        git_remote_to=$2
    
        fixme_remote=$(git --git-dir=$source_path/.git --work-tree=$source_path remote -v | grep $git_remote_from | cut -f 1 | sort | uniq)
    
        if [ "$fixme_remote" != "" ]; then
            echolog "
    Outdated domain in git config, the official domain for ffmpeg git is since
    November 2011, source.ffmpeg.org, both the old and the new point to the same
    repository and server. To update it enter the following commands:
    "
            for remote in $fixme_remote; do
                echolog "git remote set-url $remote $git_remote_to"
            done
        fi
    }
    
    if test -f "$source_path/.git/config"; then
        remote_from=git.videolan.org
        remote_to=source.ffmpeg.org
        fix_ffmpeg_remote git@$remote_from:ffmpeg   git@$remote_to:ffmpeg
        fix_ffmpeg_remote git://$remote_from/ffmpeg git://$remote_to/ffmpeg
    fi