]> git.sesse.net Git - ffmpeg/blobdiff - configure
Sightly simplify initialization of int start.
[ffmpeg] / configure
index 691155af0a1c2055c4cfc26efe4c714fd49d4113..032fd5b4a58106feffc6d28fa98cb4d5c091f3a8 100755 (executable)
--- a/configure
+++ b/configure
@@ -208,6 +208,7 @@ Advanced options (experts only):
                            instruction selection, may crash on older CPUs)
   --enable-powerpc-perf    enable performance report on PPC
                            (requires enabling PMC)
+  --disable-asm            disable all assembler optimizations
   --disable-altivec        disable AltiVec optimizations
   --disable-amd3dnow       disable 3DNow! optimizations
   --disable-amd3dnowext    disable 3DNow! extended optimizations
@@ -583,11 +584,11 @@ check_as(){
 check_asm(){
     log check_asm "$@"
     name="$1"
-    asm="$2"
+    code="$2"
     shift 2
     disable $name
     check_as "$@" <<EOF && enable $name
-void foo(void){ __asm__ volatile($asm); }
+void foo(void){ __asm__ volatile($code); }
 EOF
 }
 
@@ -601,12 +602,12 @@ check_yasm(){
 
 check_ld(){
     log check_ld "$@"
-    check_cc || return
     flags=''
     libs=''
     for f; do
         test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
     done
+    check_cc $($filter_cflags $flags) || return
     check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
 }
 
@@ -626,13 +627,18 @@ int x;
 EOF
 }
 
-check_ldflags(){
-    log check_ldflags "$@"
-    check_ld "$@" <<EOF && add_ldflags "$@"
+test_ldflags(){
+    log test_ldflags "$@"
+    check_ld "$@" <<EOF
 int main(void){ return 0; }
 EOF
 }
 
+check_ldflags(){
+    log check_ldflags "$@"
+    test_ldflags "$@" && add_ldflags "$@"
+}
+
 check_header(){
     log check_header "$@"
     header=$1
@@ -678,7 +684,8 @@ check_cpp_condition(){
     log check_cpp_condition "$@"
     header=$1
     condition=$2
-    check_cpp <<EOF
+    shift 2
+    check_cpp $($filter_cppflags "$@") <<EOF
 #include <$header>
 #if !($condition)
 #error "unsatisfied condition: $condition"
@@ -703,11 +710,7 @@ check_lib2(){
     headers="$1"
     func="$2"
     shift 2
-    temp_extralibs "$@"
-    check_func_headers "$headers" $func && add_extralibs "$@"
-    err=$?
-    restore_flags
-    return $err
+    check_func_headers "$headers" $func "$@" && add_extralibs "$@"
 }
 
 check_exec(){
@@ -757,6 +760,24 @@ $type v;
 EOF
 }
 
+check_struct(){
+    log check_type "$@"
+    headers=$1
+    struct=$2
+    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
+}
+
 require(){
     name="$1"
     header="$2"
@@ -810,6 +831,12 @@ apply(){
     "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
 }
 
+cp_if_changed(){
+    cmp -s "$1" "$2" &&
+        echo "$2 is unchanged" ||
+        cp -f "$1" "$2"
+}
+
 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
 # system-dependent things.
 
@@ -936,14 +963,18 @@ ARCH_EXT_LIST='
     vis
 '
 
+HAVE_LIST_PUB='
+    bigendian
+'
+
 HAVE_LIST="
     $ARCH_EXT_LIST
+    $HAVE_LIST_PUB
     $THREADS_LIST
     alsa_asoundlib_h
     altivec_h
     arpa_inet_h
     attribute_packed
-    bigendian
     bswap
     closesocket
     cmov
@@ -1026,6 +1057,7 @@ CMDLINE_SELECT="
     $ARCH_EXT_LIST
     $CONFIG_LIST
     $THREADS_LIST
+    asm
     cross_compile
     debug
     extra_warnings
@@ -1078,24 +1110,32 @@ CMDLINE_APPEND="
 # code dependency declarations
 
 # architecture extensions
-altivec_deps="ppc"
-amd3dnow_deps="mmx"
-amd3dnowext_deps="amd3dnow"
+
 armv5te_deps="arm"
 armv6_deps="arm"
 armv6t2_deps="arm"
 armvfp_deps="arm"
 iwmmxt_deps="arm"
+neon_deps="arm"
+
 mmi_deps="mips"
+
+altivec_deps="ppc"
+ppc4xx_deps="ppc"
+
+vis_deps="sparc"
+
+x86_64_select="cmov fast_cmov"
+amd3dnow_deps="mmx"
+amd3dnowext_deps="amd3dnow"
 mmx_deps="x86"
 mmx2_deps="mmx"
-neon_deps="arm"
-ppc4xx_deps="ppc"
 sse_deps="mmx"
 ssse3_deps="sse"
-vis_deps="sparc"
 
+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"
 
 need_memalign="altivec neon sse"
 inline_asm_deps="!tms470"
@@ -1340,6 +1380,7 @@ target_os=$(tolower $(uname -s))
 host_os=$target_os
 
 # configurable options
+enable asm
 enable debug
 enable doc
 enable fastdiv
@@ -1556,6 +1597,7 @@ tmpfile TMPE  $EXESUF
 tmpfile TMPH  .h
 tmpfile TMPO  .o
 tmpfile TMPS  .S
+tmpfile TMPV  .ver
 tmpfile TMPSH .sh
 
 unset -f mktemp
@@ -1741,99 +1783,163 @@ if test "$cpu" = host; then
     test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
 fi
 
-# Add processor-specific flags
-case $cpu in
-    601|ppc601|PowerPC601)
-        cpuflags="-mcpu=601"
-    ;;
-    603*|ppc603*|PowerPC603*)
-        cpuflags="-mcpu=603"
-    ;;
-    604*|ppc604*|PowerPC604*)
-        cpuflags="-mcpu=604"
-    ;;
-    G3|g3|75*|ppc75*|PowerPC75*)
-        cpuflags="-mcpu=750 -mpowerpc-gfxopt"
-    ;;
-    G4|g4|745*|ppc745*|PowerPC745*)
-        cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
-    ;;
-    74*|ppc74*|PowerPC74*)
-        cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
-    ;;
-    G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
-        cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
-    ;;
-    Cell|CELL|cell)
-        cpuflags="-mcpu=cell"
-        enable ldbrx
-    ;;
-    # targets that do NOT support conditional mov (cmov)
-    i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
-        cpuflags="-march=$cpu"
-        disable cmov
-    ;;
-    # targets that do support conditional mov (cmov)
-    i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10)
-        cpuflags="-march=$cpu"
-        enable cmov
-        enable fast_cmov
-    ;;
-    # targets that do support conditional mov but on which it's slow
-    pentium4|pentium4m|prescott|nocona)
-        cpuflags="-march=$cpu"
-        enable cmov
-        disable fast_cmov
-    ;;
-    sparc64)
-        cpuflags="-mcpu=v9"
-    ;;
-    arm11*|cortex*)
-        cpuflags="-mcpu=$cpu"
-        enable fast_unaligned
-    ;;
-    armv[67]*)
-        cpuflags="-march=$cpu"
-        enable fast_unaligned
-    ;;
-    armv*)
-        cpuflags="-march=$cpu"
-    ;;
+# Deal with common $arch aliases
+case "$arch" in
     arm*)
