]> git.sesse.net Git - ffmpeg/blobdiff - configure
fix IPCM_decode_error.h264
[ffmpeg] / configure
index 86394e9d3d9de5949c2d4000d339c37545bd85df..227aafcaee3639f68216be9b0a270ca94bd2e616 100755 (executable)
--- a/configure
+++ b/configure
@@ -59,6 +59,7 @@ show_help(){
   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 "  --bindir=DIR             install binaries in DIR [PREFIX/bin]"
   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]"
@@ -299,6 +300,12 @@ disabled_any(){
     done
 }
 
+set_default(){
+    for opt; do
+        eval test -z "\$$opt" && eval $opt=\$${opt}_default
+    done
+}
+
 is_in(){
     value=$1
     shift
@@ -705,6 +712,7 @@ ARCH_EXT_LIST='
     mmi
     mmx
     mmx2
+    neon
     ssse3
     vis
 '
@@ -713,6 +721,7 @@ HAVE_LIST="
     $ARCH_EXT_LIST
     $THREADS_LIST
     altivec_h
+    altivec_vector_braces
     arpa_inet_h
     bswap
     byteswap_h
@@ -781,21 +790,27 @@ CMDLINE_SELECT="
     static
     stripping
 "
-CMDLINE_SET='
+
+PATHS_LIST='
+    bindir
+    incdir
+    libdir
+    mandir
+    prefix
+    shlibdir
+'
+
+CMDLINE_SET="
+    $PATHS_LIST
     arch
     build_suffix
     cc
     cpu
     cross_prefix
-    incdir
-    libdir
     logfile
-    mandir
-    prefix
-    shlibdir
     source_path
     target_os
-'
+"
 
 # code dependency declarations
 
@@ -808,6 +823,7 @@ iwmmxt_deps="armv4l"
 mmi_deps="mips"
 mmx_deps="x86"
 mmx2_deps="x86 mmx"
+neon_deps="armv4l"
 ssse3_deps="x86"
 vis_deps="sparc"
 
@@ -816,6 +832,7 @@ ac3_decoder_deps="gpl"
 dxa_decoder_deps="zlib"
 flashsv_decoder_deps="zlib"
 flashsv_encoder_deps="zlib"
+mlp_decoder_deps="mlp_parser"
 mpeg_xvmc_decoder_deps="xvmc"
 png_decoder_deps="zlib"
 png_encoder_deps="zlib"
@@ -895,12 +912,12 @@ vhook_extralibs='$ldl'
 logfile="config.err"
 
 # installation paths
-prefix="/usr/local"
-libdir='$(PREFIX)/lib'
-shlibdir="$libdir"
-incdir='$(PREFIX)/include'
-mandir='$(PREFIX)/share/man'
-bindir='$(PREFIX)/bin'
+prefix_default="/usr/local"
+bindir_default='${prefix}/bin'
+incdir_default='${prefix}/include'
+libdir_default='${prefix}/lib'
+mandir_default='${prefix}/share/man'
+shlibdir_default="$libdir_default"
 
 # toolchain
 cc="gcc"
@@ -939,7 +956,7 @@ vhook="default"
 # build settings
 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'
+LDLATEFLAGS='-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'
 FFSERVERLDFLAGS=-Wl,-E
 LIBPREF="lib"
 LIBSUF=".a"
@@ -953,7 +970,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) $(CFLAGS) -MM -MG $< | sed "1s,^,$(@D)/,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2," -e "s/\(.*\)\.o/\1.d &/"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -1159,7 +1176,7 @@ enabled     sparc64       && enable sparc
 # OS specific
 case $target_os in
     beos|haiku|zeta)
-        prefix="$HOME/config"
+        prefix_default="$HOME/config"
         # helps building libavcodec
         add_cflags "-DPIC -fomit-frame-pointer"
         # 3 gcc releases known for BeOS, each with ugly bugs
@@ -1228,7 +1245,7 @@ case $target_os in
             disable need_memalign
             LIBTARGET=x64
         fi
-        shlibdir="$bindir"
+        shlibdir_default="$bindir_default"
         VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
         VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
         if enabled swscale; then
@@ -1249,7 +1266,7 @@ case $target_os in
         ;;
     cygwin*)
         target_os=cygwin
-        shlibdir="$bindir"
+        shlibdir_default="$bindir_default"
         VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
         VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
         if enabled swscale; then
@@ -1310,6 +1327,8 @@ case $target_os in
         ;;
 esac
 
+set_default $PATHS_LIST
+
 add_extralibs $osextralibs
 
 # Combine FFLDFLAGS and the LDFLAGS environment variable.
@@ -1381,7 +1400,7 @@ if test $target_os = darwin; then
     fi
 fi
 
