check_as(){
log check_as "$@"
- cat > $TMPC
- log_file $TMPC
- check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPC
+ cat > $TMPS
+ log_file $TMPS
+ check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
}
check_inline_asm(){
code="$2"
shift 2
disable $name
- check_as "$@" <<EOF && enable $name
+ check_cc "$@" <<EOF && enable $name
void foo(void){ __asm__ volatile($code); }
EOF
}
+check_insn(){
+ log check_insn "$@"
+ check_inline_asm ${1}_inline "\"$2\""
+ echo "$2" | check_as && enable ${1}_external || disable ${1}_external
+}
+
check_yasm(){
log check_yasm "$@"
echo "$1" > $TMPS
x86_64
'
+ARCH_EXT_LIST_ARM='
+ armv5te
+ armv6
+ armv6t2
+ armvfp
+ neon
+ vfpv3
+'
+
ARCH_EXT_LIST_X86='
amd3dnow
amd3dnowext
'
ARCH_EXT_LIST="
+ $ARCH_EXT_LIST_ARM
$ARCH_EXT_LIST_X86
altivec
- armv5te
- armv6
- armv6t2
- armvfp
- neon
ppc4xx
- vfpv3
vis
"
attribute_packed
closesocket
cmov
+ CommandLineToArgvW
cpunop
CryptGenRandom
dcbzl
sched_getaffinity
sdl
sdl_video_size
+ SetConsoleTextAttribute
setmode
setrlimit
Sleep
neon_deps="arm"
vfpv3_deps="armvfp"
+map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
+
altivec_deps="ppc"
ppc4xx_deps="ppc"
aligned_stack_if_any="ppc x86"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
-fast_unaligned_if_any="armv6 ppc x86"
+fast_clz_if_any="alpha avr32 mips ppc x86"
+fast_unaligned_if_any="ppc x86"
inline_asm_deps="!tms470"
need_memalign="altivec neon sse"
eac3_demuxer_select="ac3_parser"
flac_demuxer_select="flac_parser"
ipod_muxer_select="mov_muxer"
+ismv_muxer_select="mov_muxer"
matroska_audio_muxer_select="matroska_muxer"
matroska_demuxer_suggest="bzlib lzo zlib"
mov_demuxer_suggest="zlib"
swscale_deps="avutil"
# programs
-avconv_deps="avcodec avfilter avformat avresample swscale
- aformat_filter asyncts_filter
- format_filter fps_filter scale_filter setpts_filter"
-avplay_deps="avcodec avformat swscale sdl"
+avconv_deps="avcodec avfilter avformat avresample swscale"
+avconv_select="aformat_filter asyncts_filter
+ format_filter fps_filter scale_filter setpts_filter"
+avplay_deps="avcodec avformat avresample swscale sdl"
avplay_select="rdft"
avprobe_deps="avcodec avformat"
avserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer !shared"
for opt do
optval="${opt#*=}"
case "$opt" in
- --extra-ldflags=*) add_ldflags $optval
- ;;
- --extra-libs=*) add_extralibs $optval
- ;;
- --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
- ;;
- --enable-debug=*) debuglevel="$optval"
- ;;
- --disable-programs)
- disable $PROGRAM_LIST
- ;;
- --disable-everything)
- map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
- ;;
- --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"
- 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')
- if is_in $option $COMPONENT_LIST; then
- test $action = disable && action=unset
- eval $action \$$(toupper ${option%s})_LIST
- elif is_in $option $CMDLINE_SELECT; then
- $action $option
- else
- die_unknown $opt
- fi
- ;;
- --list-*)
- NAME="${opt#--list-}"
- is_in $NAME $COMPONENT_LIST || die_unknown $opt
- NAME=${NAME%s}
- eval show_list $NAME \$$(toupper $NAME)_LIST
- ;;
- --help|-h) show_help
- ;;
- *)
- optname="${opt%%=*}"
- optname="${optname#--}"
- optname=$(echo "$optname" | sed 's/-/_/g')
- if is_in $optname $CMDLINE_SET; then
- eval $optname='$optval'
- elif is_in $optname $CMDLINE_APPEND; then
- append $optname "$optval"
- else
- die_unknown $opt
- fi
- ;;
+ --extra-ldflags=*) add_ldflags $optval
+ ;;
+ --extra-libs=*) add_extralibs $optval
+ ;;
+ --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
+ ;;
+ --enable-debug=*) debuglevel="$optval"
+ ;;
+ --disable-programs)
+ disable $PROGRAM_LIST
+ ;;
+ --disable-everything)
+ map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
+ ;;
+ --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"
+ 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')
+ if is_in $option $COMPONENT_LIST; then
+ test $action = disable && action=unset
+ eval $action \$$(toupper ${option%s})_LIST
+ elif is_in $option $CMDLINE_SELECT; then
+ $action $option
+ else
+ die_unknown $opt
+ fi
+ ;;
+ --list-*)
+ NAME="${opt#--list-}"
+ is_in $NAME $COMPONENT_LIST || die_unknown $opt
+ NAME=${NAME%s}
+ eval show_list $NAME \$$(toupper $NAME)_LIST
+ ;;
+ --help|-h) show_help
+ ;;
+ *)
+ optname="${opt%%=*}"
+ optname="${optname#--}"
+ optname=$(echo "$optname" | sed 's/-/_/g')
+ if is_in $optname $CMDLINE_SET; then
+ eval $optname='$optval'
+ elif is_in $optname $CMDLINE_APPEND; then
+ append $optname "$optval"
+ else
+ die_unknown $opt
+ fi
+ ;;
esac
done
enable $arch
# Add processor-specific flags
-if test "$cpu" = generic; then
- : do nothing
-
-elif enabled aarch64; then
+if enabled aarch64; then
case $cpu in
armv*)
elif enabled arm; then
+ check_arm_arch() {
+ check_cpp_condition stddef.h \
+ "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
+ $cpuflags
+ }
+
+ probe_arm_arch() {
+ if check_arm_arch 4; then echo armv4;
+ elif check_arm_arch 4T; then echo armv4t;
+ elif check_arm_arch 5; then echo armv5;
+ elif check_arm_arch 5E; then echo armv5e;
+ elif check_arm_arch 5T; then echo armv5t;
+ elif check_arm_arch 5TE; then echo armv5te;
+ elif check_arm_arch 5TEJ; then echo armv5te;
+ elif check_arm_arch 6; then echo armv6;
+ elif check_arm_arch 6J; then echo armv6j;
+ elif check_arm_arch 6K; then echo armv6k;
+ elif check_arm_arch 6Z; then echo armv6z;
+ elif check_arm_arch 6ZK; then echo armv6zk;
+ elif check_arm_arch 6T2; then echo armv6t2;
+ elif check_arm_arch 7; then echo armv7;
+ elif check_arm_arch 7A 7_A; then echo armv7-a;
+ elif check_arm_arch 7R 7_R; then echo armv7-r;
+ elif check_arm_arch 7M 7_M; then echo armv7-m;
+ elif check_arm_arch 7EM 7E_M; then echo armv7-m;
+ elif check_arm_arch 8A 8_A; then echo armv8-a;
+ fi
+ }
+
+ [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
+
case $cpu in
armv*)
cpuflags="-march=$cpu"
arm11*) subarch=armv6 ;;
arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
+ *) subarch=$(probe_arm_arch) ;;
esac
;;
esac
+ case "$subarch" in
+ armv5t*) enable fast_clz ;;
+ armv[6-8]*) enable fast_clz fast_unaligned ;;
+ esac
+
elif enabled avr32; then
case $cpu in
fi
-add_cflags $cpuflags
-add_asflags $cpuflags
+if [ "$cpu" != generic ]; then
+ add_cflags $cpuflags
+ add_asflags $cpuflags
+fi
# compiler sanity check
check_exec <<EOF
;;
ppc)
check_64bit ppc ppc64 'sizeof(void *) > 4'
+ spic=$shared
;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
- SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
+ SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
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)'
- SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
+ SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
objformat="win32"
dlltool="${cross_prefix}dlltool"
ranlib=:
elif enabled arm; then
+ check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
enabled thumb && check_cflags -mthumb || check_cflags -marm
nogas=die
warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
fi
- enabled armv5te && check_inline_asm armv5te '"qadd r0, r0, r0"'
- enabled armv6 && check_inline_asm armv6 '"sadd16 r0, r0, r0"'
- enabled armv6t2 && check_inline_asm armv6t2 '"movt r0, #0"'
- enabled armvfp && check_inline_asm armvfp '"fadds s0, s0, s0"'
- enabled neon && check_inline_asm neon '"vadd.i16 q0, q0, q0"'
- enabled vfpv3 && check_inline_asm vfpv3 '"vmov.f32 s0, #1.0"'
+ enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
+ enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
+ enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
+ enabled armvfp && check_insn armvfp 'fadds s0, s0, s0'
+ enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
+ enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
+
+ map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
if enabled asm; then
as=${gas:=$as}
- check_inline_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
+ check_as <<EOF && enable gnu_as || \
$nogas "GNU assembler not found, install gas-preprocessor"
+.macro m n
+\n: .int 0
+.endm
+m x
+EOF
fi
check_ldflags -Wl,--as-needed
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetSystemTimeAsFileTime
check_func_headers windows.h MapViewOfFile
+check_func_headers windows.h SetConsoleTextAttribute
check_func_headers windows.h Sleep
check_func_headers windows.h VirtualAlloc
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
if ! disabled w32threads && ! enabled pthreads; then
- check_func _beginthreadex && enable w32threads
+ check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
fi
# check for some common methods of building with pthread support