]> git.sesse.net Git - ffmpeg/blobdiff - configure
parser should not be needed anymore, merge cases and set frame size for amr too
[ffmpeg] / configure
index 7fb040de01e7a825fd4be974928c01d105f50f36..840d05470b7288a0431effeced5b332180422818 100755 (executable)
--- a/configure
+++ b/configure
@@ -58,7 +58,7 @@ show_help(){
   echo "  --help                   print this message"
   echo "  --logfile=FILE           log tests and output to FILE [config.err]"
   echo "  --disable-logging        do not log configure debug information"
-  echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
+  echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
   echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
   echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
   echo "  --incdir=DIR             install includes in DIR [PREFIX/include]"
@@ -82,7 +82,7 @@ show_help(){
   echo "  --enable-x11grab         enable X11 grabbing [default=no]"
   echo
   echo "External library support:"
-  echo "  --enable-sunmlib         use Sun medialib [default=no]"
+  echo "  --enable-mlib            use Sun medialib [default=no]"
   echo "  --enable-liba52          enable GPLed liba52 support [default=no]"
   echo "  --enable-liba52bin       open liba52.so.0 at runtime [default=no]"
   echo "  --enable-avisynth        allow reading AVISynth script files [default=no]"
@@ -107,10 +107,9 @@ show_help(){
   echo "Advanced options (experts only):"
   echo "  --source-path=PATH       path to source code [$source_path]"
   echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
-  echo "  --cross-compile          assume a cross-compiler is used"
-  echo "  --target-os=OS           compiler targets OS [$targetos]"
+  echo "  --enable-cross-compile   assume a cross-compiler is used"
+  echo "  --target-os=OS           compiler targets OS [$target_os]"
   echo "  --cc=CC                  use C compiler CC [$cc]"
-  echo "  --make=MAKE              use specified make [$make]"
   echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
   echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
   echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
@@ -125,6 +124,7 @@ show_help(){
   echo "  --disable-ssse3          disable SSSE3 usage"
   echo "  --disable-armv5te        disable armv5te usage"
   echo "  --disable-armv6          disable armv6 usage"
+  echo "  --disable-armvfp         disable ARM VFP usage"
   echo "  --disable-iwmmxt         disable iwmmxt usage"
   echo "  --disable-altivec        disable AltiVec usage"
   echo "  --disable-network        disable network support [default=no]"
@@ -205,18 +205,18 @@ If you think configure made a mistake, make sure you are using the latest
 version from SVN.  If the latest version fails, report the problem to the
 ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
 EOF
-    if enabled logging; then
+    if disabled logging; then
         cat <<EOF
-Include the log file "$logfile" produced by configure as this will help
-solving the problem.
+Rerun configure with logging enabled (do not use --disable-logging), and
+include the log this produces with your report.
 EOF
     else
 cat <<EOF
-Rerun configure with logging enabled (do not use --disable-logging), and
-include the log this produces with your report.
+Include the log file "$logfile" produced by configure as this will help
+solving the problem.
 EOF
     fi
-    rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
+    rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH
     exit 1
 }
 
@@ -427,9 +427,7 @@ check_asm(){
     asm="$2"
     shift 2
     check_cc "$@" <<EOF && enable $name || disable $name
-int foo(void){
-    asm volatile($asm);
-}
+int foo(void){ asm volatile($asm); }
 EOF
 }
 
@@ -454,9 +452,7 @@ EOF
 check_ldflags(){
     log check_ldflags "$@"
     check_ld "$@" <<EOF && add_ldflags "$@"
-int main(void){
-    return 0;
-}
+int main(void){ return 0; }
 EOF
 }
 
@@ -479,9 +475,7 @@ check_func(){
     disable $func
     check_ld "$@" <<EOF && enable $func
 extern int $func();
-int main(void){
-    $func();
-}
+int main(void){ $func(); }
 EOF
 }
 
@@ -658,6 +652,7 @@ CONFIG_LIST="
     libx264
     libxvid
     memalign_hack
+    mlib
     mpegaudio_hp
     network
     nonfree
@@ -699,6 +694,7 @@ ARCH_EXT_LIST='
     altivec
     armv5te
     armv6
+    armvfp
     iwmmxt
     mmi
     mmx
@@ -748,7 +744,6 @@ HAVE_LIST="
     malloc_h
     memalign
     mkstemp
-    mlib
     pld
     ppc64
     round
@@ -770,6 +765,7 @@ CMDLINE_SELECT="
     $ARCH_EXT_LIST
     $CONFIG_LIST
     $THREADS_LIST
+    cross_compile
     debug
     extra_warnings
     logging
@@ -778,6 +774,21 @@ CMDLINE_SELECT="
     static
     stripping
 "
+CMDLINE_SET='
+    arch
+    build_suffix
+    cc
+    cpu
+    cross_prefix
+    incdir
+    libdir
+    logfile
+    mandir
+    prefix
+    shlibdir
+    source_path
+    target_os
+'
 
 # code dependency declarations
 
@@ -785,10 +796,11 @@ CMDLINE_SELECT="
 altivec_deps="powerpc"
 armv5te_deps="armv4l"
 armv6_deps="armv4l"
+armvfp_deps="armv4l"
 iwmmxt_deps="armv4l"
 mmi_deps="mips"
 mmx_deps="x86"
-mmx2_deps="x86"
+mmx2_deps="x86 mmx"
 ssse3_deps="x86"
 vis_deps="sparc"
 
@@ -868,11 +880,10 @@ vhook_extralibs='$ldl'
 
 # default parameters
 
-enable logging
 logfile="config.err"
 
 # installation paths
-PREFIX="/usr/local"
+prefix="/usr/local"
 libdir='$(PREFIX)/lib'
 shlibdir="$libdir"
 incdir='$(PREFIX)/include'
@@ -884,7 +895,6 @@ cc="gcc"
 ar="ar"
 nm="nm"
 ranlib="ranlib"
-make="make"
 strip="strip"
 asmalign_pot="unknown"
 ln_s="ln -sf"
@@ -894,7 +904,7 @@ arch=`uname -m`
 cpu="generic"
 
 # OS
-targetos=$(tolower $(uname -s))
+target_os=$(tolower $(uname -s))
 
 # libraries
 enable zlib
@@ -914,7 +924,7 @@ enable stripping
 vhook="default"
 
 # build settings
-SHFLAGS='-shared -Wl,-soname,$@'
+SHFLAGS='-shared -Wl,-soname,$$(@F)'
 VHOOKSHFLAGS='$(SHFLAGS)'
 LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 FFSERVERLDFLAGS=-Wl,-E
@@ -930,8 +940,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 # gcc stupidly only outputs the basename of targets with -MM
-DEPEND_CMD='$(CC) -MM $(CFLAGS) $(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \($(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"'
-VHOOK_DEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\\1,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed "1s,^,$(@D)/,"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -993,44 +1002,12 @@ show_list() {
 for opt do
     optval="${opt#*=}"
     case "$opt" in
-    --logfile=*) logfile="$optval"
-    ;;
-    --prefix=*) PREFIX="$optval"
-    ;;
-    --libdir=*) libdir="$optval"
-    ;;
-    --shlibdir=*) shlibdir="$optval"
-    ;;
-    --incdir=*) incdir="$optval"
-    ;;
-    --mandir=*) mandir="$optval"
-    ;;
-    --source-path=*) source_path="$optval"
-    ;;
-    --cross-prefix=*) cross_prefix="$optval"
-    ;;
-    --cross-compile) enable cross_compile
-    ;;
-    --target-os=*) targetos="$optval"
-    ;;
-    --cc=*) cc="$optval"
-    ;;
-    --make=*) make="$optval"
-    ;;
     --extra-cflags=*) add_cflags "$optval"
     ;;
     --extra-ldflags=*) add_ldflags "$optval"
     ;;
     --extra-libs=*) add_extralibs "$optval"
     ;;
-    --build-suffix=*) BUILDSUF="$optval"
-    ;;
-    --arch=*) arch="$optval"
-    ;;
-    --cpu=*) cpu="$optval"
-    ;;
-    --enable-sunmlib) enable mlib
-    ;;
     --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
     ;;
     --enable-debug=*) debuglevel="$optval"
@@ -1061,88 +1038,19 @@ for opt do
     --help|-h) show_help
     ;;
     *)
-    die_unknown $opt
+    optname="${opt%=*}"
+    optname="${optname#--}"
+    optname=$(echo "$optname" | sed 's/-/_/g')
+    is_in $optname $CMDLINE_SET || die_unknown $opt
+    eval $optname='$optval'
     ;;
     esac
 done
 
-case "$arch" in
-    i386|i486|i586|i686|i86pc|BePC)
-        arch="x86_32"
-        enable fast_unaligned
-    ;;
-    x86_64|amd64)
-        arch="x86_32"
-        enable fast_unaligned
-        canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
-        if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
-            if ! echo $CFLAGS | grep -q -- -m32; then
-                arch="x86_64"
-                enable fast_64bit
-            fi
-        fi
-    ;;
-    # armv4l is a subset of armv[567]*l
-    arm|armv[4567]*l)
-        arch="armv4l"
-    ;;
-    alpha)
-        arch="alpha"
-        enable fast_64bit
-    ;;
-    "Power Macintosh"|ppc|powerpc)
-        arch="powerpc"
-    ;;
-    ppc64)
-        arch="powerpc"
-        enable fast_64bit
-    ;;
-    mips|mipsel|IP*)
-        arch="mips"
-    ;;
-    sun4u|sparc64)
-        arch="sparc64"
-        enable fast_64bit
-    ;;
-    sparc)
-        arch="sparc"
-    ;;
-    sh4)
-        arch="sh4"
-    ;;
-    parisc)
-        arch="parisc"
-    ;;
-    parisc64)
-        arch="parisc"
-        enable fast_64bit
-    ;;
-    s390|s390x)
-        arch="s390"
-    ;;
-    m68k)
-        arch="m68k"
-    ;;
-    ia64)
-        arch="ia64"
-        enable fast_64bit
-    ;;
-    bfin)
-        arch="bfin"
-    ;;
-    *)
-        arch="unknown"
-    ;;
-esac
-
-enable $arch
-enabled_any x86_32 x86_64 && enable x86
-enabled     sparc64       && enable sparc
-
 # OS specific
