#
# FFmpeg configure script
#
-# Copyright (c) 2000, 2001, 2002 Fabrice Bellard
-# Copyright (c) 2005-2006 Diego Biurrun
-# Copyright (c) 2005-2006 Mans Rullgard
+# Copyright (c) 2000-2002 Fabrice Bellard
+# Copyright (c) 2005-2008 Diego Biurrun
+# Copyright (c) 2005-2008 Mans Rullgard
#
+# Prevent locale nonsense from breaking basic text processing.
+LC_ALL=C
+export LC_ALL
+
# make sure we are running under a compatible shell
# try to make this part work with most shells
echo
echo "External library support:"
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]"
echo " --enable-libamr-nb enable libamr-nb floating point audio codec"
echo " --enable-libamr-wb enable libamr-wb floating point audio codec"
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]"
+ echo " --extra-version=STRING version string suffix []"
echo " --build-suffix=SUFFIX suffix for application specific build []"
echo " --arch=ARCH select architecture [$arch]"
echo " --cpu=CPU selects the minimum cpu required (affects"
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)"
echo " MPEG audio decoding [default=no]"
echo " --enable-gray enable full grayscale support (slower color)"
echo " --disable-protocol=NAME disables protocol NAME"
echo " --disable-protocols disables all protocols"
echo " --disable-devices disables all devices"
+ echo " --enable-filter=NAME enables filter NAME"
+ echo " --disable-filter=NAME disables filter NAME"
+ echo " --disable-filters disables all filters"
echo " --list-decoders show all available decoders"
echo " --list-encoders show all available encoders"
echo " --list-muxers show all available muxers"
echo " --list-bsfs show all available bitstream filters"
echo " --list-indevs show all available input devices"
echo " --list-outdevs show all available output devices"
+ echo " --list-filters show all available filters"
echo
echo "Developer options (useful when working on FFmpeg itself):"
+ echo " --disable-debug disable debugging symbols"
+ echo " --enable-debug=LEVEL set the debug level [$debuglevel]"
echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-optimizations disable compiler optimizations"
echo " --enable-extra-warnings enable more compiler warnings"
echo " --disable-stripping disable stripping of executables and shared libraries"
echo ""
echo "NOTE: Object files are built at the place where configure is launched."
- exit 1
+ exit 0
}
log(){
EOF
}
+check_yasm(){
+ log check_yasm "$@"
+ echo "$1" > $TMPS
+ log_file $TMPS
+ shift 1
+ check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
+}
+
check_ld(){
log check_ld "$@"
check_cc || return
EOF
}
-check_func2(){
- log check_func2 "$@"
+check_func_headers(){
+ log check_func_headers "$@"
headers=$1
func=$2
shift 2
EOF
}
+check_cpp_condition(){
+ log check_cpp_condition "$@"
+ header=$1
+ condition=$2
+ check_cpp <<EOF
+#include <$header>
+#if !($condition)
+#error "unsatisfied condition: $condition"
+#endif
+EOF
+}
+
check_lib(){
log check_lib "$@"
header="$1"
func="$2"
shift 2
temp_extralibs "$@"
- check_func2 "$headers" $func && add_extralibs "$@"
+ check_func_headers "$headers" $func && add_extralibs "$@"
err=$?
restore_flags
return $err
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
"$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
}
+# CONFIG_LIST contains configurable options, while HAVE_LIST is for
+# system-dependent things.
+
COMPONENT_LIST="
bsfs
decoders
gray
hardcoded_tables
ipv6
- liba52
- liba52bin
libamr_nb
libamr_wb
libdc1394
$ARCH_EXT_LIST
$THREADS_LIST
altivec_h
- altivec_vector_braces
arpa_inet_h
bswap
- byteswap_h
closesocket
cmov
conio_h
dev_video_bktr_ioctl_bt848_h
dlfcn_h
dlopen
+ dos_paths
ebp_available
ebx_available
fast_64bit
sys_resource_h
sys_select_h
sys_soundcard_h
+ sys_videoio_h
termios_h
threads
winsock2_h
+ yasm
"
CMDLINE_SELECT="
cc
cpu
cross_prefix
+ extra_version
logfile
source_path
target_os
ssse3_deps="x86"
vis_deps="sparc"
-# system headers and functions
-byteswap_h_deps="!armv4l"
-
# decoders / encoders
-ac3_decoder_deps="gpl !liba52"
+ac3_decoder_deps="gpl"
dxa_decoder_deps="zlib"
+eac3_decoder_deps="gpl"
flashsv_decoder_deps="zlib"
flashsv_encoder_deps="zlib"
mlp_decoder_deps="mlp_parser"
zmbv_encoder_deps="zlib"
# external libraries
-liba52_decoder_deps="liba52"
-liba52bin_decoder_extralibs='$ldl'
libamr_nb_decoder_deps="libamr_nb"
libamr_nb_encoder_deps="libamr_nb"
libamr_wb_decoder_deps="libamr_wb"
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
v4l_demuxer_deps="linux_videodev_h"
-v4l2_demuxer_deps="linux_videodev2_h"
+v4l2_demuxer_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_demuxer_deps="capCreateCaptureWindow"
vfwcap_demuxer_extralibs="-lvfw32"
x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
# toolchain
cc="gcc"
+yasmexe="yasm"
ar="ar"
nm="nm"
ranlib="ranlib"
strip="strip"
asmalign_pot="unknown"
ln_s="ln -sf"
+objformat="elf"
# machine
arch=`uname -m`
vhook="default"
# build settings
+add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
SHFLAGS='-shared -Wl,-soname,$$(@F)'
VHOOKSHFLAGS='$(SHFLAGS)'
-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"
set >> $logfile
cc="${cross_prefix}${cc}"
+yasmexe="${cross_prefix}${yasmexe}"
ar="${cross_prefix}${ar}"
nm="${cross_prefix}${nm}"
ranlib="${cross_prefix}${ranlib}"
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
+check_cflags -fasm
+check_cflags -std=c99
+
case "$arch" in
i386|i486|i586|i686|i86pc|BePC)
arch="x86_32"
;;
"Power Macintosh"|ppc|powerpc)
arch="powerpc"
+ enable fast_unaligned
;;
ppc64)
arch="powerpc"
enable fast_64bit
+ enable fast_unaligned
;;
mips|mipsel|IP*)
arch="mips"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
FFSERVERLDFLAGS=-Wl,-bind_at_load
+ objformat="macho"
+ enabled x86_64 && objformat="macho64"
;;
mingw32*)
target_os=mingw32
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'
+ objformat="win32"
+ enable dos_paths
;;
cygwin*)
target_os=cygwin
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base'
+ objformat="win32"
+ enable dos_paths
;;
*-dos|freedos|opendos)
disable ffplay ffserver vhook
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket"
EXESUF=".exe"
+ objformat="win32"
+ enable dos_paths
;;
linux)
- LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
enable dv1394
;;
irix*)
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
+ enable dos_paths
;;
interix)
disable vhook
if enabled_any libfaad libfaadbin ; then
if check_header faad.h; then
- check_cc << EOF
+ check_cc <<EOF
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
}
die_gpl_disabled "The Postprocessing code" postproc
- die_gpl_disabled "liba52" liba52
die_gpl_disabled "libx264" libx264
die_gpl_disabled "libxvidcore" libxvid
die_gpl_disabled "FAAD2" libfaad2
sparc64)
add_cflags "-mcpu=v9"
;;
- arm*|cortex*)
+ arm11*|cortex*)
+ add_cflags "-mcpu=$cpu"
+ enable fast_unaligned
+ ;;
+ arm*)
add_cflags "-mcpu=$cpu"
;;
*)
enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"'
check_asm bswap '"bswap %%eax" ::: "%eax"'
+
+ YASMFLAGS="-f $objformat -DARCH_$(toupper $arch)"
+ enabled x86_64 && append YASMFLAGS "-m amd64"
+ enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
+ case "$objformat" in
+ elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
+ macho64) append YASMFLAGS "-DPIC -DPREFIX" ;;
+ *) append YASMFLAGS "-DPREFIX" ;;
+ esac
+ check_yasm "pabsw xmm0, xmm0" && enable yasm
fi
# check for assembler specific support
if test $arch = "powerpc"; then
-check_cc <<EOF && enable dcbzl
-int main(void) {
- register long zero = 0;
- char data[1024];
- asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
-return 0;
-}
-EOF
+ check_asm dcbzl '"dcbzl 0, 1"'
fi
# check for SIMD availability
EOF
# check if our compiler supports braces for vector declarations
- check_cc <<EOF && enable altivec_vector_braces
+ check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
$inc_altivec_h
-#define AVV(x...) {x}
-int main (void) { (vector int) AVV(1); return 0; }
+int main (void) { (vector int) {1}; return 0; }
EOF
fi
check_func inet_aton $network_extralibs
check_func memalign
check_func mkstemp
-check_func2 windows.h GetProcessTimes
+check_func_headers windows.h GetProcessTimes
-check_header byteswap.h
check_header conio.h
check_header dlfcn.h
check_header malloc.h
+check_header poll.h
check_header sys/mman.h
check_header sys/resource.h
+check_header sys/select.h
check_header termios.h
if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
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().
-if enabled ffserver; then
- check_header poll.h
- check_header sys/select.h
-fi
-
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if enabled pthreads; then
# test for C99 functions in math.h
for func in llrint lrint lrintf round roundf; do
check_exec <<EOF && enable $func || disable $func
-#define _ISOC9X_SOURCE 1
#include <math.h>
int main(void) { return ($func(3.999f) > 0)?0:1; }
EOF
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
-enabled liba52 && require liba52 a52dec/a52.h a52_init -la52
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)" \
&& 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
+enabled libx264 && require x264 x264.h x264_encoder_open -lx264 -lm \
+ && require_cpp_condition x264 x264.h "X264_BUILD >= 65"
enabled libxvid && require Xvid xvid.h xvid_global -lxvidcore
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
-check_type sys/socket.h socklen_t
-
##########################################
# Network check
if enabled network; then
+ check_type sys/socket.h socklen_t
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
elif check_header winsock2.h ; then
network_extralibs="-lws2_32"
check_type ws2tcpip.h socklen_t
- check_func2 winsock2.h closesocket
+ check_func_headers winsock2.h closesocket
fi
fi
check_header linux/videodev.h
check_header linux/videodev2.h
+check_header sys/videoio.h
-check_func2 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
+check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32
# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
{ check_header dev/bktr/ioctl_meteor.h &&
# add some linker flags
check_ldflags -Wl,--warn-common
-check_ldflags $LDLATEFLAGS
+check_ldflags -Wl,--as-needed
+check_ldflags '-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'
check_ldflags -Wl,-Bsymbolic
if enabled small; then
check_cflags -fno-signed-zeros
# add some flags for Intel C Compiler
-if $cc --version | grep -q Intel; then
+if $cc --version 2> /dev/null | grep -q Intel; then
# Just warnings, no remarks
check_cflags -w1
# -wd: Disable following warnings
# LIBOBJFLAGS may have already been set in the OS configuration
if test -z "$LIBOBJFLAGS" ; then
case "$arch" in
- x86_64|ia64|alpha|sparc*|power*|parisc*) LIBOBJFLAGS='$(PIC)' ;;
+ x86_64|ia64|alpha|sparc*|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;;
esac
fi
fi
if test "$build_suffix" != ""; then
echo "build suffix $build_suffix"
fi
+if test "$extra_version" != ""; then
+ echo "version string suffix $extra_version"
+fi
echo "big-endian ${bigendian-no}"
if test $arch = "x86_32" -o $arch = "x86_64"; then
+ echo "yasm ${yasm-no}"
echo "MMX enabled ${mmx-no}"
echo "CMOV enabled ${cmov-no}"
echo "CMOV is fast ${fast_cmov-no}"
fi
echo "Sun medialib support ${mlib-no}"
echo "AVISynth enabled ${avisynth-no}"
-echo "liba52 support ${liba52-no}"
-echo "liba52 dlopened ${liba52bin-no}"
echo "libamr-nb support ${libamr_nb-no}"
echo "libamr-wb support ${libamr_wb-no}"
echo "libdc1394 support ${libdc1394-no}"
echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
echo "CC=$cc" >> config.mak
+echo "YASM=$yasmexe" >> config.mak
echo "AR=$ar" >> config.mak
echo "RANLIB=$ranlib" >> config.mak
echo "LN_S=$ln_s" >> config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak
+echo "YASMFLAGS=$YASMFLAGS" >> config.mak
echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak
+echo "EXTRA_VERSION=$extra_version" >> config.mak
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
if enabled bigendian; then
# Apparently it's not possible to portably echo a backslash.
enabled asmalign_pot &&
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
- printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
+ printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
prefix=
exec_prefix=
libdir=\${pcfiledir}
-includedir=\${pcfiledir}/..
+includedir=${source_path}
Name: $name
Description: $comment