Newer
Older
#include <netdb.h>
Diego Biurrun
committed
struct sockaddr_storage saddr;
struct ipv6_mreq mreq6;
getaddrinfo(0,0,0,0);
getnameinfo(0,0,0,0,0,0,0);
IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
}
EOF
check_header linux/videodev.h
check_header linux/videodev2.h
check_header sys/videoio.h
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 &&
check_header dev/bktr/ioctl_bt848.h; } ||
{ check_header machine/ioctl_meteor.h &&
check_header machine/ioctl_bt848.h; } ||
{ check_header dev/video/meteor/ioctl_meteor.h &&
check_header dev/video/bktr/ioctl_bt848.h; } ||
check_header dev/ic/bt8xx.h
check_header sys/soundcard.h
check_header soundcard.h
Diego Biurrun
committed
# deal with the X11 frame grabber
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
check_func XOpenDisplay -lX11 &&
check_func XShmCreateImage -lX11 -lXext
enabled debug && add_cflags -g"$debuglevel"
# add some useful compiler flags if supported
check_cflags -Wdeclaration-after-statement
check_cflags -Wall
check_cflags -Wno-switch
check_cflags -Wdisabled-optimization
check_cflags -Wpointer-arith
check_cflags -Wredundant-decls
check_cflags -Wwrite-strings
check_cflags -Wtype-limits
enabled extra_warnings && check_cflags -Winline
# add some linker flags
check_ldflags -Wl,--warn-common
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'
if enabled small; then
check_cflags -Os # not all compilers support -Os
optimizations="small"
elif enabled optimizations; then
if $cc -v 2>&1 | grep -q xlc; then
else
fi
Michael Niedermayer
committed
check_cflags -fno-signed-zeros
if $cc --version 2> /dev/null | grep -q Intel; then
# Just warnings, no remarks
check_cflags -w1
# -wd: Disable following warnings
# 144, 167, 556: -Wno-pointer-sign
# 10006: ignoring unknown option -fno-signed-zeros
# 10156: ignoring option '-W'; no argument required
check_cflags -wd144,167,556,10006,10156
# 11030: Warning unknown option --as-needed
# 10156: ignoring option '-export'; no argument required
check_ldflags -wd10156,11030
# Allow to compile with optimizations
check_ldflags -march=$cpu
# PIC flags for shared library objects where they are needed
if enabled shared; then
# LIBOBJFLAGS may have already been set in the OS configuration
if test -z "$LIBOBJFLAGS" ; then
case "${subarch-$arch}" in
x86_64|ia64|alpha|sparc*|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;;
esac
fi
if enabled gprof; then
# Find out if the .align argument is a power of two or not.
check_asm asmalign_pot '".align 3"'
Diego Biurrun
committed
enabled_any $DECODER_LIST && enable decoders
enabled_any $ENCODER_LIST && enable encoders
enabled_any $BSF_LIST && enable bsfs
enabled_any $DEMUXER_LIST && enable demuxers
enabled_any $MUXER_LIST && enable muxers
Vitor Sessak
committed
enabled_any $FILTER_LIST && enable filters
Diego Biurrun
committed
enabled_any $INDEV_LIST && enable demuxers
enabled_any $OUTDEV_LIST && enable muxers
enabled_any $PROTOCOL_LIST && enable protocols
enabled_any $THREADS_LIST && enable threads
check_deps $CONFIG_LIST \
Diego Biurrun
committed
$HAVE_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
Vitor Sessak
committed
$FILTER_LIST \
Diego Biurrun
committed
$INDEV_LIST \
$OUTDEV_LIST \
$PROTOCOL_LIST \
echo "install prefix $prefix"
echo "source path $source_path"
echo "C compiler $cc"
if test "$build_suffix" != ""; then
echo "build suffix $build_suffix"
if test "$extra_version" != ""; then
echo "version string suffix $extra_version"
fi
if enabled x86; then
echo "CMOV enabled ${cmov-no}"
echo "CMOV is fast ${fast_cmov-no}"
echo "EBX available ${ebx_available-no}"
echo "EBP available ${ebp_available-no}"
if enabled arm; then
echo "ARMv5TE enabled ${armv5te-no}"
echo "ARMv6 enabled ${armv6-no}"
echo "ARMv6T2 enabled ${armv6t2-no}"
Gildas Bazin
committed
fi
if enabled mips; then
if enabled ppc; then
echo "AltiVec enabled ${altivec-no}"
echo "dcbzl available ${dcbzl-no}"
echo "gprof enabled ${gprof-no}"
echo "debug symbols ${debug-no}"
echo "strip symbols ${stripping-no}"
echo "optimizations ${optimizations-no}"
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "postprocessing support ${postproc-no}"
echo "software scaler enabled ${swscale-no}"
Vitor Sessak
committed
echo "new filter support ${avfilter-no}"
echo "filters using lavformat ${avfilter_lavf-no}"
if enabled vhook; then
echo "Imlib2 support ${imlib2-no}"
echo "FreeType support ${freetype2-no}"
Philip Gladstone
committed
fi
if enabled network; then
echo "threading support ${thread_type-no}"
echo "SDL support ${sdl-no}"
if enabled sdl_too_old; then
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
fi
echo "Sun medialib support ${mlib-no}"
echo "AVISynth enabled ${avisynth-no}"
echo "libamr-nb support ${libamr_nb-no}"
echo "libamr-wb support ${libamr_wb-no}"
echo "libdirac enabled ${libdirac-no}"
echo "libfaac enabled ${libfaac-no}"
echo "libfaad enabled ${libfaad-no}"
echo "libfaad dlopened ${libfaadbin-no}"
echo "libgsm enabled ${libgsm-no}"
echo "libmp3lame enabled ${libmp3lame-no}"
echo "libnut enabled ${libnut-no}"
echo "libschroedinger enabled ${libschroedinger-no}"
echo "libtheora enabled ${libtheora-no}"
echo "libvorbis enabled ${libvorbis-no}"
Diego Biurrun
committed
echo "libx264 enabled ${libx264-no}"
echo "libxvid enabled ${libxvid-no}"
echo "vdpau enabled ${vdpau-no}"
echo "bzlib enabled ${bzlib-no}"
Vitor Sessak
committed
for type in decoder encoder parser demuxer muxer protocol filter bsf indev outdev; do
enabled $part && echo ${part%_*}
done | sort | pr -3 -t
echo
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..."
echo "# Automatically generated by configure - do not modify!" > config.mak
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
Diego Biurrun
committed
echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
echo "prefix=$prefix" >> config.mak
echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
echo "CC=$cc" >> config.mak
echo "AR=$ar" >> config.mak
echo "LN_S=$ln_s" >> config.mak
enabled stripping &&
echo "STRIP=$strip" >> config.mak ||
Michael Niedermayer
committed
echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak
Fabrice Bellard
committed
echo "LDFLAGS=$LDFLAGS" >> config.mak
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak
echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
echo "BUILD_STATIC=$static" >> config.mak
echo "BUILDSUF=$build_suffix" >> config.mak
echo "FULLNAME=$FULLNAME" >> config.mak
echo "LIBPREF=$LIBPREF" >> config.mak
echo "LIBSUF=$LIBSUF" >> config.mak
echo "LIBNAME=$LIBNAME" >> 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
echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak
echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
echo "HOSTLIBS=$host_libs" >> config.mak
echo "TARGET_EXEC=$target_exec" >> config.mak
echo "TARGET_PATH=$target_path" >> config.mak
if enabled bigendian; then
Diego Biurrun
committed
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
Nick Kurshev
committed
fi
if enabled sdl; then
Diego Biurrun
committed
echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
if enabled texi2html; then
Diego Biurrun
committed
echo "BUILD_DOC=yes" >> config.mak
Nicolas Boos
committed
fi
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
Diego Biurrun
committed
echo "BUILD_SHARED=yes" >> config.mak
echo "PIC=-fPIC -DPIC" >> config.mak
Diego Biurrun
committed
echo "SLIBNAME=${SLIBNAME}" >> config.mak
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
Diego Biurrun
committed
echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "EXTRALIBS=$extralibs" >> config.mak
echo "ARCH=$arch" >> config.mak
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST
Diego Biurrun
committed
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
Diego Biurrun
committed
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
Vitor Sessak
committed
$FILTER_LIST \
Diego Biurrun
committed
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
echo "#define restrict $_restrict" >> $TMPH
if enabled small; then
Diego Biurrun
committed
echo "#define av_always_inline" >> $TMPH
echo "SRC_PATH=\"$source_path\"" >> config.mak
echo "SRC_PATH_BARE=$source_path" >> config.mak
echo "BUILD_ROOT=\"$PWD\"" >> config.mak
Fabrice Bellard
committed
# Apparently it's not possible to portably echo a backslash.
Diego Biurrun
committed
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 an unchanged config.h to avoid superfluous rebuilds.
cmp -s $TMPH config.h &&
echo "config.h is unchanged" ||
mv -f $TMPH config.h
rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH
Aurelien Jacobs
committed
# build tree in object directory if source path is different from current one
if enabled source_path_used; then
Diego Biurrun
committed
doc \
libavcodec \
libavcodec/alpha \
Diego Biurrun
committed
libavcodec/bfin \
libavcodec/mlib \
libavcodec/ppc \
libavcodec/sh4 \
libavcodec/sparc \
libavdevice \
Vitor Sessak
committed
libavfilter \
Diego Biurrun
committed
libavformat \
libavutil \
libpostproc \
libswscale \
tests \
tools \
vhook \
"
Diego Biurrun
committed
Makefile \
common.mak \
Diego Biurrun
committed
doc/texi2pod.pl \
libavcodec/Makefile \
libavdevice/Makefile \
Vitor Sessak
committed
libavfilter/Makefile \
Diego Biurrun
committed
libavformat/Makefile \
libavutil/Makefile \
libpostproc/Makefile \
libswscale/Makefile \
"
Diego Biurrun
committed
mkdir -p $dir
done
for f in $FILES ; do
$ln_s "$source_path/$f" $f
Aurelien Jacobs
committed
Aurelien Jacobs
committed
pkgconfig_generate(){
name=$1
shortname=${name#lib}${build_suffix}
comment=$2
version=$3
libs=$4
requires=$5
cat <<EOF > $name/$name.pc
exec_prefix=\${prefix}
Måns Rullgård
committed
includedir=$incdir
Aurelien Jacobs
committed
Name: $name
Description: $comment
Version: $version
Anssi Hannula
committed
Requires: $(disabled shared && echo $requires)
Requires.private: $(enabled shared && echo $requires)
Aurelien Jacobs
committed
Conflicts:
Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
Libs.private: $(enabled shared && echo $libs)
Aurelien Jacobs
committed
EOF
cat <<EOF > $name/$name-uninstalled.pc
Aurelien Jacobs
committed
prefix=
exec_prefix=
includedir=${source_path}
Aurelien Jacobs
committed
Name: $name
Description: $comment
Version: $version
Requires: $requires
Aurelien Jacobs
committed
Conflicts:
Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
Aurelien Jacobs
committed
Cflags: -I\${includedir}
EOF
Aurelien Jacobs
committed
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
if enabled swscale; then
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavcodec = $LIBAVCODEC_VERSION"
apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/