Skip to content
Snippets Groups Projects
configure 190 KiB
Newer Older
  • Learn to ignore specific revisions
  • pkgconfig_generate(){
    
        name=$1
        shortname=${name#lib}${build_suffix}
        comment=$2
        version=$3
        libs=$4
    
        requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
        requires=${requires%, }
    
        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)
    
    pkgconfig_generate libavutil     "FFmpeg utility library"               "$LIBAVUTIL_VERSION"     "$LIBRT $LIBM"
    
    pkgconfig_generate libavcodec    "FFmpeg codec library"                 "$LIBAVCODEC_VERSION"    "$extralibs"
    pkgconfig_generate libavformat   "FFmpeg container format library"      "$LIBAVFORMAT_VERSION"   "$extralibs"
    pkgconfig_generate libavdevice   "FFmpeg device handling library"       "$LIBAVDEVICE_VERSION"   "$extralibs"
    pkgconfig_generate libavfilter   "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION"   "$extralibs"
    pkgconfig_generate libpostproc   "FFmpeg postprocessing library"        "$LIBPOSTPROC_VERSION"   ""
    
    pkgconfig_generate libavresample "Libav audio resampling library"       "$LIBAVRESAMPLE_VERSION" "$LIBM"
    
    pkgconfig_generate libswscale    "FFmpeg image rescaling library"       "$LIBSWSCALE_VERSION"    "$LIBM"
    pkgconfig_generate libswresample "FFmpeg audio resampling library"      "$LIBSWRESAMPLE_VERSION" "$LIBM"