-disabled optimizations || add_cflags -fomit-frame-pointer
+disabled optimizations || check_cflags -fomit-frame-pointer
 
 # Add processor-specific flags
 if test $cpu != "generic"; then
@@ -1443,7 +1462,7 @@ if test $cpu != "generic"; then
         sparc64)
             add_cflags "-mcpu=v9"
         ;;
-        arm*)
+        arm*|cortex*)
             add_cflags "-mcpu=$cpu"
         ;;
         *)
@@ -1529,13 +1548,10 @@ fi
 # AltiVec flags: The FSF version of GCC differs from the Apple version
 if enabled altivec; then
     check_cflags -maltivec -mabi=altivec &&
-        check_header altivec.h ||
+        { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
         check_cflags -faltivec
 
     # check if our compiler supports Motorola AltiVec C API
-    enabled altivec_h &&
-        inc_altivec_h="#include <altivec.h>" ||
-        inc_altivec_h=
     check_cc <<EOF || disable altivec
 $inc_altivec_h
 int main(void) {
@@ -1543,6 +1559,13 @@ int main(void) {
     v1 = vec_add(v2,v3);
     return 0;
 }
+EOF
+
+    # check if our compiler supports braces for vector declarations
+    check_cc <<EOF && enable altivec_vector_braces
+$inc_altivec_h
+#define AVV(x...) {x}
+int main (void) { (vector int) AVV(1); return 0; }
 EOF
 fi
 
@@ -1553,6 +1576,7 @@ 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 neon    && check_asm neon    '"vadd.i16 q0, q0, q0"'
 enabled vis     && check_asm vis     '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc
 
 enabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"
@@ -1914,6 +1938,7 @@ if test $arch = "armv4l"; then
     echo "ARMv6 enabled             ${armv6-no}"
     echo "ARM VFP enabled           ${armvfp-no}"
     echo "IWMMXT enabled            ${iwmmxt-no}"
+    echo "NEON enabled              ${neon-no}"
 fi
 if test $arch = "mips"; then
     echo "MMI enabled               ${mmi-no}"
@@ -1963,8 +1988,8 @@ echo "libnut enabled            ${libnut-no}"
 echo "libschroedinger enabled   ${libschroedinger-no}"
 echo "libtheora enabled         ${libtheora-no}"
 echo "libvorbis enabled         ${libvorbis-no}"
-echo "x264 enabled              ${libx264-no}"
-echo "XviD enabled              ${libxvid-no}"
+echo "libx264 enabled           ${libx264-no}"
+echo "libxvid enabled           ${libxvid-no}"
 echo "zlib enabled              ${zlib-no}"
 echo "bzlib enabled             ${bzlib-no}"
 echo
@@ -1995,8 +2020,8 @@ 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=\$(DESTDIR)\$(PREFIX)" >> config.mak
+echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
+echo "prefix=$prefix" >> config.mak
 echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
 echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
 echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
@@ -2169,7 +2194,7 @@ comment=$2
 version=$3
 libs=$4
 requires=$5
-cat <<EOF > $name.pc
+cat <<EOF > $name/$name.pc
 prefix=$prefix
 exec_prefix=\${prefix}
 libdir=$libdir
@@ -2178,25 +2203,25 @@ includedir=$incdir
 Name: $name
 Description: $comment
 Version: $version
-Requires: $requires
+Requires: $(disabled shared && echo $requires)
+Requires.private: $(enabled shared && echo $requires)
 Conflicts:
-Libs: -L\${libdir} -l${shortname}
-Libs.private: $libs
+Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
+Libs.private: $(enabled shared && echo $libs)
 Cflags: -I\${includedir}
 EOF
-cat <<EOF > $name-uninstalled.pc
+cat <<EOF > $name/$name-uninstalled.pc
 prefix=
 exec_prefix=
-libdir=\${pcfiledir}/$name
-includedir=\${pcfiledir}
+libdir=\${pcfiledir}
+includedir=\${pcfiledir}/..
 
 Name: $name
 Description: $comment
 Version: $version
 Requires: $requires
 Conflicts:
-Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF}
-Libs.private: $libs
+Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
 Cflags: -I\${includedir}
 EOF
 }
@@ -2205,13 +2230,13 @@ pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
 pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
 pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
 pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$pkg_requires libavformat = $LIBAVFORMAT_VERSION"
-enabled avfilter && \
+enabled avfilter &&
     pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
-enabled postproc && \
+enabled postproc &&
     pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
 if enabled swscale; then
     pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
 else
     pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
-    apply libswscale.pc sed s/^Libs:.*$/Libs:/
+    apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/
 fi