-        cpuflags="-mcpu=$cpu"
+        arch="arm"
     ;;
-    ev4|ev45|ev5|ev56|pca56|ev6|ev67)
-        enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
+    mips|mipsel|IP*)
+        arch="mips"
     ;;
-    bf*)
-        cpuflags="-mcpu=$cpu"
+    mips64)
+        arch="mips"
+        subarch="mips64"
     ;;
-    mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
-        cpuflags="-march=$cpu"
+    parisc|hppa)
+        arch="parisc"
     ;;
-    ap7[02]0[0-2])
-        subarch="avr32_ap"
-        cpuflags="-mpart=$cpu"
+    parisc64|hppa64)
+        arch="parisc"
+        subarch="parisc64"
     ;;
-    ap)
-        subarch="avr32_ap"
-        cpuflags="-march=$cpu"
+    "Power Macintosh"|ppc|powerpc)
+        arch="ppc"
     ;;
-    uc3[ab]*)
-        subarch="avr32_uc"
-        cpuflags="-mcpu=$cpu"
+    ppc64)
+        arch="ppc"
+        subarch="ppc64"
+    ;;
+    s390|s390x)
+        arch="s390"
     ;;
-    uc)
-        subarch="avr32_uc"
-        cpuflags="-march=$cpu"
+    sh4|sh)
+        arch="sh4"
     ;;
