--disable-lpc disable LPC code
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
- --disable-vaapi disable VAAPI code
- --disable-vdpau disable VDPAU code
+ --enable-vaapi enable VAAPI code
+ --enable-vdpau enable VDPAU code
--disable-dxva2 disable DXVA2 code
--enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
--enable-zlib enable zlib [autodetect]
Advanced options (experts only):
- --source-path=PATH path to source code [$source_path]
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
--enable-cross-compile assume a cross-compiler is used
--sysroot=PATH root of cross-build tree
--malloc-prefix=PFX prefix malloc and related names with PFX
--enable-sram allow use of on-chip SRAM
--disable-symver disable symbol versioning
+ --optflags override optimization-related compiler flags
Developer options (useful when working on Libav itself):
--disable-debug disable debugging symbols
}
cp_if_changed(){
- cmp -s "$1" "$2" &&
- echo "$2 is unchanged" ||
- cp -f "$1" "$2"
+ cmp -s "$1" "$2" && echo "$2 is unchanged" && return
+ mkdir -p "$(dirname $2)"
+ cp -f "$1" "$2"
}
# CONFIG_LIST contains configurable options, while HAVE_LIST is for
static
swscale
swscale_alpha
+ thumb
vaapi
vdpau
version3
memalign
mkstemp
mmap
- pld
posix_memalign
round
roundf
sys_select_h
sys_soundcard_h
sys_videoio_h
- ten_operands
threads
trunc
truncf
logfile
malloc_prefix
nm
+ optflags
pkg_config
samples
- source_path
sysinclude
sysroot
target_exec
done
}
-set_ne_test_deps(){
- eval ${1}_be_test_deps="bigendian"
- eval ${1}_le_test_deps="!bigendian"
-}
-
test_deps _encoder _decoder \
adpcm_g726=g726 \
adpcm_ima_qt \
ac3_fixed_test_deps="ac3_fixed_encoder ac3_decoder rm_muxer rm_demuxer"
mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
-set_ne_test_deps pixdesc
-set_ne_test_deps pixfmts_copy
-set_ne_test_deps pixfmts_crop
-set_ne_test_deps pixfmts_hflip
-set_ne_test_deps pixfmts_null
-set_ne_test_deps pixfmts_pad
-set_ne_test_deps pixfmts_scale
-set_ne_test_deps pixfmts_vflip
-
# default parameters
logfile="config.log"
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
+AS_O='-o $@'
CC_O='-o $@'
host_cflags='-D_ISOC99_SOURCE -O3 -g'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
# find source path
-source_path="$(dirname "$0")"
-enable source_path_used
if test -f configure; then
- source_path="$(pwd)"
- disable source_path_used
+ source_path=.
else
- source_path="$(cd "$source_path"; pwd)"
+ source_path=$(cd $(dirname "$0"); pwd)
echo "$source_path" | grep -q '[[:blank:]]' &&
die "Out of tree builds are impossible with whitespace in source path."
test -e "$source_path/config.h" &&
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2'
size_cflags='-Os'
+ filter_cflags='filter_out -Wdisabled-optimization'
elif $cc -v 2>&1 | grep -q Open64; then
cc_type=open64
cc_version=__OPEN64__
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2'
size_cflags='-Os'
+ filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
fi
test -n "$cc_type" && enable $cc_type ||
disable cmov
;;
# targets that do support conditional mov (cmov)
- i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10|barcelona|atom)
+ i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
cpuflags="-march=$cpu"
enable cmov
enable fast_cmov
case $cpu in
cortex-a*) subarch=armv7a ;;
cortex-r*) subarch=armv7r ;;
- cortex-m*) subarch=armv7m ;;
+ cortex-m*) enable thumb; subarch=armv7m ;;
arm11*) subarch=armv6 ;;
arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
exit 1;
fi
-disabled static && LIBNAME=""
-
die_license_disabled() {
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
}
elif enabled arm; then
- check_cflags -marm
+ enabled thumb && check_cflags -mthumb || check_cflags -marm
nogas=die
if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
fi
- # We have to check if pld is a nop and disable it.
- check_asm pld '"pld [r0]"'
-
enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
# check whether xmm clobbers are supported
check_asm xmm_clobbers '"":::"%xmm0"'
- # check whether more than 10 operands are supported
- check_cc <<EOF && enable ten_operands
-int main(void) {
- int x=0;
- __asm__ volatile(
- ""
- :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
- );
- return 0;
-}
-EOF
-
# check whether binutils is new enough to compile SSSE3/MMX2
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
check_cflags -Wall
check_cflags -Wno-parentheses
check_cflags -Wno-switch
+check_cflags -Wno-format-zero-length
check_cflags -Wdisabled-optimization
check_cflags -Wpointer-arith
check_cflags -Wredundant-decls
# add some linker flags
check_ldflags -Wl,--warn-common
-check_ldflags -Wl,-rpath-link,libpostproc -Wl,-rpath-link,libswscale -Wl,-rpath-link,libavfilter -Wl,-rpath-link,libavdevice -Wl,-rpath-link,libavformat -Wl,-rpath-link,libavcodec -Wl,-rpath-link,libavutil
+check_ldflags -Wl,-rpath-link=libpostproc:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
echo "X{};" > $TMPV
EOF
fi
-if enabled small; then
+if [ -n "$optflags" ]; then
+ add_cflags $optflags
+elif enabled small; then
add_cflags $size_cflags
- optimizations="small"
elif enabled optimizations; then
add_cflags $speed_cflags
else
add_cflags -W${armcc_opt},--diag_suppress=1207
add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
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
elif enabled pathscale; then
echo "CMOV is fast ${fast_cmov-no}"
echo "EBX available ${ebx_available-no}"
echo "EBP available ${ebp_available-no}"
- echo "10 operands supported ${ten_operands-no}"
fi
if enabled arm; then
echo "ARMv5TE enabled ${armv5te-no}"
echo "VIS enabled ${vis-no}"
fi
echo "debug symbols ${debug-no}"
+echo "optimize for size ${small-no}"
echo "optimizations ${optimizations-no}"
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "threading support ${thread_type-no}"
echo "SDL support ${sdl-no}"
echo "Sun medialib support ${mlib-no}"
+echo "libdxva2 enabled ${dxva2-no}"
+echo "libva enabled ${vaapi-no}"
+echo "libvdpau enabled ${vdpau-no}"
echo "AVISynth enabled ${avisynth-no}"
echo "frei0r enabled ${frei0r-no}"
echo "libdc1394 support ${libdc1394-no}"
echo "libschroedinger enabled ${libschroedinger-no}"
echo "libspeex enabled ${libspeex-no}"
echo "libtheora enabled ${libtheora-no}"
-echo "libva enabled ${vaapi-no}"
echo "libvo-aacenc support ${libvo_aacenc-no}"
echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
echo "libvorbis enabled ${libvorbis-no}"
echo "Creating config.mak and config.h..."
-# build tree in object directory if source path is different from current one
-if enabled source_path_used; then
- DIRS="
- doc
- libavcodec
- libavcodec/$arch
- libavdevice
- libavfilter
- libavfilter/$arch
- libavformat
- libavutil
- libavutil/$arch
- libpostproc
- libswscale
- libswscale/$arch
- tests
- tools
- "
- FILES="
- Makefile
- common.mak
- subdir.mak
- doc/texi2pod.pl
- libavcodec/Makefile
- libavcodec/${arch}/Makefile
- libavdevice/Makefile
- libavfilter/Makefile
- libavfilter/${arch}/Makefile
- libavformat/Makefile
- libavutil/Makefile
- libpostproc/Makefile
- libswscale/Makefile
- "
- map 'mkdir -p $v' $DIRS;
- map 'test -f "$source_path/$v" && $ln_s "$source_path/$v" $v' $FILES
-fi
+test -e Makefile || $ln_s "$source_path/Makefile" .
config_files="$TMPH config.mak"
cat > config.mak <<EOF
# Automatically generated by configure - do not modify!
-ifndef LIBAV_CONFIG_MAK
-LIBAV_CONFIG_MAK=1
LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
prefix=$prefix
LIBDIR=\$(DESTDIR)$libdir
BINDIR=\$(DESTDIR)$bindir
DATADIR=\$(DESTDIR)$datadir
MANDIR=\$(DESTDIR)$mandir
-SRC_PATH="$source_path"
-SRC_PATH_BARE=$source_path
+SRC_PATH=$source_path
CC_IDENT=$cc_ident
ARCH=$arch
CC=$cc
CPPFLAGS=$CPPFLAGS
CFLAGS=$CFLAGS
ASFLAGS=$ASFLAGS
+AS_O=$CC_O
CC_O=$CC_O
DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
EOF
echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
-echo "endif # LIBAV_CONFIG_MAK" >> config.mak
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
cp_if_changed $TMPH config.h
libs=$4
requires=$5
enabled ${name#lib} || return 0
+mkdir -p $name
cat <<EOF > $name/$name.pc
prefix=$prefix
exec_prefix=\${prefix}