echo " --disable-neon disable neon optimizations"
echo " --disable-vis disable VIS optimizations"
echo " --disable-yasm disable use of yasm assembler"
+ echo " --enable-pic build position-independent code"
echo
echo "Developer options (useful when working on FFmpeg itself):"
echo " --disable-debug disable debugging symbols"
echo "$v"
}
+filter(){
+ pat=$1
+ shift
+ for v; do
+ case "$v" in $pat) echo "$v" ;; esac
+ done
+}
+
set_all(){
value=$1
shift
mpegaudio_hp
network
nonfree
+ pic
postproc
powerpc_perf
rdft
ARCH_LIST='
alpha
arm
+ avr32
+ avr32_ap
+ avr32_uc
bfin
ia64
m68k
mjpeg_encoder_select="aandct"
mpeg1video_encoder_select="aandct"
mpeg2video_encoder_select="aandct"
-mpeg4_encoder_select="aandct"
+mpeg4_encoder_select="h263_encoder"
mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
wmav2_decoder_select="fft mdct"
wmav2_encoder_select="fft mdct"
wmv1_encoder_select="h263_encoder"
-wmv2_encoder_select="aandct"
+wmv2_encoder_select="h263_encoder"
wmv3_decoder_select="vc1_decoder"
wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
# gcc stupidly only outputs the basename of targets with -MM, but we need the
# full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $@'
+DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
# find source path
--enable-debug=*) debuglevel="$optval"
;;
--enable-*=*|--disable-*=*)
- eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/')
- case "$thing" in
- encoder|decoder|hwaccel|muxer|demuxer|indev|outdev|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
- *) die_unknown "$opt" ;;
- esac
+ eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
+ is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
+ eval list=\$$(toupper $thing)_LIST
+ name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
+ $action $(filter "$name" $list)
;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
filter_cppflags=echo
filter_asflags=echo
-if $cc --version 2>/dev/null | grep -qi gcc; then
+if $cc -v 2>&1 | grep -qi ^gcc; then
cc_type=gcc
+ if ! $cc -dumpversion | grep -q '^2\.'; then
+ CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+ AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+ fi
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc
elif $cc -V 2>/dev/null | grep -q Compaq; then
die "Error creating armcc configuration file."
cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
as_default="${cross_prefix}gcc"
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470
cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
CC_O='-fr=$(@D)'
as_default="${cross_prefix}gcc"
ld_default="${cross_prefix}gcc"
- dep_cc_default="${cross_prefix}gcc"
TMPO=$(basename $TMPC .c).o
append TMPFILES $TMPO
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
- DEPFLAGS='$(CPPFLAGS) -MM'
+ CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
+ AS_DEPFLAGS='-MMD'
filter_cflags=tms470_flags
tms470_flags(){
for flag; do
: ${ld_default:=$cc}
set_default as dep_cc ld
+test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
+test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
+
add_cflags $extra_cflags
add_asflags $extra_cflags
esac
fi
+if test "$cpu" = host; then
+ enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
+
+ case "$cc_type" in
+ gcc)
+ check_native(){
+ $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+ awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
+ }
+ cpu=$(check_native -march || check_native -mcpu)
+ ;;
+ esac
+
+ test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
+fi
+
# Add processor-specific flags
case $cpu in
601|ppc601|PowerPC601)
mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
cpuflags="-march=$cpu"
;;
+ ap7[02]0[0-2])
+ subarch="avr32_ap"
+ cpuflags="-mpart=$cpu"
+ ;;
+ ap)
+ subarch="avr32_ap"
+ cpuflags="-march=$cpu"
+ ;;
+ uc3[ab]*)
+ subarch="avr32_uc"
+ cpuflags="-mcpu=$cpu"
+ ;;
+ uc)
+ subarch="avr32_uc"
+ cpuflags="-march=$cpu"
+ ;;
generic)
;;
*)
arch="alpha"
enable fast_64bit
check_cflags -mieee
- pic=$shared
+ spic=$shared
;;
arm|armv[4567]*l)
arch="arm"
ia64)
arch="ia64"
enable fast_64bit
- pic=$shared
+ spic=$shared
;;
m68k)
arch="m68k"
;;
mips|mipsel|IP*)
arch="mips"
- pic=$shared
+ spic=$shared
;;
mips64)
arch="mips"
subarch="mips64"
enable fast_64bit
- pic=$shared
+ spic=$shared
;;
parisc|hppa)
arch="parisc"
- pic=$shared
+ spic=$shared
;;
parisc64|hppa64)
arch="parisc"
enable fast_64bit
- pic=$shared
+ spic=$shared
;;
"Power Macintosh"|ppc|powerpc)
arch="ppc"
;;
sparc)
arch="sparc"
- pic=$shared
+ spic=$shared
;;
sun4u|sparc64)
arch="sparc"
subarch="sparc64"
enable fast_64bit
- pic=$shared
+ spic=$shared
;;
i386|i486|i586|i686|i86pc|BePC)
arch="x86"
enable cmov
enable fast_cmov
enable fast_unaligned
- check_cc <<EOF && enable fast_64bit && subarch="x86_64" && pic=$shared
+ check_cc <<EOF && enable fast_64bit && subarch="x86_64" && spic=$shared
int test[sizeof(char*) - 7];
EOF
;;
esac
enable $arch $subarch
+enabled spic && enable pic
# OS specific
case $target_os in
FFSERVERLDFLAGS=-Wl,-bind_at_load
objformat="macho"
enabled x86_64 && objformat="macho64"
- enabled shared || check_cflags -mdynamic-no-pic
+ enabled shared ||
+ { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
;;
mingw32*)
if test $target_os = "mingw32ce"; then
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
enabled libdirac && add_cflags $(pkg-config --cflags dirac) &&
- require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
- require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder
+ require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) &&
+ require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
enabled libgsm && require libgsm gsm.h gsm_create -lgsm
echo "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak
echo "EXTRA_VERSION=$extra_version" >> config.mak
-echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
echo "DEPFLAGS=$DEPFLAGS" >> config.mak
+echo "CCDEP=$CCDEP" >> config.mak
+echo "ASDEP=$ASDEP" >> config.mak
+echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak
+echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak
echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak
echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak