Newer
Older
--disable-bsfs) disable $BSF_LIST
;;
--disable-protocols) disable $PROTOCOL_LIST
;;
--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} ;;
*) 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
;;
Panagiotis Issaris
committed
--list-*)
NAME="${opt#--list-}"
is_in $NAME $COMPONENT_LIST || die_unknown $opt
Panagiotis Issaris
committed
NAME=$(toupper ${NAME%s})
eval show_list \$${NAME}_LIST
;;
;;
*)
die_unknown $opt
;;
esac
done
case "$arch" in
i386|i486|i586|i686|i86pc|BePC)
arch="x86_32"
;;
x86_64|amd64)
arch="x86_32"
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
arch="x86_64"
fi
fi
;;
# armv4l is a subset of armv[567]*l
arm|armv[4567]*l)
arch="armv4l"
;;
alpha)
arch="alpha"
"Power Macintosh"|ppc|powerpc)
ppc64)
arch="powerpc"
enable fast_64bit
;;
Diego Biurrun
committed
mips|mipsel|IP*)
arch="mips"
;;
sun4u|sparc64)
arch="sparc64"
;;
sparc)
arch="sparc"
;;
sh4)
arch="sh4"
;;
parisc)
arch="parisc"
;;
parisc64)
;;
s390|s390x)
arch="s390"
;;
m68k)
arch="m68k"
;;
ia64)
arch="ia64"
;;
bfin)
arch="bfin"
;;
*)
arch="unknown"
;;
esac
enable $arch
enabled_any x86_32 x86_64 && enable x86
enabled sparc64 && enable sparc
François Revol
committed
PREFIX="$HOME/config"
# helps building libavcodec
add_cflags "-DPIC -fomit-frame-pointer"
# 3 gcc releases known for BeOS, each with ugly bugs
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
;;
*20010315*) echo "BeBits gcc"
add_cflags "-fno-expensive-optimizations"
;;
esac
François Revol
committed
LDCONFIG="echo ignoring ldconfig"
François Revol
committed
# XXX: actually should check for NOT net_server
network_extralibs="-lbind -lsocket"
SHFLAGS='-shared -Wl,-h,$@'
network_extralibs="-lsocket -lnsl"
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
LIBOBJFLAGS='$(PIC)'
LDCONFIG='ldconfig -m $(SHLIBDIR)'
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
SLIBNAME_WITH_VERSION='$(SLIBNAME)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
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/$@'
strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
SLIBSUF=".dylib"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
Diego Biurrun
committed
targetos=mingw32
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
SLIBPREF=""
SLIBSUF=".dll"
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 $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(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'
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
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base'
ranlib="echo ignoring ranlib"
;;
*)
targetos="${targetos}-UNKNOWN"
;;
add_extralibs $osextralibs
enabled logging || logfile="$logging"
echo "# $0 $@" >$logfile
set >>$logfile
else
logfile=/dev/null
fi
# Combine FFLDFLAGS and the LDFLAGS environment variable.
LDFLAGS="$FFLDFLAGS $LDFLAGS"
test -n "$cross_prefix" && enable cross_compile
cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
# we need to build at least one lib type
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
build the shared libraries as well. To only build the shared libraries specify
--disable-static in addition to --enable-shared.
EOF
exit 1;
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."
if enabled_any libfaad libfaadbin ; then
if check_header faad.h; then
check_cc << EOF
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
#endif
int main( void ) { return 0; }
EOF
test $? = 0 && enable libfaad2
else
die_gpl_disabled(){
name=$1
shift
enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
}
die_gpl_disabled "The Postprocessing code" pp
die_gpl_disabled "liba52" liba52
Diego Biurrun
committed
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
Ramiro Polla
committed
fi
Michael Niedermayer
committed
Fabrice Bellard
committed
test -z "$need_memalign" && need_memalign="$mmx"
#Darwin CC versions
if test -n "`$cc -v 2>&1 | grep xlc`"; then
add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else
add_cflags "-no-cpp-precomp -pipe"
check_cflags "-force_cpusubtype_ALL"
check_cflags "-Wno-sign-compare"
fi
fi
disabled optimizations || add_cflags -fomit-frame-pointer
Michael Niedermayer
committed
# Add processor-specific flags
Guillaume Poirier
committed
if test $cpu != "generic"; then
warn_altivec(){
$1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1.";
Guillaume Poirier
committed
case $cpu in
;;
603*|ppc603*|PowerPC603*)
;;
604*|ppc604*|PowerPC604*)
;;
G3|g3|75*|ppc75*|PowerPC75*)
add_cflags "-mcpu=750 -mpowerpc-gfxopt"
;;
G4|g4|745*|ppc745*|PowerPC745*)
add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
;;
74*|ppc74*|PowerPC74*)
add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
Cell|CELL|cell)
add_cflags "-mcpu=cell"
warn_altivec disabled Cell
Guillaume Poirier
committed
# targets that do NOT support conditional mov (cmov)
i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
Guillaume Poirier
committed
add_cflags "-march=$cpu"
Guillaume Poirier
committed
;;
# targets that do support conditional mov (cmov)
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
Guillaume Poirier
committed
add_cflags "-march=$cpu"
enable cmov
enable fast_cmov
;;
# targets that do support conditional mov but on which it's slow
pentium4|prescott|nocona)
add_cflags "-march=$cpu"
enable cmov
disable fast_cmov
Marc Hoffman
committed
bf*) #bf531 bf532 bf533 bf561 bf5xx all get this config
add_cflags "-mfdpic"
add_ldflags "-mfdpic"
Marc Hoffman
committed
;;
Guillaume Poirier
committed
echo "WARNING: Unknown CPU \"$cpu\", ignored."
Michael Niedermayer
committed
esac
fi
gnu_make(){
$1 --version 2>&1 | grep -q GNU
}
if ! gnu_make $make; then
gnu_make gmake && make=gmake || die "GNU make not found."
fi
# make sure we can execute files in $TMPDIR
cat >$TMPE 2>>$logfile <<EOF
#! /bin/sh
EOF
chmod +x $TMPE >>$logfile 2>&1
if ! $TMPE >>$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
noexec.
EOF
die "Sanity test failed."
fi
# compiler sanity check
check_exec <<EOF
int main(){
return 0;
}
EOF
if test "$?" != 0; then
echo "$cc is unable to create an executable file."
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
die "C compiler test failed."
fi
Panagiotis Issaris
committed
# check whether EBP is available on x86
# As 'i' is stored on the stack, this program will crash
# if the base pointer is used to access it because the
# base pointer is cleared in the inline assembly code.
check_exec_crash <<EOF && enable ebp_available
Panagiotis Issaris
committed
volatile int i=0;
asm volatile (
"xorl %%ebp, %%ebp"
::: "%ebp");
return i;
EOF
# check wether EBX is available on x86
check_asm ebx_available '"":::"%ebx"'
# check whether binutils is new enough to compile SSSE3
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
Panagiotis Issaris
committed
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
fi
# check for SIMD availability
# AltiVec flags: The FSF version of GCC differs from the Apple version
test -n "`$cc -v 2>&1 | grep version | grep Apple`" &&
add_cflags "-faltivec" ||
Magnus Damm
committed
enabled altivec_h &&
inc_altivec_h="#include <altivec.h>" ||
check_cc <<EOF || disable altivec
int main(void) {
vector signed int v1, v2, v3;
v1 = vec_add(v2,v3);
return 0;
}
EOF
fi
Brian Foley
committed
enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
enabled mmi && check_asm mmi '"lq $2, 0($2)"'
enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc
enabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"
# ---
# big/little-endian test
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
grep -q BIGE $TMPO && enable bigendian
# ---
# check availability of some header files
if check_func dlopen; then
ldl=
elif check_func dlopen -ldl; then
ldl=-ldl
Roman Shaposhnik
committed
check_func gethrtime
check_func getrusage
check_func inet_aton
check_func memalign
check_func mkstemp
check_func2 windows.h GetProcessTimes
check_header byteswap.h
check_header conio.h
check_header dlfcn.h
check_header malloc.h
check_header termios.h
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
# ffserver uses poll(),
# if it's not found we can emulate it using select().
if enabled ffserver; then
check_header sys/poll.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
if check_func pthread_create; then
:
elif check_func pthread_create -pthread; then
add_cflags -pthread
add_ldflags -pthread
elif check_func pthread_create -pthreads; then
add_cflags -pthreads
add_ldflags -pthreads
elif ! check_lib pthread.h pthread_create -lpthread; then
die "ERROR: can't find pthreads library"
fi
fi
for thread in $THREADS_LIST; do
if enabled $thread; then
test -n "$thread_type" &&
die "ERROR: Only one thread type must be selected." ||
thread_type="$thread"
fi
done
# test for lrintf in math.h
check_exec <<EOF && enable lrintf || disable lrintf
#define _ISOC9X_SOURCE 1
#include <math.h>
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
EOF
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 libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
Diego Biurrun
committed
enabled libx264 && require x264 x264.h x264_encoder_open -lx264
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
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_cc <<EOF && _restrict=$restrict_keyword && break
void foo(char * $restrict_keyword p);
EOF
test "$vhook" = "default" && vhook="$dlopen"
if test "$targetos" = cygwin -o "$targetos" = mingw32 && enabled_all static vhook ; then
echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
echo "Patches welcome."
echo
fi
if enabled vhook; then
check_ldflags -rdynamic
check_ldflags -export-dynamic
fi
check_foo_config imlib2 imlib2 Imlib2.h imlib_load_font
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
sdl_cflags=`"${SDL_CONFIG}" --cflags`
temp_cflags $sdl_cflags
temp_extralibs `"${SDL_CONFIG}" --libs`
_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
#include <SDL.h>
int main(void){
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
int w = vi->current_w;
return 0;
}
EOF
restore_flags
texi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2html
Nicolas Boos
committed
##########################################
# 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
network_extralibs="-lws2_32"
check_func2 winsock2.h closesocket
fi
fi
##########################################
enabled network && enabled ipv6 && check_ld <<EOF && enable ipv6 || disable ipv6
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
int main( void ) {
struct sockaddr_storage saddr;
struct ipv6_mreq mreq6;
getaddrinfo(0,0,0,0);
getnameinfo(0,0,0,0,0,0,0);
Dan Villiom Podlaski Christiansen
committed
IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
}
EOF
check_header linux/videodev.h
check_header linux/videodev2.h
# 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
# 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
# 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
enabled extra_warnings && check_cflags -Winline
# add some linker flags
check_ldflags -Wl,--warn-common
check_ldflags $LDLATEFLAGS
if enabled small; then
check_cflags -Os # not all compilers support -Os
optimizations="small"
elif enabled optimizations; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
add_cflags "-O5"
add_ldflags "-O5"
else
add_cflags "-O3"
fi
fi
# 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 "$arch" in
x86_64|ia64|alpha|sparc*|power*) LIBOBJFLAGS='$(PIC)' ;;
fi
fi
if enabled gprof; then
add_cflags "-p"
add_ldflags "-p"
# Find out if the .align argument is a power of two or not.
if test $asmalign_pot = "unknown"; then
disable asmalign_pot
echo 'asm (".align 3");' | check_cc && enable asmalign_pot
enabled_any $ENCODER_LIST && enable encoders
enabled_any $DECODER_LIST && enable decoders
enabled_any $MUXER_LIST && enable muxers
enabled_any $DEMUXER_LIST && enable demuxers
enabled_any $PROTOCOL_LIST && enable protocols
enabled_any $BSF_LIST && enable bsfs
enabled_any $THREADS_LIST && enable threads
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"
echo "install prefix $PREFIX"
echo "source path $source_path"
echo "C compiler $cc"
echo "make $make"
if test "$BUILDSUF" != ""; then
if test $arch = "x86_32" -o $arch = "x86_64"; then
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}"
if test $arch = "armv4l"; then
echo "ARMv5TE enabled ${armv5te-no}"
echo "ARMv6 enabled ${armv6-no}"
echo "IWMMXT enabled ${iwmmxt-no}"
Gildas Bazin
committed
fi
Diego Biurrun
committed
if test $arch = "mips"; then
if test $arch = "powerpc"; then
echo "AltiVec enabled ${altivec-no}"
echo "dcbzl available ${dcbzl-no}"
echo "gprof enabled ${gprof-no}"
echo "debug symbols ${debug-no}"
echo "strip symbols ${dostrip-no}"
echo "optimizations ${optimizations-no}"
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "postprocessing support ${pp-no}"
echo "software scaler enabled ${swscaler-no}"
echo "video hooking ${vhook-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 "liba52 support ${liba52-no}"
echo "liba52 dlopened ${liba52bin-no}"
echo "libamr-nb support ${libamr_nb-no}"
echo "libamr-wb support ${libamr_wb-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 "libogg enabled ${libogg-no}"
echo "libtheora enabled ${libtheora-no}"
echo "libvorbis enabled ${libvorbis-no}"
echo "x264 enabled ${libx264-no}"
echo "XviD enabled ${libxvid-no}"
echo "zlib enabled ${zlib-no}"
enabled gpl &&
echo "License: GPL" ||
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
echo "PREFIX=$PREFIX" >> config.mak
echo "prefix=\$(DESTDIR)\$(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 "LDCONFIG=$LDCONFIG" >> config.mak
echo "LN_S=$ln_s" >> config.mak
enabled dostrip &&
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=$BUILDSUF" >> 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
if enabled bigendian; then
Fabrice Bellard
committed
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
Nick Kurshev
committed
fi
if enabled mmx; then
if enabled sdl; then
echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
if enabled texi2html; then
Nicolas Boos
committed
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'`
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'`
if enabled shared; then
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 "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
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_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
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
$PROTOCOL_LIST \
echo "#define restrict $_restrict" >> $TMPH
if enabled small; then
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.
enabled asmalign_pot &&
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
Diego Biurrun
committed
# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
cmp -s $TMPH config.h &&
echo "config.h is unchanged" ||
mv -f $TMPH config.h
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
Aurelien Jacobs
committed
# build tree in object directory if source path is different from current one
if enabled source_path_used; then
DIRS="\
doc \
libavcodec \
libavcodec/alpha \
libavcodec/armv4l \
libavcodec/bfin \
libavcodec/i386 \
libavcodec/mlib \
libavcodec/ppc \
libswscale \
tests \
vhook \
"
FILES="\
Makefile \
common.mak \
libswscale/Makefile \
"
for dir in $DIRS ; do
mkdir -p $dir
done
for f in $FILES ; do
$ln_s "$source_path/$f" $f
Aurelien Jacobs
committed
# FIXME: libdir and includedir are hardcoded and may differ from the real path.
Aurelien Jacobs
committed
pkgconfig_generate(){
name=$1