-    generic)
+    sun4u|sparc64)
+        arch="sparc"
+        subarch="sparc64"
     ;;
-    *)
-        echo "WARNING: Unknown CPU \"$cpu\", ignored."
+    i[3-6]86|i86pc|BePC|x86_64|amd64)
+        arch="x86"
     ;;
 esac
 
+is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch"
+enable $arch
+
+# Add processor-specific flags
+if test "$cpu" = generic; then
+    : do nothing
+elif enabled ppc; then
+
+    case $cpu in
+        601|ppc601|PowerPC601)
+            cpuflags="-mcpu=601"
+        ;;
+        603*|ppc603*|PowerPC603*)
+            cpuflags="-mcpu=603"
+        ;;
+        604*|ppc604*|PowerPC604*)
+            cpuflags="-mcpu=604"
+        ;;
+        G3|g3|75*|ppc75*|PowerPC75*)
+            cpuflags="-mcpu=750 -mpowerpc-gfxopt"
+        ;;
+        G4|g4|745*|ppc745*|PowerPC745*)
+            cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
+        ;;
+        74*|ppc74*|PowerPC74*)
+            cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
+        ;;
+        G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
+            cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
+        ;;
+        Cell|CELL|cell)
+            cpuflags="-mcpu=cell"
+            enable ldbrx
+        ;;
+    esac
+
+elif enabled x86; then
+
+    case $cpu in
+        i[345]86|pentium)
+            cpuflags="-march=$cpu"
+            disable mmx
+        ;;
+        # targets that do NOT support conditional mov (cmov)
+        pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
+            cpuflags="-march=$cpu"
+            disable cmov
+        ;;
+        # targets that do support conditional mov (cmov)
+        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10)
+            cpuflags="-march=$cpu"
+            enable cmov
+            enable fast_cmov
+        ;;
+        # targets that do support conditional mov but on which it's slow
+        pentium4|pentium4m|prescott|nocona)
+            cpuflags="-march=$cpu"
+            enable cmov
+            disable fast_cmov
+        ;;
+    esac
+
+elif enabled sparc; then
+
+    case $cpu in
+        sparc64)
+            cpuflags="-mcpu=v9"
+        ;;
+    esac
+
+elif enabled arm; then
+
+    case $cpu in
+        armv*)
+            cpuflags="-march=$cpu"
+        ;;
+        *)
+            cpuflags="-mcpu=$cpu"
+        ;;
+    esac
+
+elif enabled alpha; then
+
+    enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
+
+elif enabled bfin; then
+
+    cpuflags="-mcpu=$cpu"
+
+elif enabled mips; then
+
+    cpuflags="-march=$cpu"
+
+elif enabled avr32; then
+
+    case $cpu in
+        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"
+        ;;
+    esac
+
+fi
+
 add_cflags $cpuflags
 add_asflags $cpuflags
 
@@ -1862,93 +1968,21 @@ EOF
 check_host_cflags -std=c99
 
 case "$arch" in
-    alpha)
-        arch="alpha"
-        enable fast_64bit
-        check_cflags -mieee
+    alpha|ia64|mips|parisc|sparc)
         spic=$shared
     ;;
