Skip to content
Snippets Groups Projects
configure 152 KiB
Newer Older
  • Learn to ignore specific revisions
  •     echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
    
    
    if enabled yasm; then
        append config_files $TMPASM
        printf '' >$TMPASM
    fi
    
    
    enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
    
    
    print_config ARCH_   "$config_files" $ARCH_LIST
    print_config HAVE_   "$config_files" $HAVE_LIST
    print_config CONFIG_ "$config_files" $CONFIG_LIST       \
    
    Måns Rullgård's avatar
    Måns Rullgård committed
                                         $CONFIG_EXTRA      \
    
    echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
    
    Diego Biurrun's avatar
    Diego Biurrun committed
    # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
    
    cp_if_changed $TMPH config.h
    
    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
    
    
    test -n "$WARNINGS" && printf "\n$WARNINGS"
    
    
    # build pkg-config files
    
    lib_version(){
        eval printf "\"lib${1} >= \$LIB$(toupper ${1})_VERSION, \""
    }
    
    
    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.pc
    
    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     "Libav utility library"          "$LIBAVUTIL_VERSION"     "$LIBRT $LIBM"
    
    pkgconfig_generate libavcodec    "Libav codec library"            "$LIBAVCODEC_VERSION"    "$extralibs"
    pkgconfig_generate libavformat   "Libav container format library" "$LIBAVFORMAT_VERSION"   "$extralibs"
    pkgconfig_generate libavdevice   "Libav device handling library"  "$LIBAVDEVICE_VERSION"   "$extralibs"
    pkgconfig_generate libavfilter   "Libav video filtering library"  "$LIBAVFILTER_VERSION"   "$extralibs"
    
    pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
    
    pkgconfig_generate libswscale    "Libav image rescaling library"  "$LIBSWSCALE_VERSION"    "$LIBM"