check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
}
+check_code(){
+ log check_code "$@"
+ check=$1
+ headers=$2
+ code=$3
+ shift 3
+ {
+ for hdr in $headers; do
+ echo "#include <$hdr>"
+ done
+ echo "int main(void) { $code; return 0; }"
+ } | check_$check "$@"
+}
+
check_cppflags(){
log check_cppflags "$@"
set -- $($filter_cppflags "$@")
type=$2
shift 2
disable_safe "$type"
- incs=""
- for hdr in $headers; do
- incs="$incs
-#include <$hdr>"
- done
- check_cc "$@" <<EOF && enable_safe "$type"
-$incs
-$type v;
-EOF
+ check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
}
check_struct(){
member=$3
shift 3
disable_safe "${struct}_${member}"
- incs=""
- for hdr in $headers; do
- incs="$incs
-#include <$hdr>"
- done
- check_cc "$@" <<EOF && enable_safe "${struct}_${member}"
-$incs
-const void *p = &(($struct *)0)->$member;
-EOF
+ check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
+ enable_safe "${struct}_${member}"
}
require(){
dlfcn_h
dlopen
dos_paths
+ dxva_h
ebp_available
ebx_available
exp2
ibm_asm
inet_aton
inline_asm
+ io_h
isatty
+ isinf
+ isnan
jack_port_get_latency_range
ldbrx
libdc1394_1
netinet_sctp_h
poll_h
posix_memalign
+ rdtsc
round
roundf
sched_getaffinity
strptime
strtok_r
struct_addrinfo
+ struct_group_source_req
+ struct_ip_mreq_source
struct_ipv6_mreq
+ struct_pollfd
struct_rusage_ru_maxrss
struct_sockaddr_in6
struct_sockaddr_sa_len
;;
x86)
subarch="x86_32"
- check_cc <<EOF && subarch="x86_64"
- int test[(int)sizeof(char*) - 7];
-EOF
+ check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
if test "$subarch" = "x86_64"; then
spic=$shared
fi
elif enabled x86; then
+ check_code ld intrin.h "__rdtsc()" && enable rdtsc
+
enable local_aligned_8 local_aligned_16
# check whether EBP is available on x86
if enabled network; then
check_type "sys/types.h sys/socket.h" socklen_t
check_type netdb.h "struct addrinfo"
+ check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
+ check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
check_type netinet/in.h "struct sockaddr_in6"
+ check_type poll.h "struct pollfd"
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_header netinet/sctp.h
network_extralibs="-lws2_32"; }
check_type ws2tcpip.h socklen_t
check_type ws2tcpip.h "struct addrinfo"
+ check_type ws2tcpip.h "struct group_source_req"
+ check_type ws2tcpip.h "struct ip_mreq_source"
check_type ws2tcpip.h "struct ipv6_mreq"
+ check_type winsock2.h "struct pollfd"
check_type ws2tcpip.h "struct sockaddr_in6"
check_type ws2tcpip.h "struct sockaddr_storage"
check_struct winsock2.h "struct sockaddr" sa_len
check_func_headers windows.h VirtualAlloc
check_header dlfcn.h
+check_header dxva.h
check_header dxva2api.h
+check_header io.h
check_header malloc.h
check_header poll.h
check_header sys/mman.h
check_mathfunc cbrtf
check_mathfunc exp2
check_mathfunc exp2f
+check_mathfunc isinf
+check_mathfunc isnan
check_mathfunc llrint
check_mathfunc llrintf
check_mathfunc log2
EOF
get_version(){
- name=$1
- file=$source_path/$2
+ lcname=$1
+ name=$(toupper $lcname)
+ file=$source_path/$lcname/version.h
eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
- lcname=$(tolower $name)
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
}
-get_version LIBAVCODEC libavcodec/version.h
-get_version LIBAVDEVICE libavdevice/avdevice.h
-get_version LIBAVFILTER libavfilter/version.h
-get_version LIBAVFORMAT libavformat/version.h
-get_version LIBAVRESAMPLE libavresample/version.h
-get_version LIBAVUTIL libavutil/avutil.h
-get_version LIBSWSCALE libswscale/swscale.h
+get_version libavcodec
+get_version libavdevice
+get_version libavfilter
+get_version libavformat
+get_version libavresample
+get_version libavutil
+get_version libswscale
cat > $TMPH <<EOF
/* Automatically generated by configure - do not modify! */
test -n "$malloc_prefix" &&
echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
-if enabled small || disabled optimizations; then
- echo "#undef av_always_inline" >> $TMPH
- if enabled small; then
- echo "#define av_always_inline inline" >> $TMPH
- else
- echo "#define av_always_inline av_unused" >> $TMPH
- fi
-fi
-
if enabled yasm; then
append config_files $TMPASM
printf '' >$TMPASM