-    arm|armv[4567]*l)
-        arch="arm"
-    ;;
-    avr32)
-    ;;
-    bfin)
-        arch="bfin"
-    ;;
-    ia64)
-        arch="ia64"
-        enable fast_64bit
-        spic=$shared
-        # HACK: currently fails to build if .bss is > 4MB and shared libs are built
-        enabled shared && enable_weak hardcoded_tables
-    ;;
-    m68k)
-        arch="m68k"
-    ;;
-    mips|mipsel|IP*)
-        arch="mips"
-        spic=$shared
-    ;;
-    mips64)
-        arch="mips"
-        subarch="mips64"
-        enable fast_64bit
-        spic=$shared
-    ;;
-    parisc|hppa)
-        arch="parisc"
-        spic=$shared
-    ;;
-    parisc64|hppa64)
-        arch="parisc"
-        enable fast_64bit
-        spic=$shared
-    ;;
-    "Power Macintosh"|ppc|powerpc)
-        arch="ppc"
-        enable fast_unaligned
-    ;;
-    ppc64)
-        arch="ppc"
-        subarch="ppc64"
-        enable fast_64bit
-        enable fast_unaligned
-    ;;
-    s390|s390x)
-        arch="s390"
-    ;;
-    sh4|sh)
-        arch="sh4"
-    ;;
-    sparc)
-        arch="sparc"
-        spic=$shared
-    ;;
-    sun4u|sparc64)
-        arch="sparc"
-        subarch="sparc64"
-        enable fast_64bit
-        spic=$shared
-    ;;
-    i386|i486|i586|i686|i86pc|BePC|x86_64|amd64)
-        arch="x86"
+    x86)
         subarch="x86_32"
-        enable fast_unaligned
-        check_cc <<EOF && enable fast_64bit && subarch="x86_64" && spic=$shared
+        check_cc <<EOF && subarch="x86_64"
         int test[(int)sizeof(char*) - 7];
 EOF
         if test "$subarch" = "x86_64"; then
-            enable cmov
-            enable fast_cmov
+            spic=$shared
         fi
     ;;
-    *)
-        arch="unknown"
-    ;;
 esac
 
-enable $arch $subarch
+enable $subarch
 enabled spic && enable pic
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
 
@@ -2023,6 +2057,8 @@ case $target_os in
             { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
         ;;
     mingw32*)
+        # Only WinXP or greater are supported
+        add_cflags -D_WIN32_WINNT=0x0501
         if test $target_os = "mingw32ce"; then
             disable network
         else
@@ -2187,7 +2223,7 @@ enabled pic && enable_pic
 check_cc <<EOF || die "Symbol mangling check failed."
 int ff_extern;
 EOF