-case $targetos in
+case $target_os in
     beos|haiku|zeta)
-        PREFIX="$HOME/config"
+        prefix="$HOME/config"
         # helps building libavcodec
         add_cflags "-DPIC -fomit-frame-pointer"
         # 3 gcc releases known for BeOS, each with ugly bugs
@@ -1169,7 +1077,7 @@ case $targetos in
         fi ;;
     sunos)
         FFSERVERLDFLAGS=""
-        SHFLAGS='-shared -Wl,-h,$@'
+        SHFLAGS='-shared -Wl,-h,$$(@F)'
         network_extralibs="-lsocket -lnsl"
         ;;
     netbsd)
@@ -1196,7 +1104,7 @@ case $targetos in
     darwin)
         disable need_memalign
         SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
-        VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$@'
+        VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$$(@F)'
         strip="strip -x"
         FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
         SLIBSUF=".dylib"
@@ -1205,7 +1113,7 @@ case $targetos in
         FFSERVERLDFLAGS=-Wl,-bind_at_load
         ;;
     mingw32*)
-        targetos=mingw32
+        target_os=mingw32
         shlibdir="$bindir"
         VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
         VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
@@ -1219,13 +1127,13 @@ case $targetos in
         EXESUF=".exe"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_EXTRA_CMD='-lib /machine:i386 /def:$(@:$(SLIBSUF)=.def)'
-        SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
+        SLIB_EXTRA_CMD='-lib /machine:i386 /def:$$(@:$(SLIBSUF)=.def)'
+        SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
         SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
-        SHFLAGS='-shared -Wl,--output-def,$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
+        SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
         ;;
     cygwin*)
-        targetos=cygwin
+        target_os=cygwin
         shlibdir="$bindir"
         VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
         VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
@@ -1251,7 +1159,7 @@ case $targetos in
         enable dv1394
         ;;
     irix*)
-        targetos=irix
+        target_os=irix
         ranlib="echo ignoring ranlib"
         ;;
     os/2*)
@@ -1259,22 +1167,22 @@ case $targetos in
         ln_s="cp -f"
         EXESUF=".exe"
         FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
-        SHFLAGS='$(NAME).def -Zdll -Zomf'
+        SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
         FFSERVERLDFLAGS=""
         LIBSUF="_s.a"
         SLIBPREF=""
         SLIBSUF=".dll"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(NAME).def; \
-          echo PROTMODE >> $(NAME).def; \
-          echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(NAME).def; \
-          echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(NAME).def; \
-          echo EXPORTS >> $(NAME).def; \
-          emxexp -o $(OBJS) >> $(NAME).def'
-        SLIB_EXTRA_CMD='emximp -o $(LIBPREF)$(NAME)_dll.a $(NAME).def; \
-          emximp -o $(LIBPREF)$(NAME)_dll.lib $(NAME).def;'
-        SLIB_INSTALL_EXTRA_CMD='install -m 644 $(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
+        SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
+          echo PROTMODE >> $(SUBDIR)$(NAME).def; \
+          echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
+          echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
+          echo EXPORTS >> $(SUBDIR)$(NAME).def; \
+          emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
+        SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
+          emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
+        SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
         SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
         disable vhook
         ;;
@@ -1283,7 +1191,7 @@ case $targetos in
         ;;
 
     *)
