[x265] [PATCH] enable arm-linux cross compile build

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Tue Jan 5 13:49:24 CET 2016


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1450516372 -19800
#      Sat Dec 19 14:42:52 2015 +0530
# Node ID d4de155912366fb831021c9f6a0fde6757a168d7
# Parent  25f78ff3d8efaa1e9d85bc3e718c887ec9afa557
enable arm-linux cross compile build

diff -r 25f78ff3d8ef -r d4de15591236 build/arm-linux/make-Makefiles.bash
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/arm-linux/make-Makefiles.bash	Sat Dec 19 14:42:52 2015 +0530
@@ -0,0 +1,4 @@
+#!/bin/bash
+# Run this from within a bash shell
+
+cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -G "Unix Makefiles" ../../source && ccmake ../../source
diff -r 25f78ff3d8ef -r d4de15591236 build/arm-linux/toolchain.cmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/arm-linux/toolchain.cmake	Sat Dec 19 14:42:52 2015 +0530
@@ -0,0 +1,12 @@
+# CMake toolchain file for cross compiling x265 for ARM arch
+
+set(CROSS_COMPILE_ARM 1)
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR armv6l)
+
+# specify the cross compiler
+set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
+set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
+
+# specify the target environment
+SET(CMAKE_FIND_ROOT_PATH  /usr/arm-linux-gnueabi)
diff -r 25f78ff3d8ef -r d4de15591236 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Tue Dec 22 18:13:28 2015 +0530
+++ b/source/CMakeLists.txt	Sat Dec 19 14:42:52 2015 +0530
@@ -59,6 +59,11 @@
     set(POWER 1)
     add_definitions(-DX265_ARCH_POWER=1)
 elseif(${SYSPROC} STREQUAL "armv6l")
+    if(CROSS_COMPILE_ARM)
+        message(STATUS "Cross compiling for ARM arch")
+    else()
+        set(CROSS_COMPILE_ARM 0)
+    endif()
     message(STATUS "Detected ARM target processor")
     set(ARM 1)
     add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
@@ -175,7 +180,9 @@
     elseif(X86 AND NOT X64)
         add_definitions(-march=i686)
     endif()
-    if(ARM)
+    if(ARM AND CROSS_COMPILE_ARM)
+        add_definitions(-march=armv6 -mfloat-abi=soft -mfpu=vfp)
+    elseif(ARM)
         add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
     endif()
     if(FPROFILE_GENERATE)


More information about the x265-devel mailing list