-sym=$($nm -P -g $TMPO | grep ff_extern)
+sym=$($nm -g $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
 extern_prefix=${sym%%ff_extern*}
 
 check_cc <<EOF && enable inline_asm
@@ -2208,9 +2244,13 @@ EOF
 check_cc <<EOF || die "endian test failed"
 unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
 EOF
-od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
+od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
 
-if enabled arm; then
+if enabled alpha; then
+
+    check_cflags -mieee
+
+elif enabled arm; then
 
     check_cflags -marm
 
@@ -2231,6 +2271,11 @@ EOF
 
     enabled_all armv6t2 shared !pic && enable_pic
 
+elif enabled ia64; then
+
+    # HACK: currently fails to build if .bss is > 4MB and shared libs are built
+    enabled shared && enable_weak hardcoded_tables
+
 elif enabled mips; then
 
     check_asm loongson '"dmult.g $1, $2, $3"'
@@ -2425,8 +2470,8 @@ enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
 enabled libtheora  && require  libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
 enabled libvorbis  && require  libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
 enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 -lm &&
-                      { check_cpp_condition x264.h "X264_BUILD >= 79" ||
-                        die "ERROR: libx264 version must be >= 0.79."; }
+                      { check_cpp_condition x264.h "X264_BUILD >= 83" ||
+                        die "ERROR: libx264 version must be >= 0.83."; }
 enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
 enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
 
@@ -2439,31 +2484,14 @@ if enabled libdc1394; then
     die "ERROR: No version of libdc1394 found "
 fi
 
-disable sdl_too_old
-disable sdl
 SDL_CONFIG="${cross_prefix}sdl-config"
 if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
     sdl_cflags=$("${SDL_CONFIG}" --cflags)
     sdl_libs=$("${SDL_CONFIG}" --libs)
-    temp_cflags $sdl_cflags
-    temp_extralibs $sdl_libs
-    if check_lib2 SDL.h SDL_Init; then
-        _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
-        if test "$_sdlversion" -lt 121 ; then
-            enable sdl_too_old
-        else
-            enable sdl
-            check_cc $sdl_cflags <<EOF && enable sdl_video_size
-#include <SDL.h>
-int main(int argc, char **argv){
-    const SDL_VideoInfo *vi = SDL_GetVideoInfo();
-    int w = vi->current_w;
-    return 0;
-}
-EOF
-        fi
-    fi
-    restore_flags
+    check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
+    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
+    enable sdl &&
+    check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
 fi
 
 texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
@@ -2471,7 +2499,7 @@ texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
 if enabled network; then
     check_type "sys/types.h sys/socket.h" socklen_t
     check_type netdb.h "struct addrinfo"
-    check_type sys/socket.h "struct sockaddr_storage"
+    check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
     # Prefer arpa/inet.h over winsock2
     if check_header arpa/inet.h ; then
         check_func closesocket
@@ -2561,6 +2589,10 @@ check_ldflags -Wl,--as-needed
 check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 check_ldflags -Wl,-Bsymbolic
 
+echo "X{};" > $TMPV
+test_ldflags -Wl,--version-script,$TMPV &&
+    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
+
 if enabled small; then
     check_cflags -Os            # not all compilers support -Os
     optimizations="small"
@@ -2644,6 +2676,8 @@ check_deps $CONFIG_LIST       \
            $OUTDEV_LIST       \
            $PROTOCOL_LIST     \
 
+enabled asm || disable $ARCH_LIST $ARCH_EXT_LIST
+
 echo "install prefix            $prefix"
 echo "source path               $source_path"
 echo "C compiler                $cc"
@@ -2706,9 +2740,6 @@ if enabled network; then
 fi
 echo "threading support         ${thread_type-no}"
 echo "SDL support               ${sdl-no}"
-if enabled sdl_too_old; then
-    echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
-fi
 echo "Sun medialib support      ${mlib-no}"
 echo "AVISynth enabled          ${avisynth-no}"
 echo "libdc1394 support         ${libdc1394-no}"
@@ -2756,6 +2787,44 @@ echo "License: $license"
 
 echo "Creating config.mak and config.h..."
 
+# build tree in object directory if source path is different from current one
+if enabled source_path_used; then
+    DIRS="
+        doc
+        libavcodec
+        libavcodec/$arch
+        libavdevice
+        libavfilter
+        libavformat
+        libavutil
+        libavutil/$arch
+        libpostproc
+        libswscale
+        libswscale/$arch
+        tests
+        tools
+    "
+    FILES="
+        Makefile
+        common.mak
+        subdir.mak
+        doc/texi2pod.pl
+        libavcodec/Makefile
+        libavdevice/Makefile
+        libavfilter/Makefile
+        libavformat/Makefile
+        libavutil/Makefile
+        libpostproc/Makefile
+        libswscale/Makefile
+    "
+    for dir in $DIRS ; do
+        mkdir -p $dir
+    done
+    for f in $FILES ; do
+        $ln_s "$source_path/$f" $f
+    done
+fi
+
 enabled stripping || strip="echo skipping strip"
 
 cat > config.mak <<EOF
@@ -2888,48 +2957,19 @@ echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
 echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
 
 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
-cmp -s $TMPH config.h &&
-    echo "config.h is unchanged" ||
-    mv -f $TMPH config.h
+cp_if_changed $TMPH config.h
 
-# build tree in object directory if source path is different from current one
-if enabled source_path_used; then
-    DIRS="
-        doc
-        libavcodec
-        libavcodec/$arch
-        libavdevice
-        libavfilter
-        libavformat
-        libavutil
-        libavutil/$arch
-        libpostproc
-        libswscale
-        libswscale/$arch
-        tests
-        tools
-    "
-    FILES="
-        Makefile
-        common.mak
-        subdir.mak
-        doc/texi2pod.pl
-        libavcodec/Makefile
-        libavdevice/Makefile
-        libavfilter/Makefile
-        libavformat/Makefile
-        libavutil/Makefile
-        libpostproc/Makefile
-        libswscale/Makefile
-    "
-    for dir in $DIRS ; do
-        mkdir -p $dir
-    done
-    for f in $FILES ; do
-        $ln_s "$source_path/$f" $f
-    done
-fi
+cat > $TMPH <<EOF
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+EOF
+
+print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
+
+echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
 
+cp_if_changed $TMPH libavutil/avconfig.h
 
 # build pkg-config files