echo " --disable-shared do not build shared libraries [default=yes]"
echo " --enable-gpl allow use of GPL code, the resulting libav*"
echo " and ffmpeg will be under GPL [default=no]"
- echo " --enable-pp enable GPLed postprocessing support [default=no]"
- echo " --enable-swscaler software scaler support [default=no]"
+ echo " --enable-nonfree allow use of nonfree code, the resulting libav*"
+ echo " and ffmpeg will be unredistributable [default=no]"
+ echo " --enable-postproc enable GPLed postprocessing support [default=no]"
+ echo " --enable-swscale software scaler support [default=no]"
+ echo " --enable-avfilter video filter support (replaces vhook) [default=no]"
+ echo " --enable-avfilter-lavf video filters dependant on avformat [default=no]"
echo " --enable-beosthreads use BeOS threads [default=no]"
echo " --enable-os2threads use OS/2 threads [default=no]"
echo " --enable-pthreads use pthreads [default=no]"
echo " --disable-ffserver disable ffserver build"
echo " --disable-ffplay disable ffplay build"
echo " --enable-small optimize for size instead of speed"
+ echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
echo " --disable-encoder=NAME disables encoder NAME"
echo " --enable-encoder=NAME enables encoder NAME"
cat <<EOF
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
-ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
+ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
EOF
if enabled logging; then
cat <<EOF
exit 1
}
-# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
+# Avoid locale weirdness, besides we really just want to translate ASCII.
toupper(){
- echo "$@" | tr '[a-z]' '[A-Z]'
+ echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
tolower(){
- echo "$@" | tr '[A-Z]' '[a-z]'
+ echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
}
set_all(){
done
check_ld "$@" <<EOF && enable $func
$incs
-int main(void){
+int main(int argc, char **argv){
(void) $func;
return 0;
}
decoders
demuxers
encoders
+ filters
indevs
muxers
outdevs
CONFIG_LIST="
$COMPONENT_LIST
+ avfilter
+ avfilter_lavf
avisynth
beos_netserver
ffmpeg
gpl
gprof
gray
+ hardcoded_tables
ipv6
liba52
liba52bin
- libamr
libamr_nb
libamr_wb
libdc1394
memalign_hack
mpegaudio_hp
network
+ nonfree
+ postproc
powerpc_perf
- pp
small
- swscaler
+ swscale
vhook
x11grab
zlib
iwmmxt
mmi
mmx
+ mmx2
ssse3
vis
'
$THREADS_LIST
altivec_h
arpa_inet_h
+ bswap
byteswap_h
closesocket
cmov
getrusage
imlib2
inet_aton
+ inline_asm
+ libdc1394_1
+ libdc1394_2
llrint
lrint
lrintf
sdl_video_size
socklen_t
soundcard_h
- sys_poll_h
+ poll_h
+ sys_mman_h
sys_select_h
sys_soundcard_h
termios_h
iwmmxt_deps="armv4l"
mmi_deps="mips"
mmx_deps="x86"
+mmx2_deps="x86"
ssse3_deps="x86"
vis_deps="sparc"
dxa_decoder_deps="zlib"
flashsv_decoder_deps="zlib"
flashsv_encoder_deps="zlib"
-flv_decoder_deps="h263_decoder"
-h263_decoder_deps="h263_parser mpeg4video_parser"
-h263i_decoder_deps="h263_decoder"
-h264_decoder_deps="h264_parser"
mpeg_xvmc_decoder_deps="xvmc"
-mpeg4_decoder_deps="h263_decoder"
-msmpeg4v1_decoder_deps="h263_decoder"
-msmpeg4v2_decoder_deps="h263_decoder"
-msmpeg4v3_decoder_deps="h263_decoder"
png_decoder_deps="zlib"
png_encoder_deps="zlib"
-svq3_decoder_deps="h264_parser"
-vc1_decoder_deps="h263_decoder"
-wmv1_decoder_deps="h263_decoder"
-wmv2_decoder_deps="h263_decoder"
-wmv3_decoder_deps="h263_decoder"
zmbv_decoder_deps="zlib"
zmbv_encoder_deps="zlib"
oss_demuxer_deps_any="soundcard_h sys_soundcard_h"
oss_muxer_deps_any="soundcard_h sys_soundcard_h"
redir_demuxer_deps="network"
-rtp_muxer_deps="network mpegts_demuxer rtp_protocol"
+rtp_muxer_deps="network rtp_protocol"
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
v4l2_demuxer_deps="linux_videodev2_h"
v4l_demuxer_deps="linux_videodev_h"
+vfwcap_demuxer_deps="capCreateCaptureWindow"
+vfwcap_demuxer_extralibs="-lvfw32"
x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
x11_grab_device_demuxer_extralibs="-lX11 -lXext"
tcp_protocol_deps="network"
udp_protocol_deps="network"
+# filters
+movie_filter_deps="avfilter_lavf"
+
# programs
ffplay_deps="sdl"
ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
PREFIX="/usr/local"
libdir='$(PREFIX)/lib'
shlibdir="$libdir"
-incdir='$(PREFIX)/include/ffmpeg'
+incdir='$(PREFIX)/include'
mandir='$(PREFIX)/share/man'
bindir='$(PREFIX)/bin'
# toolchain
cc="gcc"
ar="ar"
+nm="nm"
ranlib="ranlib"
make="make"
strip="strip"
VHOOKSHFLAGS='$(SHFLAGS)'
LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
FFSERVERLDFLAGS=-Wl,-E
-LDCONFIG="ldconfig"
LIBPREF="lib"
LIBSUF=".a"
FULLNAME='$(NAME)$(BUILDSUF)'
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,"'
+
# find source path
source_path="`dirname \"$0\"`"
enable source_path_used
FFMPEG_CONFIGURATION="$@"
-ENCODER_LIST=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
-DECODER_LIST=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
-PARSER_LIST=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
-BSF_LIST=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' "$source_path/libavcodec/allcodecs.c"`
-MUXER_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
-DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
-OUTDEV_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavdevice/alldevices.c"`
-INDEV_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavdevice/alldevices.c"`
-PROTOCOL_LIST=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' "$source_path/libavformat/allformats.c"`
+find_things(){
+ thing=$1
+ pattern=$2
+ file=$source_path/$3
+ sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
+}
+
+ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
+DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
+PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
+BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
+MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
+DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
+OUTDEV_LIST=$(find_things muxer _MUX libavdevice/alldevices.c)
+INDEV_LIST=$(find_things demuxer DEMUX libavdevice/alldevices.c)
+PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
+FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
enable $ARCH_EXT_LIST \
$DECODER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
+ $FILTER_LIST \
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
;;
--disable-strip) disable dostrip
;;
- --disable-encoders) disable $ENCODER_LIST
- ;;
- --disable-decoders) disable $DECODER_LIST
- ;;
- --disable-muxers) disable $MUXER_LIST
- ;;
- --disable-demuxers) disable $DEMUXER_LIST
- ;;
- --disable-parsers) disable $PARSER_LIST
- ;;
- --disable-bsfs) disable $BSF_LIST
- ;;
- --disable-protocols) disable $PROTOCOL_LIST
- ;;
--disable-devices) disable $INDEV_LIST $OUTDEV_LIST
;;
+ --enable-debug=*) debuglevel="$optval"
+ ;;
--enable-*=*|--disable-*=*)
eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
case "$thing" in
- encoder|decoder|muxer|demuxer|parser|bsf|protocol) $action ${optval}_${thing} ;;
+ encoder|decoder|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
- echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
- $action $option
+ if is_in $option $COMPONENT_LIST; then
+ eval $action \$$(toupper ${option%s})_LIST
+ elif is_in $option $CMDLINE_SELECT; then
+ $action $option
+ else
+ die_unknown $opt
+ fi
;;
--list-*)
NAME="${opt#--list-}"
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 [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
+ if ! echo $CFLAGS | grep -q -- -m32; then
arch="x86_64"
enable fast_64bit
fi
add_cflags "-fno-expensive-optimizations"
;;
esac
- LDCONFIG="echo ignoring ldconfig"
SHFLAGS=-nostart
# enable BeOS things
enable audio_beos
# no need for libm, but the inet stuff
# Check for BONE
# XXX: actually should check for NOT net_server
- if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
+ if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
network_extralibs="-lbind -lsocket"
else
enable beos_netserver
openbsd)
disable need_memalign
LIBOBJFLAGS='$(PIC)'
- LDCONFIG='ldconfig -m $(SHLIBDIR)'
SHFLAGS='-shared'
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
SLIBNAME_WITH_VERSION='$(SLIBNAME)'
;;
darwin)
disable need_memalign
- SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) -Wl,-read_only_relocs,suppress'
+ 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/$@'
strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
shlibdir="$bindir"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
- if enabled swscaler; then
+ if enabled swscale; then
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
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)'
- if enabled swscaler; then
+ if enabled swscale; then
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
SHFLAGS='-shared -Wl,--enable-auto-image-base'
;;
*-dos|freedos|opendos)
- enable memalign_hack
disable ffplay ffserver vhook
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket"
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_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
- vhook="no"
+ disable vhook
+ ;;
+ interix)
+ disable vhook
;;
*)
test -n "$cross_prefix" && enable cross_compile
cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
+nm="${cross_prefix}${nm}"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
shift
enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
}
- die_gpl_disabled "The Postprocessing code" pp
+ 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
die_gpl_disabled "The X11 grabber" x11grab
- die_gpl_disabled "The software scaler" swscaler
+ die_gpl_disabled "The software scaler" swscale
+fi
+
+if ! enabled nonfree && enabled_any libamr_nb libamr_wb; then
+ die "libamr is nonfree and --enable-nonfree is not specified."
fi
check_deps $ARCH_EXT_LIST
#Darwin CC versions
if test $targetos = darwin; then
- if test -n "`$cc -v 2>&1 | grep xlc`"; then
+ if $cc -v 2>&1 | grep -q xlc; then
add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else
- add_cflags "-no-cpp-precomp -pipe"
+ add_cflags "-pipe"
check_cflags "-force_cpusubtype_ALL"
check_cflags "-Wno-sign-compare"
- disabled shared && add_cflags -mdynamic-no-pic
+ enabled shared || add_cflags -mdynamic-no-pic
fi
fi
enable fast_cmov
;;
# targets that do support conditional mov but on which it's slow
- pentium4|prescott|nocona)
+ pentium4|pentium4m|prescott|nocona)
add_cflags "-march=$cpu"
enable cmov
disable fast_cmov
sparc64)
add_cflags "-mcpu=v9"
;;
- bf*) #bf531 bf532 bf533 bf561 bf5xx all get this config
- add_cflags "-mfdpic"
- add_ldflags "-mfdpic"
- ;;
arm*)
add_cflags "-mcpu=$cpu"
;;
die "C compiler test failed."
fi
+check_cc <<EOF || die "Symbol mangling check failed."
+int ff_extern;
+EOF
+sym=$($nm -P -g $TMPO)
+extern_prefix=${sym%%ff_extern*}
+
+check_asm inline_asm '""'
+
if enabled x86; then
# check whether EBP is available on x86
# As 'i' is stored on the stack, this program will crash
# check wether EBX is available on x86
check_asm ebx_available '"":::"%ebx"'
- # check whether binutils is new enough to compile SSSE3
+ # check whether binutils is new enough to compile SSSE3/MMX2
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
+ enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"'
+
+ check_asm bswap '"bswap %%eax" ::: "%eax"'
fi
# check for assembler specific support
# AltiVec flags: The FSF version of GCC differs from the Apple version
if enabled altivec; then
- test -n "`$cc -v 2>&1 | grep version | grep Apple`" &&
- add_cflags "-faltivec" ||
- add_cflags "-maltivec -mabi=altivec"
-
- check_header altivec.h
+ check_cflags -maltivec -mabi=altivec &&
+ check_header altivec.h ||
+ check_cflags -faltivec
# check if our compiler supports Motorola AltiVec C API
enabled altivec_h &&
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
-grep -q BIGE $TMPO && enable bigendian
+od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
# ---
# check availability of some header files
check_func fork
check_func gethrtime
check_func getrusage
-check_func inet_aton
+check_func inet_aton $network_extralibs
check_func memalign
check_func mkstemp
check_func2 windows.h GetProcessTimes
check_header conio.h
check_header dlfcn.h
check_header malloc.h
+check_header sys/mman.h
check_header termios.h
if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
# ffserver uses poll(),
# if it's not found we can emulate it using select().
if enabled ffserver; then
- check_header sys/poll.h
+ check_header poll.h
check_header sys/select.h
fi
:
elif check_func pthread_create -pthread; then
add_cflags -pthread
- add_ldflags -pthread
+ add_extralibs -pthread
elif check_func pthread_create -pthreads; then
add_cflags -pthreads
- add_ldflags -pthreads
+ add_extralibs -pthreads
elif ! check_lib pthread.h pthread_create -lpthread; then
die "ERROR: can't find pthreads library"
fi
EOF
done
-enabled_any libamr_nb libamr_wb && enable libamr
-
# 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 libdc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
enabled libgsm && require libgsm gsm.h gsm_create -lgsm
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
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
+enabled libx264 && require x264 x264.h x264_encoder_open -lx264 -lm
enabled libxvid && require Xvid xvid.h xvid_global -lxvidcore
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
# disable the native AC-3 decoder if liba52 is enabled
enabled liba52 && disable ac3_decoder
+# libdc1394 check
+if enabled libdc1394; then
+ { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
+ enable libdc1394_2; } ||
+ { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
+ enable libdc1394_1; } ||
+ die "ERROR: No version of libdc1394 found "
+fi
+
+
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_cc <<EOF && _restrict=$restrict_keyword && break
sdl_cflags=`"${SDL_CONFIG}" --cflags`
temp_cflags $sdl_cflags
temp_extralibs `"${SDL_CONFIG}" --libs`
- if check_lib SDL.h SDL_Init; then
+ if check_lib2 SDL.h SDL_Init; then
_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
enable sdl_too_old
enable sdl
check_cc $sdl_cflags <<EOF && enable sdl_video_size
#include <SDL.h>
-int main(void){
+int main(int argc, char **argv){
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
int w = vi->current_w;
return 0;
check_header linux/videodev.h
check_header linux/videodev2.h
+check_func2 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
+
# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
{ check_header dev/bktr/ioctl_meteor.h &&
check_header dev/bktr/ioctl_bt848.h; } ||
check_func XOpenDisplay -lX11 &&
check_func XShmCreateImage -lX11 -lXext
-enabled debug && add_cflags -g
+enabled debug && add_cflags -g"$debuglevel"
# add some useful compiler flags if supported
check_cflags -Wdeclaration-after-statement
check_cflags -Wpointer-arith
check_cflags -Wredundant-decls
check_cflags -Wno-pointer-sign
+check_cflags -Wcast-qual
+check_cflags -Wwrite-strings
+check_cflags -Wtype-limits
enabled extra_warnings && check_cflags -Winline
# add some linker flags
check_cflags -Os # not all compilers support -Os
optimizations="small"
elif enabled optimizations; then
- if test -n "`$cc -v 2>&1 | grep xlc`"; then
+ if $cc -v 2>&1 | grep -q xlc; then
add_cflags "-O5"
add_ldflags "-O5"
else
add_cflags "-O3"
fi
fi
+check_cflags -fno-math-errno
+check_cflags -fno-signed-zeros
# PIC flags for shared library objects where they are needed
if enabled shared; then
enabled_any $BSF_LIST && enable bsfs
enabled_any $DEMUXER_LIST && enable demuxers
enabled_any $MUXER_LIST && enable muxers
+enabled_any $FILTER_LIST && enable filters
enabled_any $INDEV_LIST && enable demuxers
enabled_any $OUTDEV_LIST && enable muxers
enabled_any $PROTOCOL_LIST && enable protocols
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
+ $FILTER_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
$PROTOCOL_LIST \
echo "optimizations ${optimizations-no}"
echo "static ${static-no}"
echo "shared ${shared-no}"
-echo "postprocessing support ${pp-no}"
-echo "software scaler enabled ${swscaler-no}"
+echo "postprocessing support ${postproc-no}"
+echo "software scaler enabled ${swscale-no}"
+echo "new filter support ${avfilter-no}"
+echo "filters using lavformat ${avfilter_lavf-no}"
echo "video hooking ${vhook-no}"
if enabled vhook; then
echo "Imlib2 support ${imlib2-no}"
echo "x264 enabled ${libx264-no}"
echo "XviD enabled ${libxvid-no}"
echo "zlib enabled ${zlib-no}"
-enabled gpl &&
- echo "License: GPL" ||
- echo "License: LGPL"
+echo
-for type in decoder encoder parser demuxer muxer protocol bsf indev outdev; do
+for type in decoder encoder parser demuxer muxer protocol filter bsf indev outdev; do
echo "Enabled ${type}s:"
- ucname="\$`toupper $type`_LIST"
- list="`eval echo $ucname`"
- partlist=""
+ eval list=\$$(toupper $type)_LIST
for part in $list; do
- enabled $part && partlist="$partlist $part"
- done
- partlist=`echo $partlist | sed s/_$type//g | tr ' ' '\n' | sort`
- echo $partlist
+ enabled $part && echo ${part%_*}
+ done | sort | pr -3 -t
+ echo
done
+enabled nonfree &&
+ echo "License: unredistributable" ||
+ (enabled gpl &&
+ echo "License: GPL" ||
+ echo "License: LGPL")
+
echo "Creating config.mak and config.h..."
echo "# Automatically generated by configure - do not modify!" > config.mak
echo "CC=$cc" >> config.mak
echo "AR=$ar" >> config.mak
echo "RANLIB=$ranlib" >> config.mak
-echo "LDCONFIG=$LDCONFIG" >> config.mak
echo "LN_S=$ln_s" >> config.mak
enabled dostrip &&
echo "STRIP=$strip" >> config.mak ||
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
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
fi
-if enabled mmx; then
- echo "#define __CPU__ 586" >> $TMPH
-fi
if enabled sdl; then
echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
echo "BUILD_DOC=yes" >> config.mak
fi
-sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
-pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
-lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
-lavd_version=`grep '#define LIBAVDEVICE_VERSION ' "$source_path/libavdevice/avdevice.h" | sed 's/[^0-9\.]//g'`
-lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
-lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
-
+get_version(){
+ name=$1
+ file=$source_path/$2
+ eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
+ eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
+ lcname=$(tolower $name)
+ eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
+ eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
+}
+get_version LIBSWSCALE libswscale/swscale.h
+get_version LIBPOSTPROC libpostproc/postprocess.h
+get_version LIBAVCODEC libavcodec/avcodec.h
+get_version LIBAVDEVICE libavdevice/avdevice.h
+get_version LIBAVFORMAT libavformat/avformat.h
+get_version LIBAVUTIL libavutil/avutil.h
+get_version LIBAVFILTER libavfilter/avfilter.h
if enabled shared; then
echo "BUILD_SHARED=yes" >> config.mak
echo "PIC=-fPIC -DPIC" >> config.mak
- echo "SPPMAJOR=${pp_version%%.*}" >> config.mak
- echo "SPPVERSION=$pp_version" >> config.mak
- echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
- echo "LAVCVERSION=$lavc_version" >> config.mak
- echo "LAVDMAJOR=${lavd_version%%.*}" >> config.mak
- echo "LAVDVERSION=$lavd_version" >> config.mak
- echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
- echo "LAVFVERSION=$lavf_version" >> config.mak
- echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
- echo "LAVUVERSION=$lavu_version" >> config.mak
- echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
- echo "SWSVERSION=$sws_version" >> 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
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
+ $FILTER_LIST \
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
+echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
-# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
+# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
cmp -s $TMPH config.h &&
echo "config.h is unchanged" ||
mv -f $TMPH config.h
libavcodec/sh4 \
libavcodec/sparc \
libavdevice \
+ libavfilter \
libavformat \
libavutil \
libpostproc \
doc/texi2pod.pl \
libavcodec/Makefile \
libavdevice/Makefile \
+ libavfilter/Makefile \
libavformat/Makefile \
libavutil/Makefile \
libpostproc/Makefile \
version=$3
libs=$4
requires=$5
-include=$6
cat <<EOF >$name.pc
prefix=$PREFIX
exec_prefix=\${prefix}
Requires: $requires
Conflicts:
Libs: -L\${libdir} $libs
-Cflags: -I\${includedir}/$include
+Cflags: -I\${includedir}
EOF
}
prefix=
exec_prefix=
libdir=\${pcfiledir}/$name
-includedir=\${pcfiledir}/$name
+includedir=\${pcfiledir}
Name: $name
Description: $comment
EOF
}
-pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil "" ffmpeg
-pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version"
+pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" -lavutil ""
+pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
-pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version" ffmpeg
-pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version"
+pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "-lavcodec $extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
+pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version" ffmpeg
-pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version"
+pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "-lavformat $extralibs" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
+pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "FFmpeg device handling library" "$lavd_version" "-lavdevice $extralibs" "$pkg_requires libavformat = $lavf_version" ffmpeg
-pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$lavd_version" "$extralibs" "$pkg_requires libavformat = $lavf_version"
-if enabled pp; then
- pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc "" postproc
- pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$pp_version"
+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "-lavdevice $extralibs" "$pkg_requires libavformat = $LIBAVFORMAT_VERSION"
+pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$pkg_requires libavformat = $LIBAVFORMAT_VERSION"
+if enabled postproc; then
+ pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION" -lpostproc ""
+ pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
fi
-if enabled swscaler; then
- pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" -lswscale "libavutil = $lavu_version" ffmpeg
- pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "libavutil = $lavu_version"
+if enabled swscale; then
+ pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" -lswscale "libavutil = $LIBAVUTIL_VERSION"
+ pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
else
- pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version" ffmpeg
- pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version"
+ pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
+ pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
apply libswscale.pc sed s/^Libs:.*$/Libs:/
apply libswscale-uninstalled.pc sed s/^Libs:.*$/Libs:/
fi
+
+if enabled avfilter; then
+ pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "-lavfilter $extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION" ffmpeg
+ pkgconfig_generate_uninstalled libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
+fi