Newer
Older
Diego Biurrun
committed
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
--shlibdir=*) shlibdir="$optval"
;;
--incdir=*) incdir="$optval"
;;
--mandir=*) mandir="$optval"
;;
--source-path=*) source_path="$optval"
;;
--cross-prefix=*) cross_prefix="$optval"
;;
--cross-compile) enable cross_compile
;;
--target-os=*) targetos="$optval"
;;
--cc=*) cc="$optval"
;;
--make=*) make="$optval"
;;
--extra-cflags=*) add_cflags "$optval"
;;
--extra-ldflags=*) add_ldflags "$optval"
;;
--extra-libs=*) add_extralibs "$optval"
;;
--build-suffix=*) BUILDSUF="$optval"
;;
--arch=*) arch="$optval"
;;
--cpu=*) cpu="$optval"
;;
--enable-sunmlib) enable mlib
;;
--disable-devices) disable $INDEV_LIST $OUTDEV_LIST
;;
--enable-debug=*) debuglevel="$optval"
;;
Diego Biurrun
committed
--enable-*=*|--disable-*=*)
eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
case "$thing" in
encoder|decoder|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
Diego Biurrun
committed
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
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
Diego Biurrun
committed
;;
--list-*)
NAME="${opt#--list-}"
is_in $NAME $COMPONENT_LIST || die_unknown $opt
NAME=${NAME%s}
eval show_list $NAME \$$(toupper $NAME)_LIST
;;
--help|-h) show_help
;;
*)
die_unknown $opt
;;
esac
done
Diego Biurrun
committed
i386|i486|i586|i686|i86pc|BePC)
arch="x86_32"
enable fast_unaligned
;;
x86_64|amd64)
arch="x86_32"
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 ! echo $CFLAGS | grep -q -- -m32; then
Diego Biurrun
committed
arch="x86_64"
enable fast_64bit
fi
fi
;;
# armv4l is a subset of armv[567]*l
arm|armv[4567]*l)
arch="armv4l"
;;
alpha)
arch="alpha"
enable fast_64bit
;;
"Power Macintosh"|ppc|powerpc)
arch="powerpc"
;;
ppc64)
arch="powerpc"
Diego Biurrun
committed
mips|mipsel|IP*)
arch="mips"
Diego Biurrun
committed
sun4u|sparc64)
arch="sparc64"
enable fast_64bit
Diego Biurrun
committed
sparc)
arch="sparc"
Diego Biurrun
committed
sh4)
arch="sh4"
Diego Biurrun
committed
parisc)
arch="parisc"
Diego Biurrun
committed
parisc64)
arch="parisc"
enable fast_64bit
Diego Biurrun
committed
s390|s390x)
arch="s390"
Diego Biurrun
committed
m68k)
arch="m68k"
Diego Biurrun
committed
ia64)
arch="ia64"
enable fast_64bit
Diego Biurrun
committed
bfin)
arch="bfin"
;;
*)
arch="unknown"
Diego Biurrun
committed
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
enable $arch
enabled_any x86_32 x86_64 && enable x86
enabled sparc64 && enable sparc
# OS specific
case $targetos in
beos|haiku|zeta)
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"
disable mmx
;;
*20010315*) echo "BeBits gcc"
add_cflags "-fno-expensive-optimizations"
;;
esac
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 -q 'headers/be/bone'; then
Diego Biurrun
committed
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
network_extralibs="-lbind -lsocket"
else
enable beos_netserver
network_extralibs="-lnet"
fi ;;
sunos)
FFSERVERLDFLAGS=""
SHFLAGS='-shared -Wl,-h,$@'
network_extralibs="-lsocket -lnsl"
;;
netbsd)
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
;;
openbsd)
disable need_memalign
LIBOBJFLAGS='$(PIC)'
SHFLAGS='-shared'
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
SLIBNAME_WITH_VERSION='$(SLIBNAME)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
;;
freebsd)
disable need_memalign
;;
bsd/os)
osextralibs="-lpoll -lgnugetopt"
strip="strip -d"
;;
darwin)
disable need_memalign
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
Diego Biurrun
committed
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)'
FFSERVERLDFLAGS=-Wl,-bind_at_load
;;
mingw32*)
targetos=mingw32
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 swscale; then
Diego Biurrun
committed
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
disable ffserver
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'
;;
cygwin*)
targetos=cygwin
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 swscale; then
Diego Biurrun
committed
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
EXESUF=".exe"
SLIBPREF="cyg"
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base'
;;
*-dos|freedos|opendos)
disable ffplay ffserver vhook
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket"
EXESUF=".exe"
;;
Diego Biurrun
committed
linux)
LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
enable dv1394
;;
irix*)
targetos=irix
ranlib="echo ignoring ranlib"
;;
os/2*)
strip="lxlite"
ln_s="cp -f"
EXESUF=".exe"
FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
SHFLAGS='$(NAME).def -Zdll -Zomf'
FFSERVERLDFLAGS=""
LIBSUF="_s.a"
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(NAME).def; \
echo PROTMODE >> $(NAME).def; \
echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(NAME).def; \
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(NAME).def; \
echo EXPORTS >> $(NAME).def; \
emxexp -o $(OBJS) >> $(NAME).def'
SLIB_EXTRA_CMD='emximp -o $(LIBPREF)$(NAME)_dll.a $(NAME).def; \
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'
interix)
disable vhook
;;
Diego Biurrun
committed
*)
targetos="${targetos}-UNKNOWN"
;;
esac
# set temporary file name
if test ! -z "$TMPDIR" ; then
TMPDIR1="${TMPDIR}"
elif test ! -z "$TEMPDIR" ; then
TMPDIR1="${TEMPDIR}"
else
TMPDIR1="/tmp"
fi
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
add_extralibs $osextralibs
disabled logging && logfile=/dev/null
# 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}"
nm="${cross_prefix}${nm}"
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_any libfaad libfaadbin ; then
if check_header faad.h; then
check_cc << EOF
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
#endif
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" postproc
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" swscale
Ramiro Polla
committed
fi
Michael Niedermayer
committed
if ! enabled nonfree && enabled_any libamr_nb libamr_wb; then
die "libamr is nonfree and --enable-nonfree is not specified."
fi
Fabrice Bellard
committed
test -z "$need_memalign" && need_memalign="$mmx"
#Darwin CC versions
if $cc -v 2>&1 | grep -q xlc; then
add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else
add_cflags "-pipe"
check_cflags "-force_cpusubtype_ALL"
check_cflags "-Wno-sign-compare"
enabled shared || add_cflags -mdynamic-no-pic
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|pentium4m|prescott|nocona)
add_cflags "-march=$cpu"
enable cmov
disable fast_cmov
Diego Biurrun
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
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
check_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
EOF
sym=$($nm -P -g $TMPO)
extern_prefix=${sym%%ff_extern*}
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/MMX2
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"'
check_asm bswap '"bswap %%eax" ::: "%eax"'
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
Diego Biurrun
committed
check_cflags -maltivec -mabi=altivec &&
check_header altivec.h ||
check_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
Matthieu Castet
committed
# We have to check if pld is a nop and disable it.
enabled armv4l && check_asm pld '"pld [r0]"'
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';
od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
# ---
# check availability of some header files
if check_func dlopen; then
ldl=
elif check_func dlopen -ldl; then
ldl=-ldl
Diego Biurrun
committed
check_func fork
check_func gethrtime
check_func getrusage
Michael Kostylev
committed
check_func inet_aton $network_extralibs
Diego Biurrun
committed
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 sys/mman.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/select.h
# 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_extralibs -pthread
elif check_func pthread_create -pthreads; then
add_cflags -pthreads
add_extralibs -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 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; }
done
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
Diego Biurrun
committed
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 libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
Diego Biurrun
committed
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 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
Diego Biurrun
committed
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
Alessandro Sappia
committed
# 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
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`
if check_lib2 SDL.h SDL_Init; then
_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
#include <SDL.h>
int main(int argc, char **argv){
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
check_type sys/socket.h socklen_t
##########################################
# 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_type ws2tcpip.h socklen_t
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>
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_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_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 $LDLATEFLAGS
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
add_cflags "-O5"
add_ldflags "-O5"
else
add_cflags "-O3"
fi
Michael Niedermayer
committed
check_cflags -fno-signed-zeros
# 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)' ;;
esac
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
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 \
$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 \
enabled libdc1394 && append pkg_requires "libraw1394"
enabled libtheora && append pkg_requires "theora"
enabled libvorbis && append pkg_requires "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 ${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 "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 "libtheora enabled ${libtheora-no}"
echo "libvorbis enabled ${libvorbis-no}"
echo "x264 enabled ${libx264-no}"
echo "XviD enabled ${libxvid-no}"
echo "zlib enabled ${zlib-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
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 "/* 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 "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=$BUILDSUF" >> config.mak
echo "FULLNAME=$FULLNAME" >> config.mak