]> git.sesse.net Git - ffmpeg/blobdiff - configure
cosmetics: typo
[ffmpeg] / configure
index 52e8f9f0c8105061f5e90f31c784582f589a2fa8..86394e9d3d9de5949c2d4000d339c37545bd85df 100755 (executable)
--- a/configure
+++ b/configure
 
 try_exec(){
     echo "Trying shell $1"
-    type "$1" >/dev/null 2>&1 && exec "$@"
+    type "$1" > /dev/null 2>&1 && exec "$@"
 }
 
 unset foo
-(: ${foo%%bar}) 2>/dev/null
+(: ${foo%%bar}) 2> /dev/null
 E1="$?"
 
-(: ${foo?}) 2>/dev/null
+(: ${foo?}) 2> /dev/null
 E2="$?"
 
 if test "$E1" != 0 || test "$E2" = 0; then
@@ -132,6 +132,7 @@ show_help(){
   echo "  --disable-network        disable network support [default=no]"
   echo "  --disable-ipv6           disable ipv6 support [default=no]"
   echo "  --disable-zlib           disable zlib [default=no]"
+  echo "  --disable-bzlib          disable bzlib [default=no]"
   echo "  --disable-vhook          disable video hooking support"
   echo "  --disable-debug          disable debugging symbols"
   echo "  --disable-mpegaudio-hp   faster (but less accurate)"
@@ -186,12 +187,12 @@ show_help(){
 }
 
 log(){
-    echo "$@" >>$logfile
+    echo "$@" >> $logfile
 }
 
 log_file(){
     log BEGIN $1
-    pr -n -t $1 >>$logfile
+    pr -n -t $1 >> $logfile
     log END $1
 }
 
@@ -350,7 +351,7 @@ print_config(){
 }
 
 flags_saved(){
-    (: ${SAVE_CFLAGS?}) 2>/dev/null
+    (: ${SAVE_CFLAGS?}) 2> /dev/null
 }
 
 save_flags(){
@@ -406,19 +407,19 @@ add_extralibs(){
 
 check_cmd(){
     log "$@"
-    "$@" >>$logfile 2>&1
+    "$@" >> $logfile 2>&1
 }
 
 check_cc(){
     log check_cc "$@"
-    cat >$TMPC
+    cat > $TMPC
     log_file $TMPC
     check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
 }
 
 check_cpp(){
     log check_cpp "$@"
-    cat >$TMPC
+    cat > $TMPC
     log_file $TMPC
     check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
 }
@@ -526,7 +527,7 @@ check_lib2(){
 }
 
 check_exec(){
-    check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; }
+    check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
 }
 
 check_exec_crash(){
@@ -538,7 +539,7 @@ check_exec_crash(){
     # can redirect the "Terminated" message from the shell.  SIGBUS
     # is not defined by standard C so it is used conditionally.
 
-    (check_exec "$@") >>$logfile 2>&1 <<EOF
+    (check_exec "$@") >> $logfile 2>&1 <<EOF
 #include <signal.h>
 static void sighandler(int sig){
     raise(SIGTERM);
@@ -630,6 +631,7 @@ CONFIG_LIST="
     avfilter_lavf
     avisynth
     beos_netserver
+    bzlib
     ffmpeg
     ffplay
     ffserver
@@ -917,6 +919,7 @@ cpu="generic"
 target_os=$(tolower $(uname -s))
 
 # libraries
+enable bzlib
 enable zlib
 
 # configurable options
@@ -1057,12 +1060,102 @@ for opt do
     esac
 done
 
+disabled logging && logfile=/dev/null
+
+echo "# $0 $@" > $logfile
+set >> $logfile
+
 cc="${cross_prefix}${cc}"
 ar="${cross_prefix}${ar}"
 nm="${cross_prefix}${nm}"
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
+# set temporary file name
+if test ! -z "$TMPDIR" ; then
+    TMPDIR1="${TMPDIR}"
+elif test ! -z "$TEMPDIR" ; then
+    TMPDIR1="${TEMPDIR}"
+else
+    TMPDIR1="/tmp"
+fi
+
+TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
+TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
+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"
+
+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
+
 # OS specific
 case $target_os in
     beos|haiku|zeta)
@@ -1130,6 +1223,11 @@ case $target_os in
         ;;
     mingw32*)
         target_os=mingw32
+        LIBTARGET=i386
+        if test $arch = x86_64; then
+            disable need_memalign
+            LIBTARGET=x64
+        fi
         shlibdir="$bindir"
         VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
         VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
@@ -1143,8 +1241,9 @@ 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 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
+        SLIB_EXTRA_CMD='-lib /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
+        SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
+            install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(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'
         ;;
@@ -1211,99 +1310,8 @@ case $target_os in
         ;;
 esac
 
-# set temporary file name
-if test ! -z "$TMPDIR" ; then
-    TMPDIR1="${TMPDIR}"
-elif test ! -z "$TEMPDIR" ; then
-    TMPDIR1="${TEMPDIR}"
-else
-    TMPDIR1="/tmp"
-fi
-
-TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
-TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
-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
 
-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"
 
@@ -1445,11 +1453,11 @@ if test $cpu != "generic"; then
 fi
 
 # make sure we can execute files in $TMPDIR
-cat >$TMPSH 2>>$logfile <<EOF
+cat > $TMPSH 2>> $logfile <<EOF
 #! /bin/sh
 EOF
-chmod +x $TMPSH >>$logfile 2>&1
-if ! $TMPSH >>$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
@@ -1585,7 +1593,8 @@ if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
     die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
 fi
 
-enabled zlib && check_lib zlib.h zlibVersion -lz || disable zlib
+enabled  zlib && check_lib  zlib.h      zlibVersion -lz   || disable  zlib
+enabled bzlib && check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 
 # ffserver uses poll(),
 # if it's not found we can emulate it using select().
@@ -1645,7 +1654,7 @@ enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
 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 -lschroedinger-1.0 -lpthread -loil-0.3 -lm -lrt
+                        && require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
 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
@@ -1699,7 +1708,7 @@ check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType
 disable sdl_too_old
 disable sdl
 SDL_CONFIG="${cross_prefix}sdl-config"
-if "${SDL_CONFIG}" --version >/dev/null 2>&1; then
+if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
     sdl_cflags=`"${SDL_CONFIG}" --cflags`
     temp_cflags $sdl_cflags
     temp_extralibs `"${SDL_CONFIG}" --libs`
@@ -1722,7 +1731,7 @@ EOF
     restore_flags
 fi
 
-texi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2html
+texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
 
 check_type sys/socket.h socklen_t
 
@@ -1957,6 +1966,7 @@ echo "libvorbis enabled         ${libvorbis-no}"
 echo "x264 enabled              ${libx264-no}"
 echo "XviD enabled              ${libxvid-no}"
 echo "zlib enabled              ${zlib-no}"
+echo "bzlib enabled             ${bzlib-no}"
 echo
 
 for type in decoder encoder parser demuxer muxer protocol filter bsf indev outdev; do
@@ -1968,11 +1978,14 @@ for type in decoder encoder parser demuxer muxer protocol filter bsf indev outde
     echo
 done
 
-enabled nonfree &&
-    echo "License: unredistributable" ||
-    (enabled gpl &&
-        echo "License: GPL" ||
-        echo "License: LGPL")
+license="LGPL"
+if enabled nonfree; then
+    license="unredistributable"
+elif enabled gpl; then
+    license="GPL"
+fi
+
+echo "License: $license"
 
 echo "Creating config.mak and config.h..."
 
@@ -1998,7 +2011,7 @@ enabled stripping &&
     echo "STRIP=echo ignoring strip" >> config.mak
 
 echo "OPTFLAGS=$CFLAGS" >> config.mak
-echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
+echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak
 echo "LDFLAGS=$LDFLAGS" >> config.mak
 echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
 echo "SHFLAGS=$SHFLAGS" >> config.mak
@@ -2050,6 +2063,7 @@ get_version LIBAVFILTER libavfilter/avfilter.h
 if enabled shared; then
     echo "BUILD_SHARED=yes" >> config.mak
     echo "PIC=-fPIC -DPIC" >> config.mak
+    echo "LIBTARGET=${LIBTARGET}" >> config.mak
     echo "SLIBNAME=${SLIBNAME}" >> config.mak
     echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
     echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
@@ -2155,7 +2169,7 @@ comment=$2
 version=$3
 libs=$4
 requires=$5
-cat <<EOF >$name.pc
+cat <<EOF > $name.pc
 prefix=$prefix
 exec_prefix=\${prefix}
 libdir=$libdir
@@ -2170,7 +2184,7 @@ Libs: -L\${libdir} -l${shortname}
 Libs.private: $libs
 Cflags: -I\${includedir}
 EOF
-cat <<EOF >$name-uninstalled.pc
+cat <<EOF > $name-uninstalled.pc
 prefix=
 exec_prefix=
 libdir=\${pcfiledir}/$name