echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
- echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
+ echo " --incdir=DIR install includes in DIR [PREFIX/include]"
echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
echo " --enable-static build static libraries [default=yes]"
echo " --disable-static do not build static libraries [default=no]"
echo " --enable-powerpc-perf enable performance report on PPC"
echo " (requires enabling PMC)"
echo " --disable-mmx disable MMX usage"
+ echo " --disable-mmx2 disable MMX2 usage"
+ echo " --disable-ssse3 disable SSSE3 usage"
echo " --disable-armv5te disable armv5te usage"
echo " --disable-armv6 disable armv6 usage"
echo " --disable-iwmmxt disable iwmmxt usage"
iwmmxt
mmi
mmx
+ mmx2
ssse3
vis
'
memalign
mkstemp
mlib
+ pld
ppc64
round
roundf
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"
vhook_extralibs='$ldl'
-# 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}"
-TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
-TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
-
# default parameters
enable logging
# toolchain
cc="gcc"
ar="ar"
+nm="nm"
ranlib="ranlib"
make="make"
strip="strip"
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._-]*: \([a-z0-9]*/\).*,\1&,"'
-VHOOKDEPEND_CMD='$(CC) -MM $(VHOOKCFLAGS) $(filter-out %.h,$^) | sed "s,^\([a-z]\),vhook/\1,"'
+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 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
ranlib="echo ignoring ranlib"
;;
os/2*)
- ar="emxomfar -p256"
- ranlib="echo ignoring ranlib"
strip="lxlite"
ln_s="cp -f"
- add_cflags "-Zomf"
EXESUF=".exe"
FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
SHFLAGS='$(NAME).def -Zdll -Zomf'
FFSERVERLDFLAGS=""
- LIBSUF="_s.lib"
+ LIBSUF="_s.a"
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
;;
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
if ! disabled logging ; then
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}"
#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"
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
- if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
- add_cflags "-faltivec"
- else
- add_cflags "-maltivec -mabi=altivec"
- fi
-
- 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 &&
EOF
fi
+# 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"'
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 "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
-echo "VHOOKDEPEND_CMD=$VHOOKDEPEND_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