Commit 9a4f0765 authored by Ghislain MARY's avatar Ghislain MARY

Add target to build Python module for Raspberry PI.

parent 7340a7a1
......@@ -26,7 +26,7 @@ PWD=$(shell pwd)
build-desktop clean-desktop \
build-flexisip clean-flexisip \
build-flexisip-rpm clean-flexisip-rpm \
build-python clean-python \
build-python clean-python build-python-raspberry \
build-bb10-i486 build-bb10-arm build-bb10 clean-bb10-i486 clean-bb10-arm clean-bb10 help-bb10 generate-bb10-sdk \
build-ios-i386 build-ios-armv7 build-ios-armv7s build-ios clean-ios-i386 clean-ios-armv7 clean-ios-armv7s clean-ios help-ios generate-ios-sdk \
veryclean
......@@ -82,6 +82,15 @@ build-python:
cmake ../.. -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-python.cmake -DCMAKE_PREFIX_PATH=$(PWD)/OUTPUT -DCMAKE_INSTALL_PREFIX=$(PWD)/OUTPUT $(filter -D%,$(MAKEFLAGS)) && \
make
build-python-raspberry:
mkdir -p WORK/cmake-python-raspberry && \
cd WORK/cmake-python-raspberry && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-raspberry.cmake \
-DLINPHONE_BUILDER_CONFIG_FILE=configs/config-python-raspberry.cmake \
-DCMAKE_PREFIX_PATH=$(PWD)/OUTPUT -DCMAKE_INSTALL_PREFIX=$(PWD)/OUTPUT \
$(filter -D%,$(MAKEFLAGS)) && \
make
clean-python:
rm -rf WORK/Build-python && \
rm -rf WORK/tmp-python
......
############################################################################
# config-python-raspberry.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
get_filename_component(COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
string(REGEX REPLACE "-gcc$" "" LINPHONE_BUILDER_HOST ${COMPILER_NAME})
unset(COMPILER_NAME)
include("configs/config-python.cmake")
# ffmpeg
set(EP_ffmpeg_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--enable-cross-compile"
"--cross-prefix=arm-linux-gnueabihf-"
"--arch=arm"
"--target-os=linux"
)
# vpx
set(EP_vpx_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--target=generic-gnu"
)
############################################################################
# toolchain-raspberry.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(RASPBERRY_TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(RASPBERRY_TOOLCHAIN_CC "${RASPBERRY_TOOLCHAIN_HOST}-gcc")
set(RASPBERRY_TOOLCHAIN_CXX "${RASPBERRY_TOOLCHAIN_HOST}-g++")
set(RASPBERRY_TOOLCHAIN_LD "${RASPBERRY_TOOLCHAIN_HOST}-ld")
set(RASPBERRY_TOOLCHAIN_AR "${RASPBERRY_TOOLCHAIN_HOST}-ar")
set(RASPBERRY_TOOLCHAIN_RANLIB "${RASPBERRY_TOOLCHAIN_HOST}-ranlib")
set(RASPBERRY_TOOLCHAIN_STRIP "${RASPBERRY_TOOLCHAIN_HOST}-strip")
set(RASPBERRY_TOOLCHAIN_NM "${RASPBERRY_TOOLCHAIN_HOST}-nm")
include(CMakeForceCompiler)
set(CMAKE_CROSSCOMPILING TRUE)
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "arm")
# Define the compiler
CMAKE_FORCE_C_COMPILER(${RASPBERRY_TOOLCHAIN_CC} GNU)
CMAKE_FORCE_CXX_COMPILER(${RASPBERRY_TOOLCHAIN_CXX} GNU)
set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH} ${CMAKE_INSTALL_PREFIX})
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment