echo " $0 [TARGET_OS] [TARGET_ARCH] [path/to/ffmpeg] [config-only]"
echo
echo "Valid combinations are linux [ia32|x64|mipsel|arm|arm-neon]"
+ echo " linux-noasm x64"
echo " win [ia32|x64]"
echo " win-vs2013 [ia32|x64]"
echo " mac [ia32|x64]"
# Check TARGET_OS (TARGET_ARCH is checked during configuration).
if [[ "$TARGET_OS" != "linux" &&
+ "$TARGET_OS" != "linux-noasm" &&
"$TARGET_OS" != "mac" &&
"$TARGET_OS" != "win" &&
"$TARGET_OS" != "win-vs2013" ]]; then
- echo "Valid target OSes are: linux, mac, win, win-vs2013"
+ echo "Valid target OSes are: linux, linux-noasm, mac, win, win-vs2013"
exit 1
fi
LIBAVUTIL_VERSION_MAJOR=52
case $(uname -sm) in
- Linux\ i386)
+ Linux\ i?86)
HOST_OS=linux
HOST_ARCH=ia32
JOBS=$(grep processor /proc/cpuinfo | wc -l)
HOST_ARCH=x64
JOBS=$(grep processor /proc/cpuinfo | wc -l)
;;
+ Linux\ arm*)
+ HOST_OS=linux
+ HOST_ARCH=arm
+ JOBS=$(grep processor /proc/cpuinfo | wc -l)
+ ;;
Darwin\ i386)
HOST_OS=mac
HOST_ARCH=ia32
echo "LD = $(ld --version | head -n1)"
echo
-# As of this writing gold 2.20.1-system.20100303 is unable to link FFmpeg.
-if ld --version | grep -q gold; then
- echo "gold is unable to link FFmpeg"
- echo
- echo "Switch /usr/bin/ld to the regular binutils ld and try again"
- exit 1
-fi
-
# We want to use a sufficiently recent version of yasm on Windows.
if [[ "$TARGET_OS" == "win" || "$TARGET_OS" == "win-vs2013" ]]; then
if !(which yasm 2>&1 > /dev/null); then
add_flag_common --enable-parser=vp3,vorbis,vp8
# Linux only.
-if [ "$TARGET_OS" = "linux" ]; then
+if [[ "$TARGET_OS" = "linux" || "$TARGET_OS" = "linux-noasm" ]]; then
if [ "$TARGET_ARCH" = "x64" ]; then
# Nothing to add for now.
add_flag_common ""
add_flag_common --extra-cflags=-m32
add_flag_common --extra-ldflags=-m32
elif [ "$TARGET_ARCH" = "arm" ]; then
- # This if-statement essentially is for chroot tegra2.
- add_flag_common --enable-cross-compile
-
- # Location is for CrOS chroot. If you want to use this, enter chroot
- # and copy ffmpeg to a location that is reachable.
- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
- add_flag_common --target-os=linux
- add_flag_common --arch=arm
+ if [ "$HOST_ARCH" != "arm" ]; then
+ # This if-statement essentially is for chroot tegra2.
+ add_flag_common --enable-cross-compile
+
+ # Location is for CrOS chroot. If you want to use this, enter chroot
+ # and copy ffmpeg to a location that is reachable.
+ add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
+ add_flag_common --target-os=linux
+ add_flag_common --arch=arm
+ fi
# TODO(ihf): ARM compile flags are tricky. The final options
# overriding everything live in chroot /build/*/etc/make.conf
# NOTE: softfp/hardfp selected at gyp time.
add_flag_common --extra-cflags=-mfloat-abi=hard
elif [ "$TARGET_ARCH" = "arm-neon" ]; then
- # This if-statement is for chroot arm-generic.
- add_flag_common --enable-cross-compile
- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
- add_flag_common --target-os=linux
- add_flag_common --arch=arm
+ if [ "$HOST_ARCH" != "arm" ]; then
+ # This if-statement is for chroot arm-generic.
+ add_flag_common --enable-cross-compile
+ add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
+ add_flag_common --target-os=linux
+ add_flag_common --arch=arm
+ fi
add_flag_common --enable-armv6
add_flag_common --enable-armv6t2
add_flag_common --enable-vfp
fi
fi
+if [ "$TARGET_OS" = "linux-noasm" ]; then
+ if [ "$TARGET_ARCH" = "x64" ]; then
+ add_flag_common --disable-asm
+ add_flag_common --disable-inline-asm
+ else
+ echo "Error: Unknown TARGET_ARCH=$TARGET_ARCH for TARGET_OS=$TARGET_OS!"
+ exit 1
+ fi
+fi
+
# Should be run on Windows.
if [ "$TARGET_OS" = "win" ]; then
if [ "$HOST_OS" = "win" ]; then
add_flag_common --enable-yasm
add_flag_common --cc=clang
add_flag_common --cxx=clang++
- add_flag_common --cpu=pentium-m
if [ "$TARGET_ARCH" = "ia32" ]; then
add_flag_common --arch=i686
add_flag_common --extra-cflags=-m32