Merge pull request #32 from morphis/feature/improve-cross-build-setup
Improve cross-build setup
This commit is contained in:
commit
32478856ee
7 changed files with 63 additions and 11 deletions
|
|
@ -100,3 +100,8 @@ add_subdirectory(external)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
add_subdirectory(android)
|
add_subdirectory(android)
|
||||||
|
|
||||||
|
if (NOT "${HOST_CMAKE_C_COMPILER}" STREQUAL "")
|
||||||
|
message(STATUS "Host C compiler: ${HOST_CMAKE_C_COMPILER}")
|
||||||
|
message(STATUS "Host C compiler: ${HOST_CMAKE_CXX_COMPILER}")
|
||||||
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ if (NOT DEFINED AC_GCC_VARIANT)
|
||||||
set(AC_GCC_VARIANT $ENV{AC_GCC_VARIANT} CACHE STRING "gcc variant required")
|
set(AC_GCC_VARIANT $ENV{AC_GCC_VARIANT} CACHE STRING "gcc variant required")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(HOST_CMAKE_C_COMPILER /usr/bin/cc)
|
||||||
|
set(HOST_CMAKE_CXX_COMPILER /usr/bin/c++)
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER /usr/bin/${AC_TARGET_MACHINE}-gcc${AC_GCC_VARIANT})
|
set(CMAKE_C_COMPILER /usr/bin/${AC_TARGET_MACHINE}-gcc${AC_GCC_VARIANT})
|
||||||
set(CMAKE_CXX_COMPILER /usr/bin/${AC_TARGET_MACHINE}-g++${AC_GCC_VARIANT})
|
set(CMAKE_CXX_COMPILER /usr/bin/${AC_TARGET_MACHINE}-g++${AC_GCC_VARIANT})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# build script to compile anbox for armhf devices
|
|
||||||
#
|
#
|
||||||
|
# Copyright © 2016 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Lesser General Public License version 3,
|
||||||
|
# as published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# 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 Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# Taken from the Mir Project (https://launchpad.net/mir)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|
@ -135,7 +150,7 @@ echo "Target machine: ${target_machine}"
|
||||||
|
|
||||||
if [ ${_do_update_chroot} -eq 1 ] ; then
|
if [ ${_do_update_chroot} -eq 1 ] ; then
|
||||||
pushd scripts > /dev/null
|
pushd scripts > /dev/null
|
||||||
./setup-partial-armhf-chroot.sh -d ${dist} -a ${target_arch} ${additional_repositories} ${AC_NDK_PATH}
|
./setup-partial-chroot.sh -d ${dist} -a ${target_arch} ${additional_repositories} ${AC_NDK_PATH}
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
# force a clean build after an update, since CMake cache maybe out of date
|
# force a clean build after an update, since CMake cache maybe out of date
|
||||||
clean_build_dir ${BUILD_DIR}
|
clean_build_dir ${BUILD_DIR}
|
||||||
|
|
|
||||||
11
debian/control
vendored
11
debian/control
vendored
|
|
@ -14,6 +14,7 @@ Build-Depends: cmake,
|
||||||
libboost-iostreams-dev,
|
libboost-iostreams-dev,
|
||||||
libboost-program-options-dev,
|
libboost-program-options-dev,
|
||||||
libboost-system-dev,
|
libboost-system-dev,
|
||||||
|
libboost-test-dev,
|
||||||
# boost log needs exactly one symbol from boost-thread for resolving
|
# boost log needs exactly one symbol from boost-thread for resolving
|
||||||
# thread-specific storage locations.
|
# thread-specific storage locations.
|
||||||
libboost-thread-dev,
|
libboost-thread-dev,
|
||||||
|
|
@ -25,6 +26,8 @@ Build-Depends: cmake,
|
||||||
libglib2.0-dev,
|
libglib2.0-dev,
|
||||||
libgtest-dev,
|
libgtest-dev,
|
||||||
libprotobuf-dev,
|
libprotobuf-dev,
|
||||||
|
libsdl2-dev,
|
||||||
|
lxc-dev,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
protobuf-compiler
|
protobuf-compiler
|
||||||
Standards-Version: 3.9.4
|
Standards-Version: 3.9.4
|
||||||
|
|
@ -37,13 +40,7 @@ Vcs-Browser: https://git.launchpad.net/anbox
|
||||||
Package: anbox
|
Package: anbox
|
||||||
Architecture: i386 amd64 armhf arm64
|
Architecture: i386 amd64 armhf arm64
|
||||||
Depends: ${misc:Depends},
|
Depends: ${misc:Depends},
|
||||||
${shlibs:Depends},
|
${shlibs:Depends}
|
||||||
# Provides newuidmap/newgidmap setuid helpers to initialize
|
|
||||||
# a user namespace.
|
|
||||||
uidmap,
|
|
||||||
# We depend on lxc-usernsexec as helper to spawn up the user
|
|
||||||
# namespace for our container.
|
|
||||||
lxc
|
|
||||||
Description: Android in a Box
|
Description: Android in a Box
|
||||||
Runtime for Android applications which runs a full Android system
|
Runtime for Android applications which runs a full Android system
|
||||||
in a container using Linux namespaces (user, ipc, net, mount) to
|
in a container using Linux namespaces (user, ipc, net, mount) to
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
if (NOT "${HOST_CMAKE_CXX_COMPILER}" STREQUAL "")
|
||||||
|
set (CMAKE_CXX_COMPILER "${HOST_CMAKE_CXX_COMPILER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
ApiGen.cpp
|
ApiGen.cpp
|
||||||
EntryPoint.cpp
|
EntryPoint.cpp
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# TODO: Rename this file without "armhf" when it's safe to do so.
|
# Copyright © 2016 Canonical Ltd.
|
||||||
#
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Lesser General Public License version 3,
|
||||||
|
# as published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# 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 Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# Taken from the Mir Project (https://launchpad.net/mir)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
@ -114,13 +127,25 @@ arch=${arch}
|
||||||
directory=${directory}
|
directory=${directory}
|
||||||
unpack=false
|
unpack=false
|
||||||
noauth=true
|
noauth=true
|
||||||
bootstrap=Ubuntu ${sources}
|
bootstrap=Ubuntu UbuntuUpdates UbuntuSecurity ${sources}
|
||||||
|
|
||||||
[Ubuntu]
|
[Ubuntu]
|
||||||
packages=${builddeps}
|
packages=${builddeps}
|
||||||
source=${source_url}
|
source=${source_url}
|
||||||
suite=${dist}
|
suite=${dist}
|
||||||
components=main universe
|
components=main universe
|
||||||
|
|
||||||
|
[UbuntuUpdates]
|
||||||
|
packages=${builddeps}
|
||||||
|
source=${source_url}
|
||||||
|
suite=${dist}-updates
|
||||||
|
components=main universe
|
||||||
|
|
||||||
|
[UbuntuSecurity]
|
||||||
|
packages=${builddeps}
|
||||||
|
source=${source_url}
|
||||||
|
suite=${dist}-security
|
||||||
|
components=main universe
|
||||||
" > mstrap.conf
|
" > mstrap.conf
|
||||||
|
|
||||||
sourceid=0
|
sourceid=0
|
||||||
|
|
@ -196,8 +196,11 @@ add_library(anbox-core ${SOURCES})
|
||||||
target_link_libraries(anbox-core
|
target_link_libraries(anbox-core
|
||||||
${Boost_LDFLAGS}
|
${Boost_LDFLAGS}
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
|
${DBUS_CPP_LDFLAGS}
|
||||||
${DBUS_CPP_LIBRARIES}
|
${DBUS_CPP_LIBRARIES}
|
||||||
|
${SDL2_LDFLAGS}
|
||||||
${SDL2_LIBRARIES}
|
${SDL2_LIBRARIES}
|
||||||
|
${LXC_LDFLAGS}
|
||||||
${LXC_LIBRARIES}
|
${LXC_LIBRARIES}
|
||||||
pthread
|
pthread
|
||||||
process-cpp
|
process-cpp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue