]> git.sesse.net Git - ffmpeg/blobdiff - configure
configure: add foo_select facility
[ffmpeg] / configure
index 00c44da5be42a08367002e1590183c4616c6e407..073181b53b95c824a5c7c8db1174299347ee955e 100755 (executable)
--- a/configure
+++ b/configure
@@ -102,6 +102,7 @@ show_help(){
   echo "  --enable-libnut          enable NUT (de)muxing via libnut,"
   echo "                           native demuxer exists [default=no]"
   echo "  --enable-libschroedinger enable Dirac support via libschroedinger [default=no]"
+  echo "  --enable-libspeex        enable Speex decoding via libspeex [default=no]"
   echo "  --enable-libtheora       enable Theora encoding via libtheora [default=no]"
   echo "  --enable-libvorbis       enable Vorbis encoding via libvorbis,"
   echo "                           native implementation exists [default=no]"
@@ -308,6 +309,7 @@ disabled_any(){
     for opt; do
         disabled $opt && return 0
     done
+    return 1
 }
 
 set_default(){
@@ -334,17 +336,20 @@ check_deps(){
 
         eval dep_all="\$${cfg}_deps"
         eval dep_any="\$${cfg}_deps_any"
+        eval dep_sel="\$${cfg}_select"
 
-        pushvar cfg dep_all dep_any
-        check_deps $dep_all $dep_any
-        popvar cfg dep_all dep_any
+        pushvar cfg dep_all dep_any dep_sel
+        check_deps $dep_all $dep_any $dep_sel
+        popvar cfg dep_all dep_any dep_sel
 
         enabled_all $dep_all || disable $cfg
         enabled_any $dep_any || disable $cfg
+        disabled_any $dep_sel && disable $cfg
 
         if enabled $cfg; then
             eval dep_extralibs="\$${cfg}_extralibs"
             test -n "$dep_extralibs" && add_extralibs $dep_extralibs
+            enable $dep_sel
         fi
 
         disable ${cfg}_checking
@@ -627,14 +632,6 @@ require2(){
     check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
 }
 
-require_cpp_condition(){
-    name="$1"
-    header="$2"
-    cpp_condition="$3"
-    shift 3
-    check_cpp_condition $header "$cpp_condition" || die "ERROR: $name does not satisfy CPP condition: $cpp_condition"
-}
-
 check_foo_config(){
     cfg=$1
     pkg=$2
@@ -700,6 +697,7 @@ CONFIG_LIST="
     libmp3lame
     libnut
     libschroedinger
+    libspeex
     libtheora
     libvorbis
     libx264
@@ -899,6 +897,7 @@ libgsm_ms_encoder_deps="libgsm"
 libmp3lame_encoder_deps="libmp3lame"
 libschroedinger_decoder_deps="libschroedinger"
 libschroedinger_encoder_deps="libschroedinger"
+libspeex_decoder_deps="libspeex"
 libtheora_encoder_deps="libtheora"
 libvorbis_encoder_deps="libvorbis"
 libx264_encoder_deps="libx264"
@@ -961,7 +960,7 @@ mandir_default='${prefix}/share/man'
 shlibdir_default="$libdir_default"
 
 # toolchain
-cc="gcc"
+cc_default="gcc"
 yasmexe="yasm"
 ar="ar"
 nm="nm"
@@ -1014,7 +1013,7 @@ LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 # gcc stupidly only outputs the basename of targets with -MM, but we need the
 # full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
 
 # find source path
 source_path="`dirname \"$0\"`"
@@ -1112,7 +1111,7 @@ for opt do
     --help|-h) show_help
     ;;
     *)
-    optname="${opt%=*}"
+    optname="${opt%%=*}"
     optname="${optname#--}"
     optname=$(echo "$optname" | sed 's/-/_/g')
     is_in $optname $CMDLINE_SET || die_unknown $opt
@@ -1126,13 +1125,15 @@ disabled logging && logfile=/dev/null
 echo "# $0 $@" > $logfile
 set >> $logfile
 
-cc="${cross_prefix}${cc}"
+cc_default="${cross_prefix}${cc_default}"
 yasmexe="${cross_prefix}${yasmexe}"
 ar="${cross_prefix}${ar}"
 nm="${cross_prefix}${nm}"
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
+set_default cc
+
 # set temporary file name
 if test ! -z "$TMPDIR" ; then
     TMPDIR1="${TMPDIR}"
@@ -1522,6 +1523,9 @@ if test $cpu != "generic"; then
             add_cflags "-mcpu=$cpu"
             enable fast_unaligned
         ;;
+        armv*)
+            add_cflags "-march=$cpu"
+        ;;
         arm*)
             add_cflags "-mcpu=$cpu"
         ;;
@@ -1723,7 +1727,7 @@ done
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
 enabled libamr_nb  && require  libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
 enabled libamr_wb  && require  libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
-enabled libdirac   && add_cflags "$(pkg-config --cflags dirac)" &&
+enabled libdirac   && add_cflags $(pkg-config --cflags dirac) &&
                       require  libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
                       require  libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
@@ -1733,10 +1737,12 @@ enabled libmp3lame && require  LAME lame/lame.h lame_init -lmp3lame -lm
 enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
 enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
                            require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
+enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
 enabled libtheora  && require  libtheora theora/theora.h theora_info_init -ltheora -logg
 enabled libvorbis  && require  libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
 enabled libx264    && require  x264 x264.h x264_encoder_open -lx264 -lm &&
-                      require_cpp_condition x264 x264.h "X264_BUILD >= 65"
+                      { check_cpp_condition x264.h "X264_BUILD >= 65" ||
+                        die "ERROR: libx264 version must be >= 0.65."; }
 enabled libxvid    && require  Xvid xvid.h xvid_global -lxvidcore
 enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
 
@@ -2038,6 +2044,7 @@ echo "libgsm enabled            ${libgsm-no}"
 echo "libmp3lame enabled        ${libmp3lame-no}"
 echo "libnut enabled            ${libnut-no}"
 echo "libschroedinger enabled   ${libschroedinger-no}"
+echo "libspeex enabled          ${libspeex-no}"
 echo "libtheora enabled         ${libtheora-no}"
 echo "libvorbis enabled         ${libvorbis-no}"
 echo "libx264 enabled           ${libx264-no}"