]> git.sesse.net Git - ffmpeg/blobdiff - configure
Port MPlayer fixes for coverity issues in libmpcodecs.
[ffmpeg] / configure
index cf05d2f4d9d8df309b400a90b2d3edcf2d44cc66..7f9fe4f0b7ccc632ded2cbad0eaef8ae9d3e7b08 100755 (executable)
--- a/configure
+++ b/configure
@@ -129,6 +129,7 @@ Component options:
   --disable-dct            disable DCT code
   --disable-dwt            disable DWT code
   --disable-lsp            disable LSP code
+  --disable-lzo            disable LZO decoder code
   --disable-mdct           disable MDCT code
   --disable-rdft           disable RDFT code
   --disable-fft            disable FFT code
@@ -851,11 +852,13 @@ EOF
 check_mathfunc(){
     log check_mathfunc "$@"
     func=$1
-    shift
+    narg=$2
+    shift 2
+    test $narg = 2 && args="f, g" || args="f"
     disable $func
     check_ld "cc" "$@" <<EOF && enable $func
 #include <math.h>
-float foo(float f) { return $func(f); }
+float foo(float f, float g) { return $func($args); }
 int main(void){ return (int) foo; }
 EOF
 }
@@ -1059,7 +1062,7 @@ apply(){
 cp_if_changed(){
     cmp -s "$1" "$2" && echo "$2 is unchanged" && return
     mkdir -p "$(dirname $2)"
-    cp -f "$1" "$2"
+    $cp_f "$1" "$2"
 }
 
 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
@@ -1158,6 +1161,7 @@ CONFIG_LIST="
     libxavs
     libxvid
     lsp
+    lzo
     mdct
     memalign_hack
     memory_poisoning
@@ -1264,20 +1268,28 @@ HAVE_LIST_PUB='
 '
 
 MATH_FUNCS="
+    atanf
+    atan2f
     cbrtf
+    cosf
     exp2
     exp2f
+    expf
     isinf
     isnan
+    ldexpf
     llrint
     llrintf
     log2
     log2f
+    log10f
     lrint
     lrintf
+    powf
     rint
     round
     roundf
+    sinf
     trunc
     truncf
 "
@@ -1331,6 +1343,7 @@ HAVE_LIST="
     GetProcessTimes
     GetSystemTimeAsFileTime
     getrusage
+    getservbyport
     gettimeofday
     glob
     gnu_as
@@ -1595,6 +1608,7 @@ binkaudio_dct_decoder_select="mdct rdft dct sinewin"
 binkaudio_rdft_decoder_select="mdct rdft sinewin"
 cavs_decoder_select="golomb mpegvideo"
 cook_decoder_select="mdct sinewin"
+cscd_decoder_select="lzo"
 cscd_decoder_suggest="zlib"
 dca_decoder_select="mdct"
 dirac_decoder_select="dwt golomb"
@@ -1685,6 +1699,7 @@ msmpeg4v3_encoder_select="h263_encoder"
 mss2_decoder_select="vc1_decoder"
 nellymoser_decoder_select="mdct sinewin"
 nellymoser_encoder_select="mdct sinewin"
+nuv_decoder_select="lzo"
 png_decoder_select="zlib"
 png_encoder_select="zlib"
 qcelp_decoder_select="lsp"
@@ -1817,7 +1832,7 @@ ipod_muxer_select="mov_muxer"
 libnut_demuxer_deps="libnut"
 libnut_muxer_deps="libnut"
 matroska_audio_muxer_select="matroska_muxer"
-matroska_demuxer_suggest="zlib bzlib"
+matroska_demuxer_suggest="bzlib lzo zlib"
 mov_demuxer_suggest="zlib"
 mp3_demuxer_select="mpegaudio_parser"
 mp4_muxer_select="mov_muxer"
@@ -1985,6 +2000,7 @@ ar_default="ar"
 cc_default="gcc"
 cxx_default="g++"
 host_cc_default="gcc"
+cp_f="cp -f"
 install="install"
 ln_s="ln -sf"
 nm_default="nm -g"
@@ -2714,21 +2730,13 @@ case "$arch" in
     arm*|iPad*)
         arch="arm"
     ;;
-    mips|mipsel|IP*)
-        arch="mips"
-    ;;
-    mips64*)
+    mips*|IP*)
         arch="mips"
-        subarch="mips64"
-    ;;
-    parisc|hppa)
-        arch="parisc"
     ;;
-    parisc64|hppa64)
+    parisc*|hppa*)
         arch="parisc"
-        subarch="parisc64"
     ;;
-    "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
+    "Power Macintosh"|ppc*|powerpc*)
         arch="ppc"
     ;;
     s390|s390x)
@@ -2833,12 +2841,12 @@ elif enabled x86; then
 elif enabled sparc; then
 
     case $cpu in
-        niagara)
+        cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
             cpuflags="-mcpu=$cpu"
             disable vis
         ;;
-        sparc64)
-            cpuflags="-mcpu=v9"
+        ultrasparc*|niagara[234])
+            cpuflags="-mcpu=$cpu"
         ;;
     esac
 
@@ -2948,13 +2956,31 @@ EOF
 check_host_cflags -std=c99
 check_host_cflags -Wall
 
+check_64bit(){
+    arch32=$1
+    arch64=$2
+    expr=$3
+    check_code cc "" "int test[2*($expr) - 1]" &&
+        subarch=$arch64 || subarch=$arch32
+}
+
 case "$arch" in
-    alpha|ia64|mips|parisc|sparc)
+    alpha|ia64|sparc)
+        spic=$shared
+    ;;
+    mips)
+        check_64bit mips mips64 '_MIPS_SIM > 1'
         spic=$shared
     ;;
+    parisc)
+        check_64bit parisc parisc64 'sizeof(void *) > 4'
+        spic=$shared
+    ;;
+    ppc)
+        check_64bit ppc ppc64 'sizeof(void *) > 4'
+    ;;
     x86)
-        subarch="x86_32"
-        check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
+        check_64bit x86_32 x86_64 'sizeof(void *) > 4'
         if test "$subarch" = "x86_64"; then
             spic=$shared
         fi
@@ -3177,6 +3203,19 @@ case $target_os in
         ;;
     minix)
         ;;
+    plan9)
+        add_cppflags -D_C99_SNPRINTF_EXTENSION  \
+                     -D_REENTRANT_SOURCE        \
+                     -D_RESEARCH_SOURCE         \
+                     -DFD_SETSIZE=96            \
+                     -DHAVE_SOCK_OPTS
+        add_compat strtod.o strtod=avpriv_strtod
+        network_extralibs='-lbsd'
+        exeobjs=compat/plan9/main.o
+        disable ffserver
+        ln_s='ln -s -f'
+        cp_f='cp'
+        ;;
     none)
         ;;
     *)
@@ -3393,9 +3432,7 @@ EOF
 
 elif enabled sparc; then
 
-    enabled vis &&
-        check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
-            add_cflags -mcpu=ultrasparc -mtune=ultrasparc
+    enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
 
 elif enabled x86; then
 
@@ -3484,6 +3521,7 @@ if enabled network; then
     check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
     check_type netinet/sctp.h "struct sctp_event_subscribe"
     check_func getaddrinfo $network_extralibs
+    check_func getservbyport $network_extralibs
     # Prefer arpa/inet.h over winsock2
     if check_header arpa/inet.h ; then
         check_func closesocket
@@ -3619,8 +3657,12 @@ check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
 enabled vaapi && require vaapi va/va.h vaInitialize -lva
 
+atan2f_args=2
+ldexpf_args=2
+powf_args=2
+
 for func in $MATH_FUNCS; do
-    check_mathfunc $func
+    eval check_mathfunc $func \${${func}_args:-1}
 done
 
 # these are off by default, so fail if requested and not available
@@ -3925,6 +3967,12 @@ elif enabled msvc; then
     enabled x86_32 && disable aligned_stack
 fi
 
+case $target_os in
+    plan9)
+        add_cppflags -Dmain=plan9_main
+    ;;
+esac
+
 enabled_any $THREADS_LIST      && enable threads
 
 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
@@ -4206,6 +4254,7 @@ ZLIB=$($ldflags_filter -lz)
 LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
 EXTRALIBS=$extralibs
 COMPAT_OBJS=$compat_objs
+EXEOBJS=$exeobjs
 INSTALL=$install
 LIBTARGET=${LIBTARGET}
 SLIBNAME=${SLIBNAME}