]> git.sesse.net Git - ffmpeg/blobdiff - configure
dts probe
[ffmpeg] / configure
index 49a75a484ec5a112205a48574e8bf7357ff520f4..8dc4c33ab1a2225c7c6245e4932e7244a2fb7940 100755 (executable)
--- a/configure
+++ b/configure
@@ -110,7 +110,6 @@ show_help(){
   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]"
@@ -216,7 +216,7 @@ 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
 }
 
@@ -700,6 +694,7 @@ ARCH_EXT_LIST='
     altivec
     armv5te
     armv6
+    armvfp
     iwmmxt
     mmi
     mmx
@@ -788,7 +783,6 @@ CMDLINE_SET='
     incdir
     libdir
     logfile
-    make
     mandir
     prefix
     shlibdir
@@ -802,10 +796,11 @@ CMDLINE_SET='
 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"
 
@@ -849,6 +844,7 @@ audio_beos_muxer_deps="audio_beos"
 audio_beos_muxer_extralibs="-lmedia -lbe"
 avisynth_demuxer_deps="avisynth"
 bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
+dirac_demuxer_deps="dirac_parser"
 dv1394_demuxer_deps="dv1394 dv_demuxer"
 libdc1394_demuxer_deps="libdc1394"
 libnut_demuxer_deps="libnut"
@@ -900,7 +896,6 @@ cc="gcc"
 ar="ar"
 nm="nm"
 ranlib="ranlib"
-make="make"
 strip="strip"
 asmalign_pot="unknown"
 ln_s="ln -sf"
@@ -930,7 +925,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
@@ -946,8 +941,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\"`"
@@ -1054,79 +1048,6 @@ for opt do
     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 $target_os in
     beos|haiku|zeta)
@@ -1157,7 +1078,7 @@ case $target_os in
         fi ;;
     sunos)
         FFSERVERLDFLAGS=""
-        SHFLAGS='-shared -Wl,-h,$@'
+        SHFLAGS='-shared -Wl,-h,$$(@F)'
         network_extralibs="-lsocket -lnsl"
         ;;
     netbsd)
@@ -1184,7 +1105,7 @@ case $target_os 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"
@@ -1207,10 +1128,10 @@ case $target_os 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*)
         target_os=cygwin
@@ -1247,22 +1168,22 @@ case $target_os 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
         ;;
@@ -1285,10 +1206,11 @@ 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
@@ -1298,6 +1220,75 @@ 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"
 
@@ -1368,7 +1359,7 @@ if test $target_os = darwin; then
         add_cflags "-pipe"
         check_cflags "-force_cpusubtype_ALL"
         check_cflags "-Wno-sign-compare"
-        enabled shared || add_cflags -mdynamic-no-pic
+        enabled shared || check_cflags -mdynamic-no-pic
     fi
 fi
 
@@ -1443,20 +1434,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
@@ -1464,13 +1447,11 @@ 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."
@@ -1551,6 +1532,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
@@ -1612,6 +1594,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
@@ -1867,7 +1851,6 @@ enabled libvorbis && append pkg_requires "vorbisenc"
 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 "$build_suffix" != ""; then
@@ -1884,6 +1867,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
@@ -1967,7 +1951,6 @@ 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
@@ -1994,7 +1977,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
@@ -2079,7 +2061,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
@@ -2107,6 +2089,7 @@ if enabled source_path_used; then
     FILES="\
         Makefile             \
         common.mak           \
+        subdir.mak           \
         doc/texi2pod.pl      \
         libavcodec/Makefile  \
         libavdevice/Makefile \
@@ -2126,7 +2109,6 @@ fi
 
 
 # build pkg-config files
-# FIXME: libdir and includedir are hardcoded and may differ from the real path.
 
 pkgconfig_generate(){
 name=$1
@@ -2137,8 +2119,8 @@ requires=$5
 cat <<EOF >$name.pc
 prefix=$prefix
 exec_prefix=\${prefix}
-libdir=\${exec_prefix}/lib
-includedir=\${prefix}/include
+libdir=$libdir
+includedir=$incdir
 
 Name: $name
 Description: $comment