-        targetos="${targetos}-UNKNOWN"
+        target_os="${target_os}-UNKNOWN"
         ;;
 esac
 
@@ -1297,19 +1205,89 @@ else
 fi
 
 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
-TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
-TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
+TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
+TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
 
 
 add_extralibs $osextralibs
 
-enabled logging || logfile=/dev/null
+disabled logging && logfile=/dev/null
 
 echo "# $0 $@" >$logfile
 set >>$logfile
 
+case "$arch" in
+    i386|i486|i586|i686|i86pc|BePC)
+        arch="x86_32"
+        enable fast_unaligned
+    ;;
+    x86_64|amd64)
+        arch="x86_32"
+        enable fast_unaligned
+        check_cc <<EOF && enable fast_64bit && arch="x86_64"
+        int test[sizeof(char*) - 7];
+EOF
+    ;;
+    # armv4l is a subset of armv[567]*l
+    arm|armv[4567]*l)
+        arch="armv4l"
+    ;;
+    alpha)
+        arch="alpha"
+        enable fast_64bit
+    ;;
+    "Power Macintosh"|ppc|powerpc)
+        arch="powerpc"
+    ;;
+    ppc64)
+        arch="powerpc"
+        enable fast_64bit
+    ;;
+    mips|mipsel|IP*)
+        arch="mips"
+    ;;
+    sun4u|sparc64)
+        arch="sparc64"
+        enable fast_64bit
+    ;;
+    sparc)
+        arch="sparc"
+    ;;
+    sh4)
+        arch="sh4"
+    ;;
+    parisc)
+        arch="parisc"
+    ;;
+    parisc64)
+        arch="parisc"
+        enable fast_64bit
+    ;;
+    s390|s390x)
+        arch="s390"
+    ;;
+    m68k)
+        arch="m68k"
+    ;;
+    ia64)
+        arch="ia64"
+        enable fast_64bit
+    ;;
+    bfin)
+        arch="bfin"
+    ;;
+    *)
+        arch="unknown"
+    ;;
+esac
+
+enable $arch
+enabled_any x86_32 x86_64 && enable x86
+enabled     sparc64       && enable sparc
+
 # Combine FFLDFLAGS and the LDFLAGS environment variable.
 LDFLAGS="$FFLDFLAGS $LDFLAGS"
 
@@ -1373,7 +1351,7 @@ check_deps $ARCH_EXT_LIST
 test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
-if test $targetos = darwin; then
+if test $target_os = darwin; then
     if $cc -v 2>&1 | grep -q xlc; then
         add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
     else
@@ -1455,20 +1433,12 @@ if test $cpu != "generic"; then
     esac
 fi
 
-gnu_make(){
-    $1 --version 2>&1 | grep -q GNU
-}
-
-if ! gnu_make $make; then
-    gnu_make gmake && make=gmake || die "GNU make not found."
-fi
-
 # make sure we can execute files in $TMPDIR
-cat >$TMPE 2>>$logfile <<EOF
+cat >$TMPSH 2>>$logfile <<EOF
 #! /bin/sh
 EOF
-chmod +x $TMPE >>$logfile 2>&1
-if ! $TMPE >>$logfile 2>&1; then
+chmod +x $TMPSH >>$logfile 2>&1
+if ! $TMPSH >>$logfile 2>&1; then
     cat <<EOF
 Unable to create and execute files in $TMPDIR1.  Set the TMPDIR environment
 variable to another directory and make sure that $TMPDIR1 is not mounted
@@ -1476,18 +1446,16 @@ noexec.
 EOF
     die "Sanity test failed."
 fi
-rm $TMPE
+rm $TMPSH
 
 # compiler sanity check
 check_exec <<EOF
-int main(void){
-    return 0;
-}
+int main(void){ return 0; }
 EOF
 if test "$?" != 0; then
     echo "$cc is unable to create an executable file."
     if test -z "$cross_prefix" && ! enabled cross_compile ; then
-        echo "If $cc is a cross-compiler, use the --cross-compile option."
+        echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
         echo "Only do this if you know what cross compiling means."
     fi
     die "C compiler test failed."
@@ -1563,6 +1531,7 @@ fi
 enabled armv4l  && check_asm pld     '"pld [r0]"'
 enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
 enabled armv6   && check_asm armv6   '"sadd16 r0, r0, r0"'
+enabled armvfp  && check_asm armvfp  '"fadds s0, s0, s0"'
 enabled iwmmxt  && check_asm iwmmxt  '"wunpckelub wr6, wr4"'
 enabled mmi     && check_asm mmi     '"lq $2, 0($2)"'
 enabled vis     && check_asm vis     '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc
@@ -1624,6 +1593,8 @@ if enabled pthreads; then
     elif check_func pthread_create -pthreads; then
         add_cflags -pthreads
         add_extralibs -pthreads
+    elif check_func pthread_create -lpthreadGC2; then
+        add_extralibs -lpthreadGC2
     elif ! check_lib pthread.h pthread_create -lpthread; then
         die "ERROR: can't find pthreads library"
     fi
@@ -1686,7 +1657,7 @@ done
 
 test "$vhook" = "default" && vhook="$dlopen"
 
-if test "$targetos" = cygwin -o "$targetos" = mingw32 && enabled_all static vhook ; then
+if test "$target_os" = cygwin -o "$target_os" = mingw32 && enabled_all static vhook ; then
     disable vhook
     echo
     echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
@@ -1876,14 +1847,13 @@ enabled libdc1394 && append pkg_requires "libraw1394"
 enabled libtheora && append pkg_requires "theora"
 enabled libvorbis && append pkg_requires "vorbisenc"
 
-echo "install prefix            $PREFIX"
+echo "install prefix            $prefix"
 echo "source path               $source_path"
 echo "C compiler                $cc"
-echo "make                      $make"
 echo ".align is power-of-two    $asmalign_pot"
 echo "ARCH                      $arch ($cpu)"
-if test "$BUILDSUF" != ""; then
-    echo "build suffix              $BUILDSUF"
+if test "$build_suffix" != ""; then
+    echo "build suffix              $build_suffix"
 fi
 echo "big-endian                ${bigendian-no}"
 if test $arch = "x86_32" -o $arch = "x86_64"; then
@@ -1896,6 +1866,7 @@ fi
 if test $arch = "armv4l"; then
     echo "ARMv5TE enabled           ${armv5te-no}"
     echo "ARMv6 enabled             ${armv6-no}"
+    echo "ARM VFP enabled           ${armvfp-no}"
     echo "IWMMXT enabled            ${iwmmxt-no}"
 fi
 if test $arch = "mips"; then
@@ -1972,14 +1943,13 @@ echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
 echo "#define FFMPEG_CONFIG_H" >> $TMPH
 echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
 
-echo "PREFIX=$PREFIX" >> config.mak
+echo "PREFIX=$prefix" >> config.mak
 echo "prefix=\$(DESTDIR)\$(PREFIX)" >> config.mak
 echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
 echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
 echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
 echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
 echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
-echo "MAKE=$make" >> config.mak
 echo "CC=$cc" >> config.mak
 echo "AR=$ar" >> config.mak
 echo "RANLIB=$ranlib" >> config.mak
@@ -1997,7 +1967,7 @@ echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
 echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
 echo "BUILD_STATIC=$static" >> config.mak
-echo "BUILDSUF=$BUILDSUF" >> config.mak
+echo "BUILDSUF=$build_suffix" >> config.mak
 echo "FULLNAME=$FULLNAME" >> config.mak
 echo "LIBPREF=$LIBPREF" >> config.mak
 echo "LIBSUF=$LIBSUF" >> config.mak
@@ -2006,7 +1976,6 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
 echo "SLIBSUF=$SLIBSUF" >> config.mak
 echo "EXESUF=$EXESUF" >> config.mak
 echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
-echo "VHOOK_DEPEND_CMD=$VHOOK_DEPEND_CMD" >> config.mak
 
 if enabled bigendian; then
     echo "WORDS_BIGENDIAN=yes" >> config.mak
@@ -2091,7 +2060,7 @@ cmp -s $TMPH config.h &&
     echo "config.h is unchanged" ||
     mv -f $TMPH config.h
 
-rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
+rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH
 
 # build tree in object directory if source path is different from current one
 if enabled source_path_used; then
@@ -2119,6 +2088,7 @@ if enabled source_path_used; then
     FILES="\
         Makefile             \
         common.mak           \
+        subdir.mak           \
         doc/texi2pod.pl      \
         libavcodec/Makefile  \
         libavdevice/Makefile \
@@ -2138,7 +2108,6 @@ fi
 
 
 # build pkg-config files
-# FIXME: libdir and includedir are hardcoded and may differ from the real path.
 
 pkgconfig_generate(){
 name=$1
@@ -2147,10 +2116,10 @@ version=$3
 libs=$4
 requires=$5
 cat <<EOF >$name.pc
-prefix=$PREFIX
+prefix=$prefix
 exec_prefix=\${prefix}
-libdir=\${exec_prefix}/lib
-includedir=\${prefix}/include
+libdir=$libdir
+includedir=$incdir
 
 Name: $name
 Description: $comment