cpu="generic"
powerpc_perf="no"
mmx="default"
+cmov="no"
+cmov_is_fast="no"
armv5te="default"
iwmmxt="default"
altivec="default"
ffplay="yes"
LIBOBJFLAGS=""
FFLDFLAGS=-Wl,--warn-common
+LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
FFSERVERLDFLAGS=-Wl,-E
LDCONFIG="ldconfig"
LIBPREF="lib"
SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
;;
Linux)
+LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
;;
IRIX*)
targetos=IRIX
if test $cpu != "generic"; then
case $cpu in
601|ppc601|PowerPC601)
- add_cflags "-march=601"
+ add_cflags "-mcpu=601"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
fi
TUNECPU=ppc601
;;
603*|ppc603*|PowerPC603*)
- add_cflags "-march=603"
+ add_cflags "-mcpu=603"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
fi
TUNECPU=ppc603
;;
604*|ppc604*|PowerPC604*)
- add_cflags "-march=604"
+ add_cflags "-mcpu=604"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
fi
TUNECPU=ppc604
;;
G3|g3|75*|ppc75*|PowerPC75*)
- add_cflags "-march=750 -mpowerpc-gfxopt"
+ add_cflags "-mcpu=750 -mpowerpc-gfxopt"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
fi
TUNECPU=ppc750
;;
G4|g4|745*|ppc745*|PowerPC745*)
- add_cflags "-march=7450 -mpowerpc-gfxopt"
+ add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
fi
TUNECPU=ppc7450
;;
74*|ppc74*|PowerPC74*)
- add_cflags "-march=7400 -mpowerpc-gfxopt"
+ add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
fi
TUNECPU=ppc7400
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
- add_cflags "-march=970 -mpowerpc-gfxopt -mpowerpc64"
+ add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
fi
TUNECPU=ppc970
POWERPCMODE="64bits"
;;
- i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|pentium-m|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
+ # targets that do NOT support conditional mov (cmov)
+ i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
add_cflags "-march=$cpu"
+ cmov="no"
+ ;;
+ # 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)
+ add_cflags "-march=$cpu"
+ cmov="yes"
+ cmov_is_fast="yes"
+ ;;
+ # targets that do support conditional mov but on which it's slow
+ pentium4|prescott|nocona)
+ add_cflags "-march=$cpu"
+ cmov="yes"
+ cmov_is_fast="no"
;;
sparc64)
- add_cflags "-march=v9"
+ add_cflags "-mcpu=v9"
;;
*)
echo "WARNING: Unknown CPU \"$cpu\", ignored."
if ! $TMPE >>$logfile 2>&1; then
cat <<EOF
Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
-variable to another directory.
+variable to another directory and make sure that $TMPDIR1 is not mounted
+noexec.
EOF
die "Sanity test failed."
fi
fi
# these are off by default, so fail if requested and not available
-enabled dts && require libdts dts.h dts_init -ldts
+enabled dts && require libdts dts.h dts_init -ldts -lm
enabled libgsm && require libgsm gsm.h gsm_create -lgsm
-enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame
+enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
enabled xvid && require XviD xvid.h xvid_global -lxvidcore
check_cflags -Winline
# add some linker flags
-check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
+check_ldflags $LDLATEFLAGS
# not all compilers support -Os
test "$optimize" = "small" && check_cflags -Os
echo "broken inttypes.h $emu_fast_int"
if test $arch = "x86" -o $arch = "x86_64"; then
echo "MMX enabled $mmx"
+ echo "CMOV enabled $cmov"
+ echo "CMOV is fast $cmov_is_fast"
fi
if test $arch = "armv4l"; then
echo "ARMv5TE enabled $armv5te"
echo "#define HAVE_MMX 1" >> $TMPH
echo "#define __CPU__ 586" >> $TMPH
fi
+if test "$cmov" = "yes" ; then
+ echo "TARGET_CMOV=yes" >> config.mak
+ echo "#define HAVE_CMOV 1" >> $TMPH
+fi
+if test "$cmov_is_fast" = "yes" ; then
+ echo "TARGET_CMOV_IS_FAST=yes" >> config.mak
+ echo "#define CMOV_IS_FAST 1" >> $TMPH
+fi
if test "$armv5te" = "yes" ; then
echo "TARGET_ARMV5TE=yes" >> config.mak
echo "#define HAVE_ARMV5TE 1" >> $TMPH