]> git.sesse.net Git - ffmpeg/blobdiff - configure
lavfi/noise: copy inline asm from mp=noise
[ffmpeg] / configure
index f5196e115cc1c24ec9adf2d6f62daf423c8490fd..0da1f772fa66ccf97b0144a63b7d6c1bcd5f6ec9 100755 (executable)
--- a/configure
+++ b/configure
@@ -316,7 +316,6 @@ Optimization options (experts only):
   --disable-fast-unaligned consider unaligned accesses slow
 
 Developer options (useful when working on FFmpeg itself):
-  --enable-coverage        build with test coverage instrumentation
   --disable-debug          disable debugging symbols
   --enable-debug=LEVEL     set the debug level [$debuglevel]
   --disable-optimizations  disable compiler optimizations
@@ -658,6 +657,12 @@ print_config(){
                 } else if (file ~ /\\.mak\$/) {
                     n = -v ? \"\" : \"!\";
                     printf(\"%s%s=yes\\n\", n, c) >>file;
+                } else if (file ~ /\\.texi\$/) {
+                    pre = -v ? \"\" : \"@c \";
+                    yesno = \$2;
+                    c2 = tolower(c);
+                    gsub(/_/, \"-\", c2);
+                    printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
                 }
             }
         }"
@@ -1264,6 +1269,12 @@ THREADS_LIST='
     os2threads
 '
 
+ATOMICS_LIST='
+    atomics_gcc
+    atomics_win32
+    atomics_suncc
+'
+
 ARCH_LIST='
     aarch64
     alpha
@@ -1374,6 +1385,7 @@ HAVE_LIST="
     $HAVE_LIST_CMDLINE
     $HAVE_LIST_PUB
     $THREADS_LIST
+    $ATOMICS_LIST
     $MATH_FUNCS
     access
     aligned_malloc
@@ -1384,6 +1396,8 @@ HAVE_LIST="
     asm_mod_q
     asm_mod_y
     asm_types_h
+    atomic_cas_ptr
+    atomics_native
     attribute_may_alias
     attribute_packed
     cdio_paranoia_h
@@ -1545,7 +1559,6 @@ CMDLINE_SELECT="
     $HAVE_LIST_CMDLINE
     $THREADS_LIST
     asm
-    coverage
     cross_compile
     debug
     extra_warnings
@@ -2451,13 +2464,13 @@ sysinclude_default="${sysroot}/usr/include"
 case "$toolchain" in
     clang-asan)
         cc_default="clang"
-        add_cflags  -faddress-sanitizer
-        add_ldflags -faddress-sanitizer
+        add_cflags  -fsanitize=address
+        add_ldflags -fsanitize=address
     ;;
     clang-tsan)
         cc_default="clang"
-        add_cflags  -fthread-sanitizer
-        add_ldflags -fthread-sanitizer
+        add_cflags  -fsanitize=thread -pie
+        add_ldflags -fsanitize=thread -pie
     ;;
     msvc)
         cc_default="c99wrap cl"
@@ -2466,6 +2479,10 @@ case "$toolchain" in
         ar_default="lib"
         target_os_default="win32"
     ;;
+    gcov)
+        add_cflags  -fprofile-arcs -ftest-coverage
+        add_ldflags -fprofile-arcs -ftest-coverage
+    ;;
     ?*)
         die "Unknown toolchain $toolchain"
     ;;
@@ -3829,6 +3846,7 @@ check_func  strerror_r
 check_func  sched_getaffinity
 check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
 check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
+check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
 check_builtin MemoryBarrier windows.h "MemoryBarrier()"
 check_func  sysconf
 check_func  sysctl
@@ -3909,6 +3927,10 @@ if enabled pthreads; then
   check_func pthread_cancel
 fi
 
+enabled sync_val_compare_and_swap && enable atomics_gcc
+enabled machine_rw_barrier && enabled atomic_cas_ptr && enable atomics_suncc
+enabled MemoryBarrier && enable atomics_win32
+
 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
@@ -4097,7 +4119,6 @@ enabled vdpau &&
 disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
 
 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
-enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
 test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
 
 # add some useful compiler flags if supported
@@ -4248,8 +4269,9 @@ case $target_os in
     ;;
 esac
 
-enabled_any $THREADS_LIST      && enable threads
 enable frame_thread_encoder
+enabled_any $THREADS_LIST      && enable threads
+enabled_any $ATOMICS_LIST      && enable atomics_native
 
 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
 
@@ -4391,13 +4413,13 @@ fi
 
 echo "License: $license"
 
-echo "Creating config.mak and config.h..."
+echo "Creating config.mak, config.h, and doc/config.texi..."
 
 test -e Makefile || $ln_s "$source_path/Makefile" .
 
 enabled stripping || strip="echo skipping strip"
 
-config_files="$TMPH config.mak"
+config_files="$TMPH config.mak doc/config.texi"
 
 cat > config.mak <<EOF
 # Automatically generated by configure - do not modify!
@@ -4549,6 +4571,9 @@ if enabled yasm; then
     printf '' >$TMPASM
 fi
 
+mkdir -p doc
+echo "@c auto-generated by configure" > doc/config.texi
+
 print_config ARCH_   "$config_files" $ARCH_LIST
 print_config HAVE_   "$config_files" $HAVE_LIST
 print_config CONFIG_ "$config_files" $CONFIG_LIST       \