--list-protocols show all available protocols
--list-bsfs show all available bitstream filters
--list-indevs show all available input devices
- --list-outdevs show all available output devices
--list-filters show all available filters
Standard options:
--disable-avconv disable avconv build
--disable-avplay disable avplay build
--disable-avprobe disable avprobe build
- --disable-avserver deprecated, does nothing
Component options:
--disable-doc do not build documentation
--enable-indev=NAME enable input device NAME
--disable-indev=NAME disable input device NAME
--disable-indevs disable input devices
- --enable-outdev=NAME enable output device NAME
- --disable-outdev=NAME disable output device NAME
- --disable-outdevs disable output devices
--disable-devices disable all devices
--enable-filter=NAME enable filter NAME
--disable-filter=NAME disable filter NAME
used only for debugging purposes)
--enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
should be used only for debugging purposes)
- --enable-random randomly enable/disable components
- --disable-random
- --enable-random=LIST randomly enable/disable specific components or
- --disable-random=LIST component groups. LIST is a comma-separated list
- of NAME[:PROB] entries where NAME is a component
- (group) and PROB the probability associated with
- NAME (default 0.5).
- --random-seed=VALUE seed value for --enable/disable-random
--disable-valgrind-backtrace do not print a backtrace under Valgrind
(only applies to --disable-optimizations builds)
--ignore-tests=TESTS comma-separated list (without "fate-" prefix
exit 0
}
-quotes='""'
-
log(){
echo "$@" >> $logfile
}
enable_sanitized(){
for var; do
- enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
+ enable $(sanitize_var_name $var)
done
}
disable_sanitized(){
for var; do
- disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
+ disable $(sanitize_var_name $var)
done
}
}
enabled(){
- test "${1#!}" = "$1" && op== || op=!=
+ test "${1#!}" = "$1" && op="=" || op="!="
eval test "x\$${1#!}" $op "xyes"
}
disabled(){
- test "${1#!}" = "$1" && op== || op=!=
+ test "${1#!}" = "$1" && op="=" || op="!="
eval test "x\$${1#!}" $op "xno"
}
test_ldflags(){
log test_ldflags "$@"
+ set -- $($ldflags_filter "$@")
check_ld "$@" <<EOF
int main(void){ return 0; }
EOF
check_header(){
log check_header "$@"
- header=$1
+ headers=$1
shift
- disable_sanitized $header
- check_cpp "$@" <<EOF && enable_sanitized $header
-#include <$header>
-int x;
-EOF
+ disable_sanitized $headers
+ {
+ for hdr in $headers; do
+ print_include $hdr
+ done
+ echo "int x;"
+ } | check_cpp "$@" && enable_sanitized $headers
}
check_func(){
}
require_header(){
- log require "$@"
- header="$1"
+ log require_header "$@"
+ headers="$1"
shift
- check_header "$header" "$@" || die "ERROR: $header not found"
+ check_header "$headers" "$@" || die "ERROR: $headers not found"
}
require_cpp_condition(){
- log require "$@"
+ log require_cpp_condition "$@"
header="$1"
condition="$2"
shift 2
EOF
}
-apply(){
- file=$1
- shift
- "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
-}
-
cp_if_changed(){
cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
mkdir -p "$(dirname $2)"
AVDEVICE_COMPONENTS="
indevs
- outdevs
"
AVFILTER_COMPONENTS="
filters
protocols
"
-AVRESAMPLE_COMPONENTS=""
-AVUTIL_COMPONENTS=""
-
COMPONENT_LIST="
$AVCODEC_COMPONENTS
$AVDEVICE_COMPONENTS
$AVFILTER_COMPONENTS
$AVFORMAT_COMPONENTS
- $AVRESAMPLE_COMPONENTS
- $AVUTIL_COMPONENTS
"
EXAMPLE_LIST="
direct_h
dxgidebug_h
dxva_h
- gsm_h
io_h
- mach_mach_time_h
machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
poll_h
- soundcard_h
- stdatomic_h
- sys_mman_h
sys_param_h
sys_resource_h
sys_select_h
truncf
"
+SYSTEM_FEATURES="
+ dos_paths
+ libc_msvcrt
+ MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
+ section_data_rel_ro
+ threads
+ uwp
+"
+
SYSTEM_FUNCS="
aligned_malloc
clock_gettime
closesocket
CommandLineToArgvW
- CryptGenRandom
fcntl
- fork
getaddrinfo
gethrtime
getopt
VirtualAlloc
"
+SYSTEM_LIBRARIES="
+ sdl
+ vaapi_1
+ vaapi_drm
+ vaapi_x11
+ vdpau_x11
+ wincrypt
+"
+
TOOLCHAIN_FEATURES="
as_arch_directive
as_fpu_directive
as_func
as_object_arch
asm_mod_q
- attribute_may_alias
- attribute_packed
blocks_extension
ebp_available
ebx_available
$HEADERS_LIST
$INTRINSICS_LIST
$MATH_FUNCS
+ $SYSTEM_FEATURES
$SYSTEM_FUNCS
+ $SYSTEM_LIBRARIES
$THREADS_LIST
$TOOLCHAIN_FEATURES
$TYPES_LIST
- dos_paths
- libc_msvcrt
- MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
- sdl
- section_data_rel_ro
- threads
- uwp
- vaapi_drm
- vaapi_x11
- vdpau_x11
"
# options emitted with CONFIG_ prefix but not available on the command line
optflags
pkg_config
pkg_config_flags
- random_seed
samples
sysinclude
sysroot
xmv_demuxer_select="riffdec"
xwma_demuxer_select="riffdec"
-# indevs / outdevs
+# indevs
alsa_indev_deps="alsa"
-alsa_outdev_deps="alsa"
avfoundation_indev_deps="AVFoundation_AVFoundation_h objc_arc pthreads"
avfoundation_indev_extralibs="-framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia"
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
-dv1394_indev_deps="dv1394"
-dv1394_indev_select="dv_demuxer"
fbdev_indev_deps="linux_fb_h"
jack_indev_deps="libjack"
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
-oss_indev_deps_any="soundcard_h sys_soundcard_h"
-oss_outdev_deps_any="soundcard_h sys_soundcard_h"
+oss_indev_deps_any="sys_soundcard_h"
pulse_indev_deps="libpulse"
sndio_indev_deps="sndio"
-sndio_outdev_deps="sndio"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="vfw32 vfwcap_defines"
xcbgrab_indev_deps="libxcb libxcb_shape"
ranlib="ranlib"
strip="strip"
version_script='--version-script'
+objformat="elf32"
# machine
arch_default=$(uname -m)
PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
-OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
AVDEVICE_COMPONENTS_LIST="
$INDEV_LIST
- $OUTDEV_LIST
"
AVFILTER_COMPONENTS_LIST="
exit 0
}
-rand_list(){
- IFS=', '
- set -- $*
- unset IFS
- for thing; do
- comp=${thing%:*}
- prob=${thing#$comp}
- prob=${prob#:}
- is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
- echo "prob ${prob:-0.5}"
- printf '%s\n' $comp
- done
-}
-
-do_random(){
- action=$1
- shift
- random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
- $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
-}
-
for opt do
optval="${opt#*=}"
case "$opt" in
add_extralibs $optval
;;
--disable-devices)
- disable $INDEV_LIST $OUTDEV_LIST
+ disable $INDEV_LIST
;;
--enable-debug=*)
debuglevel="$optval"
map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
disable $LIBRARY_LIST $PROGRAM_LIST doc
;;
- --enable-random|--disable-random)
- action=${opt%%-random}
- do_random ${action#--} $COMPONENT_LIST
- ;;
- --enable-random=*|--disable-random=*)
- action=${opt%%-random=*}
- do_random ${action#--} $optval
- ;;
--enable-*=*|--disable-*=*)
eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
$action $(filter "$name" $list)
;;
- --enable-avserver|--disable-avserver*)
- warn "avserver has been removed, the ${opt} option is only"\
- "provided for compatibility and will be removed in the future"
- ;;
--enable-yasm|--disable-yasm)
warn "The ${opt} option is only provided for compatibility and will be\n"\
"removed in the future. Use --enable-x86asm / --disable-x86asm instead."
disabled logging && logfile=/dev/null
+# command line configuration sanity checks
+
+# we need to build at least one lib type
+if ! enabled_any static shared; then
+ cat <<EOF
+At least one library type must be built.
+Specify --enable-static to build the static libraries or --enable-shared to
+build the shared libraries as well. To only build the shared libraries specify
+--disable-static in addition to --enable-shared.
+EOF
+ exit 1
+fi
+
# Die early if licensing-related configure options are incompatible.
die_license_disabled() {
enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
nm_default="dumpbin -symbols"
ar_default="lib"
case "$arch" in
+ aarch64|arm64)
+ as_default="armasm64"
+ ;;
arm*)
as_default="armasm"
;;
;;
esac
-test -n "$cross_prefix" && enable cross_compile
-
-if enabled cross_compile; then
+if test -n "$cross_prefix"; then
test -n "$arch" && test -n "$target_os" ||
die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
+ enable cross_compile
fi
ar_default="${cross_prefix}${ar_default}"
done
}
-pgi_flags(){
- for flag; do
- case $flag in
- -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
- -fomit-frame-pointer) echo -Mnoframe ;;
- -g) echo -gopt ;;
- *) echo $flag ;;
- esac
- done
-}
-
suncc_flags(){
for flag; do
case $flag in
done
}
-tms470_flags(){
- for flag; do
- case $flag in
- -march=*|-mcpu=*)
- case "${flag#*=}" in
- armv7-a|cortex-a*) echo -mv=7a8 ;;
- armv7-r|cortex-r*) echo -mv=7r4 ;;
- armv7-m|cortex-m*) echo -mv=7m3 ;;
- armv6*|arm11*) echo -mv=6 ;;
- armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
- echo -mv=5e ;;
- armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
- esac
- ;;
- -mfpu=neon) echo --float_support=vfpv3 --neon ;;
- -mfpu=vfp) echo --float_support=vfpv2 ;;
- -mfpu=vfpv3) echo --float_support=vfpv3 ;;
- -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
- -msoft-float) echo --float_support=vfplib ;;
- -O[0-3]|-mf=*) echo $flag ;;
- -g) echo -g -mn ;;
- -pds=*) echo $flag ;;
- -D*|-I*) echo $flag ;;
- --gcc|--abi=*) echo $flag ;;
- -me) echo $flag ;;
- esac
- done
-}
-
probe_cc(){
pfx=$1
_cc=$2
_depflags='-MMD'
_cflags_speed='-O3'
_cflags_size='-Os'
- elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
- _type=tms470
- _ident=$($_cc -version | head -n1 | tr -s ' ')
- _flags='--gcc --abi=eabi -me'
- _cc_e='-ppl -fe=$@'
- _cc_o='-fe=$@'
- _depflags='-ppa -ppd=$(@:.o=.d)'
- _cflags_speed='-O3 -mf=5'
- _cflags_size='-O3 -mf=2'
- _flags_filter=tms470_flags
elif $_cc -v 2>&1 | grep -q clang; then
_type=clang
_ident=$($_cc --version 2>/dev/null | head -n1)
_cflags_speed='-O2'
_cflags_size='-Os'
_flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
- elif $_cc -V 2>&1 | grep -q Portland; then
- _type=pgi
- _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
- opt_common='-alias=ansi -Mdse -Mlre -Mpre'
- _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
- _cflags_size="-O2 -Munroll=c:1 $opt_common"
- _cflags_noopt="-O1"
- _flags_filter=pgi_flags
elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
_type=armasm
_ident=$($_cc | head -n1)
if $ar 2>&1 | grep -q Microsoft; then
arflags="-nologo"
ar_o='-out:$@'
-elif $ar 2>&1 | grep -q 'Texas Instruments'; then
- arflags="rq"
- ar_o='$@'
-elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
- arflags='-Xany -r -c'
- ar_o='$@'
else
arflags="rc"
ar_o='$@'
add_cppflags --sysroot="$sysroot"
add_ldflags --sysroot="$sysroot"
;;
- tms470)
- add_cppflags -I"$sysinclude"
- add_ldflags --sysroot="$sysroot"
- ;;
esac
fi
expr=$3
check_code cc "" "int test[2*($expr) - 1]" &&
subarch=$arch64 || subarch=$arch32
+ enable $subarch
}
case "$arch" in
aarch64|alpha|ia64)
- spic=$shared
+ enabled shared && enable_weak pic
;;
mips)
check_64bit mips mips64 '_MIPS_SIM > 1'
- spic=$shared
+ enabled shared && enable_weak pic
;;
parisc)
check_64bit parisc parisc64 'sizeof(void *) > 4'
- spic=$shared
+ enabled shared && enable_weak pic
;;
ppc)
check_64bit ppc ppc64 'sizeof(void *) > 4'
- spic=$shared
+ enabled shared && enable_weak pic
;;
s390)
check_64bit s390 s390x 'sizeof(void *) > 4'
- spic=$shared
+ enabled shared && enable_weak pic
;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
- spic=$shared
+ enabled shared && enable_weak pic
;;
x86)
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
- if test "$subarch" = "x86_64"; then
- spic=$shared
+ if enabled x86_64; then
+ enabled shared && enable_weak pic
+ objformat=elf64
fi
;;
esac
-enable $subarch
-enabled spic && enable_weak pic
-
-enabled x86_64 && objformat=elf64 || objformat="elf32"
-
# OS specific
case $target_os in
aix)
SHFLAGS=-shared
add_cppflags '-I\$(SRC_PATH)/compat/aix'
enabled shared && add_ldflags -Wl,-brtl
+ arflags='-Xany -r -c'
;;
android)
disable symver
;;
sunos)
SHFLAGS='-shared -Wl,-h,$$(@F)'
- enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
+ enabled x86 && append SHFLAGS -mimpure-text
network_extralibs="-lsocket -lnsl"
# When using suncc to build, the Solaris linker will mark
# an executable with each instruction set encountered by
netbsd)
disable symver
oss_indev_extralibs="-lossaudio"
- oss_outdev_extralibs="-lossaudio"
;;
openbsd|bitrig)
disable symver
SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
SLIB_INSTALL_LINKS=
oss_indev_extralibs="-lossaudio"
- oss_outdev_extralibs="-lossaudio"
;;
dragonfly)
disable symver
;;
mingw32*|mingw64*)
target_os=mingw32
- LIBTARGET=i386
- if enabled x86_64; then
- LIBTARGET="i386:x86-64"
- fi
if enabled shared; then
- # Cannot build both shared and static libs when using dllexport.
+ # Cannot build both shared and static libs when using dllimport.
disable static
fi
check_ldflags -Wl,--nxcompat
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
- SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
+ SLIB_EXTRA_CMD='cp $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
- SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+ SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
enabled x86_64 && objformat="win64" || objformat="win32"
- dlltool="${cross_prefix}dlltool"
ranlib=:
enable dos_paths
;;
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
- SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+ SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
add_cppflags -U__STRICT_ANSI__
;;
linux)
- enable dv1394
enable section_data_rel_ro
;;
irix*)
eval ${pfx}libc_type=default
add_${pfx}cppflags -D_DEFAULT_SOURCE
fi
+ eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
}
probe_libc
-test -n "$libc_type" && enable libc_$libc_type
probe_libc host_
-test -n "$host_libc_type" && enable host_libc_$host_libc_type
# hacks for compiler/libc/os combinations
bionic)
add_compat strtod.o strtod=avpriv_strtod
;;
- glibc)
- if enabled tms470; then
- CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
- add_cppflags -D__USER_LABEL_PREFIX__=
- add_cppflags -D__builtin_memset=memset
- add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
- add_cflags -pds=48 # incompatible redefinition of macro
- fi
- ;;
esac
check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
add_cppflags '-I\$(SRC_PATH)/compat/float'
-esc(){
- echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
-}
-
-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate
-
check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
set_default $PATHS_LIST
set_default nm
-# we need to build at least one lib type
-if ! enabled_any static shared; then
- cat <<EOF
-At least one library type must be built.
-Specify --enable-static to build the static libraries or --enable-shared to
-build the shared libraries as well. To only build the shared libraries specify
---disable-static in addition to --enable-shared.
-EOF
- exit 1
-fi
-
disabled optimizations || check_cflags -fomit-frame-pointer
enable_weak_pic() {
enable pic
add_cppflags -DPIC
case "$target_os" in
- mingw*|cygwin*)
+ mingw*|cygwin*|win*)
;;
*)
add_cflags -fPIC
+ add_asflags -fPIC
;;
esac
- add_asflags -fPIC
}
enabled pic && enable_weak_pic
void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
EOF
-check_cc <<EOF && enable attribute_packed
-struct { int x; } __attribute__((packed)) x;
-EOF
-
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
.object_arch armv4
EOF
+ # MS armasm fails to assemble our PIC constructs
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
elif enabled mips; then
- check_inline_asm loongson '"dmult.g $1, $2, $3"'
+ # make sure that only one instruction set is enabled
+ disable $ARCH_EXT_LIST_MIPS
- # make sure that only an instruction set is enabled
- disable mips64r6 mips32r6 mips64r2 mips32r2 mips64r1 mips32r1
+ check_inline_asm loongson '"dmult.g $1, $2, $3"'
if enabled mips64; then
check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
check_lib clock_gettime time.h clock_gettime -lrt; }
check_func fcntl
-check_func fork
check_func gethrtime
check_func getopt
check_func getrusage
check_func gmtime_r
check_func isatty
check_func localtime_r
-check_func mach_absolute_time
check_func mkstemp
check_func mmap
check_func mprotect
check_func usleep
check_func_headers io.h setmode
+check_func_headers mach/mach_time.h mach_absolute_time
check_func_headers stdlib.h getenv
check_func_headers windows.h GetProcessAffinityMask
check_header dxva.h
check_header dxva2api.h
check_header io.h
-check_header mach/mach_time.h
check_header malloc.h
check_header poll.h
-check_header sys/mman.h
check_header sys/param.h
check_header sys/resource.h
check_header sys/select.h
# it seems there are versions of clang in some distros that try to use the
# gcc headers, which explodes for stdatomic
# so we also check that atomics actually work here
-check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
+check_builtin stdatomic stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
check_lib ole32 "windows.h" CoTaskMemFree -lole32
check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
elif check_func pthread_join; then
enable pthreads
fi
+ enabled pthreads &&
+ check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
fi
-enabled pthreads &&
- check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
-
disabled zlib || check_lib zlib zlib.h zlibVersion -lz
disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
enabled cuda && require cuda cuda.h cuInit -lcuda
enabled cuvid && require cuvid cuviddec.h cuvidCreateDecoder -lnvcuvid
enabled frei0r && require_header frei0r.h
-enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
+enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init &&
+ check_lib gmp gmp.h mpz_export -lgmp
enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
enabled libfdk_aac && require_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen
enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
-enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
- check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
- done || die "ERROR: libgsm not found"; }
+enabled libgsm && require libgsm gsm.h gsm_create -lgsm
enabled libhdcd && require_pkg_config libhdcd libhdcd "hdcd/hdcd_simple.h" hdcd_new
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
enabled libschroedinger && require_pkg_config libschroedinger schroedinger-1.0 schroedinger/schro.h schro_init
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
-enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init -lspeex
+enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
die "ERROR: mmal not found" &&
check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
+enabled nvenc && require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
enabled omx && require_header OMX_Core.h
enabled omx_rpi && { check_header OMX_Core.h ||
{ ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
-enabled gnutls && check_lib gmp gmp.h mpz_export -lgmp
-
-if enabled nvenc; then
- require_header nvEncodeAPI.h
- require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
-fi
-
# SDL adds some CFLAGS that should not be part of the general CFLAGS.
enabled avplay &&
test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
-{ check_header dev/bktr/ioctl_meteor.h &&
- check_header dev/bktr/ioctl_bt848.h; } ||
-{ check_header machine/ioctl_meteor.h &&
- check_header machine/ioctl_bt848.h; } ||
-{ check_header dev/video/meteor/ioctl_meteor.h &&
- check_header dev/video/bktr/ioctl_bt848.h; } ||
-check_header dev/ic/bt8xx.h
+check_header "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
+ check_header "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
+ check_header "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
+ check_header "dev/ic/bt8xx.h"
check_header sys/soundcard.h
-check_header soundcard.h
-enabled_any alsa_indev alsa_outdev &&
+enabled alsa_indev &&
check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
enabled libjack &&
require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
-enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open -lsndio
+enabled sndio_indev && check_lib sndio sndio.h sio_open -lsndio
if enabled libcdio; then
check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
enabled vaapi &&
check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11
+enabled vaapi &&
+ check_cpp_condition "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" &&
+ enable vaapi_1
+
enabled vdpau &&
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
disable vdpau
echo "X { local: *; };" > $TMPV
if test_ldflags -Wl,${version_script},$TMPV; then
append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
+ quotes='""'
check_cc <<EOF && enable symver_asm_label
void ff_foo(void) __asm__ ("av_foo@VERSION");
void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
-elif enabled tms470; then
- add_cflags -pds=824 -pds=837
- disable inline_asm
elif enabled pathscale; then
add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
disable inline_asm
fi
done
-if disabled stdatomic_h; then
+if disabled stdatomic; then
if enabled atomics_gcc; then
add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
elif enabled atomics_win32; then
echo "network support ${network-no}"
echo "threading support ${thread_type-no}"
echo "safe bitstream reader ${safe_bitstream_reader-no}"
-test -n "$random_seed" &&
- echo "random seed ${random_seed}"
-echo
echo "External libraries:"
print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
print_enabled '' $PROGRAM_LIST | print_3_columns
echo
-for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
+for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev; do
echo "Enabled ${type}s:"
eval list=\$$(toupper $type)_LIST
print_enabled '_*' $list | print_3_columns
echo "License: $license"
-echo "Creating configuration files ..."
-
fi # test "$quiet" != "yes"
+test -n "$WARNINGS" && printf "\n$WARNINGS"
+
test -e Makefile || echo "include $source_path/Makefile" > Makefile
+esc(){
+ echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
+}
+
+echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate
+
config_files="$TMPH avbuild/config.mak"
cat > avbuild/config.mak <<EOF
CC_IDENT=$cc_ident
ARCH=$arch
INTRINSICS=$intrinsics
+EXTERN_PREFIX=$extern_prefix
CC=$cc
AS=$as
OBJCC=$objcc
LD_O=$LD_O
LD_LIB=$LD_LIB
LD_PATH=$LD_PATH
-DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
LDEXEFLAGS=$LDEXEFLAGS
LDSOFLAGS=$LDSOFLAGS
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
INSTALL=install
-LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
if enabled x86asm; then
append config_files $TMPASM
- printf '' >$TMPASM
+ cat > $TMPASM <<EOF
+; Automatically generated by configure - do not modify!
+EOF
fi
enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
enabled x86asm && cp_if_changed $TMPASM config.asm
cat > $TMPH <<EOF
-/* Generated by ffconf */
+/* Generated by libav configure */
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
EOF
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
-test -n "$WARNINGS" && printf "\n$WARNINGS"
-
# Settings for pkg-config files
-cat > avbuild/config.sh <<EOF
+cat > $TMPH <<EOF
# Automatically generated by configure - do not modify!
shared=$shared
prefix=$prefix
for lib in $LIBRARY_LIST; do
lib_deps="$(eval echo \$${lib}_deps)"
- echo ${lib}_deps=\"$lib_deps\" >> avbuild/config.sh
+ echo ${lib}_deps=\"$lib_deps\" >> $TMPH
done
+
+cp_if_changed $TMPH avbuild/config.sh