You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
configure: add optional pkg-config helper and use it.
The require variant dies if the package is not present. The check variant does not import the flags to the used list. The new variant imports the flags if the package is present but does not die if it is not. The new call graph is: require -> use -> check. Use use_pkg_config for libx264 and libsmbclient: more readable and three external call less per library.
This commit is contained in:
14
configure
vendored
14
configure
vendored
@@ -1203,13 +1203,17 @@ require_cpp(){
|
|||||||
check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
|
check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
|
||||||
}
|
}
|
||||||
|
|
||||||
require_pkg_config(){
|
use_pkg_config(){
|
||||||
pkg="$1"
|
pkg="$1"
|
||||||
check_pkg_config "$@" || die "ERROR: $pkg not found"
|
check_pkg_config "$@" || return 1
|
||||||
add_cflags $(get_safe ${pkg}_cflags)
|
add_cflags $(get_safe ${pkg}_cflags)
|
||||||
add_extralibs $(get_safe ${pkg}_libs)
|
add_extralibs $(get_safe ${pkg}_libs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_pkg_config(){
|
||||||
|
use_pkg_config "$@" || die "ERROR: $pkg not found"
|
||||||
|
}
|
||||||
|
|
||||||
require_libfreetype(){
|
require_libfreetype(){
|
||||||
log require_libfreetype "$@"
|
log require_libfreetype "$@"
|
||||||
pkg="freetype2"
|
pkg="freetype2"
|
||||||
@@ -4875,8 +4879,7 @@ enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
|
|||||||
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
|
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
|
||||||
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
|
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
|
||||||
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
|
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
|
||||||
enabled libsmbclient && { { check_pkg_config smbclient libsmbclient.h smbc_init &&
|
enabled libsmbclient && { check_pkg_config smbclient libsmbclient.h smbc_init ||
|
||||||
require_pkg_config smbclient libsmbclient.h smbc_init; } ||
|
|
||||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||||
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
||||||
@@ -4903,8 +4906,7 @@ enabled libvpx && {
|
|||||||
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
|
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
|
||||||
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
|
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
|
||||||
enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
|
enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
|
||||||
enabled libx264 && { { check_pkg_config x264 "stdint.h x264.h" x264_encoder_encode &&
|
enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
|
||||||
require_pkg_config x264 "stdint.h x264.h" x264_encoder_encode; } ||
|
|
||||||
{ require libx264 x264.h x264_encoder_encode -lx264 &&
|
{ require libx264 x264.h x264_encoder_encode -lx264 &&
|
||||||
warn "using libx264 without pkg-config"; } } &&
|
warn "using libx264 without pkg-config"; } } &&
|
||||||
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
||||||
|
Reference in New Issue
Block a user