echo
echo "External library support:"
echo " --enable-sunmlib use Sun medialib [default=no]"
- echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
- echo " and libraw1394 [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 " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
+ echo " and libraw1394 [default=no]"
echo " --enable-libfaac enable FAAC support via libfaac [default=no]"
echo " --enable-libfaad enable FAAD support via libfaad [default=no]"
echo " --enable-libfaadbin open libfaad.so.0 at runtime [default=no]"
echo " --disable-v4l disable video4linux grabbing [default=no]"
echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
echo " --disable-bktr disable bktr video grabbing [default=no]"
- echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
echo " --disable-network disable network support [default=no]"
echo " --disable-ipv6 disable ipv6 support [default=no]"
echo " --disable-zlib disable zlib [default=no]"
done
}
+is_in(){
+ value=$1
+ shift
+ for var in $*; do
+ [ $var = $value ] && return 0
+ done
+ return 1
+}
+
check_deps(){
for cfg; do
enabled ${cfg}_checking && die "Circular dependency for $cfg."
"$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
}
-CONFIG_LIST='
- encoders
- decoders
- parsers
+COMPONENT_LIST="
bsfs
- muxers
+ decoders
demuxers
+ encoders
+ muxers
+ parsers
+ protocols
+"
+
+CONFIG_LIST="
+ $COMPONENT_LIST
audio_beos
audio_oss
avisynth
beos_netserver
bktr
- dc1394
- dv1394
ffmpeg
ffplay
ffserver
libamr
libamr_nb
libamr_wb
+ libdc1394
libfaac
libfaad
libfaadbin
network
powerpc_perf
pp
- protocols
small
swscaler
vhook
v4l2
x11grab
zlib
-'
+"
THREADS_LIST='
beosthreads
altivec_h
arpa_inet_h
byteswap_h
+ closesocket
cmov
conio_h
dcbzl
fast_unaligned
fork
freetype2
+ gethrtime
GetProcessTimes
getrusage
imlib2
sys_soundcard_h
termios_h
threads
+ winsock2_h
"
CMDLINE_SELECT="
ssse3_deps="x86"
# decoders / encoders
+ac3_decoder_deps="gpl"
dxa_decoder_deps="zlib"
flashsv_decoder_deps="zlib"
flashsv_encoder_deps="zlib"
ac3_demuxer_deps="ac3_parser"
audio_demuxer_deps_any="audio_oss audio_beos"
audio_muxer_deps_any="audio_oss audio_beos"
-dc1394_demuxer_deps="dc1394"
dv1394_demuxer_deps="dv1394"
+libdc1394_demuxer_deps="libdc1394"
libnut_demuxer_deps="libnut"
libnut_muxer_deps="libnut"
mp3_demuxer_deps="mpegaudio_parser"
# non-library system interfaces
audio_oss="yes"
bktr="yes"
-dv1394="yes"
v4l2="yes"
v4l="yes"
;;
--list-*)
NAME="${opt#--list-}"
+ is_in $NAME $COMPONENT_LIST || die_unknown $opt
NAME=$(toupper ${NAME%s})
eval show_list \$${NAME}_LIST
;;
esac
LDCONFIG="echo ignoring ldconfig"
SHFLAGS=-nostart
- # disable Linux things
- dv1394="no"
# enable BeOS things
disabled audio_beos || enable_audio_beos
# no need for libm, but the inet stuff
osextralibs="-lnet"
fi ;;
sunos)
- dv1394="no"
FFSERVERLDFLAGS=""
SHFLAGS="-shared -Wl,-h,\$@"
add_extralibs "-lsocket -lnsl"
;;
netbsd)
- dv1394="no"
add_extralibs "-lossaudio"
;;
openbsd)
- dv1394="no"
need_memalign="no"
LIBOBJFLAGS="\$(PIC)"
LDCONFIG="ldconfig -m \$(SHLIBDIR)"
add_extralibs "-lossaudio"
;;
freebsd)
- dv1394="no"
need_memalign="no"
add_cflags "-pthread"
;;
gnu/kfreebsd)
- dv1394="no"
add_cflags "-pthread"
;;
bsd/os)
- dv1394="no"
osextralibs="-lpoll -lgnugetopt -lm"
strip="strip -d"
;;
darwin)
- dv1394="no"
need_memalign="no"
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(SHLIBDIR)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress"
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$@'
mingw32*)
targetos=mingw32
shlibdir="$bindir"
- dv1394="no"
- VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libswscale -L$(BUILD_ROOT)/libavutil'
- VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lswscale$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
+ 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
+ VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
+ VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
+ fi
ffserver="no"
- network="no"
SLIBPREF=""
SLIBSUF=".dll"
EXESUF=".exe"
SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
SLIB_INSTALL_EXTRA_CMD="-install -m 644 \$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib) \"\$(SHLIBDIR)/\$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib)\""
SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base"
- enabled network && add_extralibs -lws2_32
;;
cygwin*)
targetos=cygwin
shlibdir="$bindir"
- dv1394="no"
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
;;
linux)
LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
+ dv1394="yes"
;;
irix*)
targetos=irix
strip="${cross_prefix}${strip}"
# we need to build at least one lib type
-if disabled_all static shared; then
+if ! enabled_any static shared; then
cat <<EOF
At least one library type must be built.
Specify --enable-static to build the static libraries or --enable-shared to
exit 1;
fi
-if disabled libogg; then
+if disabled static; then
+ LIB=""
+fi
+
+if ! enabled libogg; then
enabled libtheora && die "libogg must be enabled to enable libtheora."
enabled libvorbis && die "libogg must be enabled to enable libvorbis."
fi
fi
-if disabled gpl ; then
+if ! enabled gpl; then
die_gpl_disabled(){
name=$1
shift
test -z "$need_memalign" && need_memalign="$mmx"
#Darwin CC versions
-needmdynamicnopic="no"
if test $targetos = darwin; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
add_cflags "-no-cpp-precomp -pipe"
check_cflags "-force_cpusubtype_ALL"
check_cflags "-Wno-sign-compare"
- disabled shared && needmdynamicnopic="yes"
+ disabled shared && add_cflags -mdynamic-no-pic
fi
fi
-enabled needmdynamicnopic && add_cflags -mdynamic-no-pic
disabled optimize || add_cflags -fomit-frame-pointer
EOF
if test "$?" != 0; then
echo "$cc is unable to create an executable file."
- if test -z "$cross_prefix" && disabled cross_compile ; then
+ if test -z "$cross_prefix" && ! enabled cross_compile ; then
echo "If $cc is a cross-compiler, use the --cross-compile option."
echo "Only do this if you know what cross compiling means."
fi
# ---
# big/little-endian test
-if disabled cross_compile; then
- check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
-#include <inttypes.h>
-int main(int argc, char ** argv){
- volatile uint32_t i=0x01234567;
- return (*((uint8_t*)(&i))) == 0x67;
-}
+check_cc <<EOF || die "endian test failed"
+unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
-else
- # programs cannot be launched if cross compiling, so make a static guess
- if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
- bigendian="yes"
- fi
-fi
+grep -q BIGE $TMPO && enable bigendian
# ---
# check availability of some header files
check_header malloc.h
check_func memalign
-if disabled_all memalign memalign_hack && enabled need_memalign ; then
+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
check_header byteswap.h
check_func mkstemp
+check_func gethrtime
check_header termios.h
check_header conio.h
-check_header arpa/inet.h
-
check_func inet_aton
enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
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 libgsm && require libgsm gsm.h gsm_create -lgsm
enabled libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
enabled libx264 && require x264 x264.h x264_encoder_open -lx264
enabled libxvid && require Xvid xvid.h xvid_global -lxvidcore
-enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
+# disable the native AC-3 decoder if liba52 is enabled
+enabled liba52 && disable ac3_decoder
+
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_cc <<EOF && _restrict=$restrict_keyword && break
texi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2html
+##########################################
+# Network check
+
+if enabled network; then
+ # Prefer arpa/inet.h over winsock2
+ if check_header arpa/inet.h ; then
+ check_func closesocket
+ elif check_header winsock2.h ; then
+ add_extralibs -lws2_32
+ check_func2 winsock2.h closesocket
+ fi
+fi
+
##########################################
# IPv6 check
check_deps $CONFIG_LIST $HAVE_LIST $DECODER_LIST $ENCODER_LIST $PARSER_LIST \
$BSF_LIST $DEMUXER_LIST $MUXER_LIST $PROTOCOL_LIST
+enabled libdc1394 && append pkg_requires "libraw1394"
enabled libogg && append pkg_requires "ogg >= 1.1"
enabled libtheora && append pkg_requires "theora"
enabled libvorbis && append pkg_requires "vorbis vorbisenc"
-enabled dc1394 && append pkg_requires "libraw1394"
echo "install prefix $PREFIX"
echo "source path $source_path"
echo "MMX enabled ${mmx-no}"
echo "CMOV enabled ${cmov-no}"
echo "CMOV is fast ${fast_cmov-no}"
+ echo "EBX available ${ebx_available-no}"
+ echo "EBP available ${ebp_available-no}"
fi
if test $arch = "armv4l"; then
echo "ARMv5TE enabled ${armv5te-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 "libfaac enabled ${libfaac-no}"
echo "libfaad enabled ${libfaad-no}"
echo "libfaad dlopened ${libfaadbin-no}"
echo "x264 enabled ${libx264-no}"
echo "XviD enabled ${libxvid-no}"
echo "zlib enabled ${zlib-no}"
-if disabled gpl; then
+if ! enabled gpl; then
echo "License: LGPL"
else
echo "License: GPL"
echo "BUILDSUF=$BUILDSUF" >> config.mak
echo "LIBPREF=$LIBPREF" >> config.mak
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
-if enabled static; then
- echo "LIB=$LIB" >> config.mak
-else # Some Make complain if this variable does not exist.
- echo "LIB=" >> config.mak
-fi
+echo "LIB=$LIB" >> config.mak
echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
$MUXER_LIST \
$PROTOCOL_LIST \
-if test "$targetos" = darwin; then
- echo "#define CONFIG_DARWIN 1" >> $TMPH
-fi
-
echo "#define restrict $_restrict" >> $TMPH
if enabled small; then
- echo "#define always_inline" >> $TMPH
+ echo "#define av_always_inline" >> $TMPH
fi
echo "SRC_PATH=\"$source_path\"" >> config.mak
if enabled source_path_used; then
DIRS="\
doc \
- libavformat \
libavcodec \
libavcodec/alpha \
libavcodec/armv4l \
libavcodec/bfin \
libavcodec/i386 \
- libavcodec/sparc \
libavcodec/mlib \
libavcodec/ppc \
- libpostproc \
+ libavcodec/sh4 \
+ libavcodec/sparc \
+ libavformat \
libavutil \
+ libpostproc \
libswscale \
tests \
tools \
FILES="\
Makefile \
common.mak \
- libavformat/Makefile \
+ doc/texi2pod.pl \
libavcodec/Makefile \
- libpostproc/Makefile \
+ libavformat/Makefile \
libavutil/Makefile \
+ libpostproc/Makefile \
libswscale/Makefile \
- doc/texi2pod.pl \
"
for dir in $DIRS ; do
mkdir -p $dir