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-swscaler software scaler 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]"
postproc
powerpc_perf
small
- swscaler
+ swscale
vhook
x11grab
zlib
iwmmxt
mmi
mmx
+ mmx2
ssse3
vis
'
socklen_t
soundcard_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"
# toolchain
cc="gcc"
ar="ar"
+nm="nm"
ranlib="ranlib"
make="make"
strip="strip"
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
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
# 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
;;
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
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}"
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
#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 "-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
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 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
# 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
-tr -c -d BIGE < $TMPO | grep -q BIGE && enable bigendian
+od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
# ---
# check availability of some header files
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
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
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "postprocessing support ${postproc-no}"
-echo "software scaler enabled ${swscaler-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}"
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
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
pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
fi
-if enabled swscaler; then
+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