Skip to content
Snippets Groups Projects
configure 87.2 KiB
Newer Older
  • Learn to ignore specific revisions
  • get_version LIBAVCODEC  libavcodec/avcodec.h
    get_version LIBAVDEVICE libavdevice/avdevice.h
    get_version LIBAVFORMAT libavformat/avformat.h
    get_version LIBAVUTIL   libavutil/avutil.h
    
    get_version LIBAVFILTER libavfilter/avfilter.h
    
    cat > $TMPH <<EOF
    /* Automatically generated by configure - do not modify! */
    #ifndef FFMPEG_CONFIG_H
    #define FFMPEG_CONFIG_H
    #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
    
    #define FFMPEG_LICENSE "$(c_escape $license)"
    
    #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
    #define CC_TYPE "$cc_type"
    #define CC_VERSION $cc_version
    #define restrict $_restrict
    
    #define ASMALIGN(ZEROBITS) ".p2align " #ZEROBITS "\\n\\t"
    
    #define EXTERN_PREFIX "${extern_prefix}"
    #define EXTERN_ASM ${extern_prefix}
    EOF
    
    test -n "$malloc_prefix" &&
        echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
    
    
    if enabled small || disabled optimizations; then
    
        echo "#undef  av_always_inline"  >> $TMPH
    
        echo "#define av_always_inline"  >> $TMPH
    fi
    
    
    print_config ARCH_   $TMPH config.mak $ARCH_LIST
    print_config HAVE_   $TMPH config.mak $HAVE_LIST
    
    print_config CONFIG_ $TMPH config.mak $CONFIG_LIST       \
    
                                          $PARSER_LIST       \
                                          $BSF_LIST          \
                                          $DEMUXER_LIST      \
                                          $MUXER_LIST        \
    
    echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
    
    echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
    
    Diego Biurrun's avatar
    Diego Biurrun committed
    # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
    
    cp_if_changed $TMPH config.h
    
    cat > $TMPH <<EOF
    /* Generated by ffconf */
    #ifndef AVUTIL_AVCONFIG_H
    #define AVUTIL_AVCONFIG_H
    EOF
    
    print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
    
    echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
    
    cp_if_changed $TMPH libavutil/avconfig.h
    
    
    test -n "$WARNINGS" && printf "\n$WARNINGS"
    
    
    # build pkg-config files
    
    pkgconfig_generate(){
    name=$1
    
    shortname=${name#lib}${build_suffix}
    
    comment=$2
    version=$3
    libs=$4
    requires=$5
    
    exec_prefix=\${prefix}
    
    Name: $name
    Description: $comment
    Version: $version
    
    Requires: $(enabled shared || echo $requires)
    
    Requires.private: $(enabled shared && echo $requires)
    
    Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
    
    Libs.private: $(enabled shared && echo $libs)
    
    Cflags: -I\${includedir}
    
    cat <<EOF > $name/$name-uninstalled.pc
    
    libdir=\${pcfiledir}
    
    includedir=${source_path}
    
    Name: $name
    Description: $comment
    Version: $version
    Requires: $requires
    
    Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
    
    pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
    
    pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
    pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
    pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
    
    enabled avfilter &&
    
        pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
    
    enabled postproc &&
    
        pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
    
    pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"