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
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"
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 "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