Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OJI-1392: Code changes to support cross-compilation for QNX 6.5. Add …
…installation instructions.
- Loading branch information
Denis Kimcherenko
committed
Oct 6, 2016
1 parent
14369b4
commit e61106c
Showing
8 changed files
with
340 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# | ||
# Copyright 2014-2016 CyberVision, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
============================== SYSTEM REQUIREMENTS ===================== | ||
|
||
Host: Ubuntu 14.04 x64 | ||
Target: QNX 6.5 | ||
|
||
============================== TOOLS =================================== | ||
|
||
### QNX SDP | ||
1. Download and install QNX SDP 6.5.0 + SP1 (from official site) | ||
|
||
2. Upgrade GCC to 4.8.3 and binutils to 2.24 | ||
http://stackoverflow.com/questions/34168433/am-i-able-to-use-c11-in-qnx/34975932#34975932 | ||
|
||
3. Copy <KAA_SDK_HOME>/tools/qnx/include/* to <QNX_SDP_HOME>/target/qnx6/usr/include/c++/4.8.3/ | ||
|
||
### QNX SDP | ||
|
||
- CMake (minimum 2.8.12) | ||
- Python 2.7 | ||
|
||
============================== ENV VARS ================================ | ||
|
||
export KAA_THIRDPARTY_HOME=<YOUR_CUSTOM_DIRECTORY> | ||
|
||
============================== Boost 1.61 ============================== | ||
|
||
### For host | ||
|
||
sudo apt-get install libboost-all-dev | ||
|
||
### For target | ||
|
||
./bootstrap.sh | ||
|
||
./b2 \ | ||
toolset=qcc \ | ||
target-os=qnxnto \ | ||
variant=release \ | ||
link=static \ | ||
threading=multi \ | ||
cxxflags="-V4.8.3,gcc_ntox86 -Y_gpp -Wc,-std=gnu++11" \ | ||
linkflags="-V4.8.3,gcc_ntox86 -Y_gpp -lang-c++" \ | ||
--prefix=$KAA_THIRDPARTY_HOME/usr \ | ||
--with-system \ | ||
--with-thread \ | ||
--with-log \ | ||
--with-filesystem \ | ||
--with-iostreams \ | ||
--with-program_options \ | ||
-q \ | ||
install | ||
|
||
============================== Avro 1.7.5 ============================== | ||
|
||
### For host | ||
|
||
mkdir build && cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
make install | ||
|
||
### For target | ||
|
||
Patch by <KAA_SDK_HOME>/tools/avro-cpp-disable-tests.patch | ||
|
||
mkdir build && cd build | ||
|
||
cmake \ | ||
-DQNX_HOST=$QNX_HOST \ | ||
-DQNX_TARGET=$QNX_TARGET \ | ||
-DCMAKE_TOOLCHAIN_FILE=<KAA_SDK_HOME>/toolchains/qnx-x86.cmake \ | ||
-DCMAKE_INSTALL_PREFIX=$KAA_THIRDPARTY_HOME/usr \ | ||
-DCMAKE_FIND_ROOT_PATH=$KAA_THIRDPARTY_HOME \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
.. | ||
|
||
nmake install | ||
|
||
============================== Botan 1.11 ============================== | ||
|
||
find . -type f \( -name "*.h" -or -name "*.hpp" -or -name "*.cpp" \) -print0 | xargs -0 sed -i '/include <string>/a #include <custom\/string.h>' | ||
|
||
./configure.py \ | ||
--os=qnx \ | ||
--cpu=x86_32 \ | ||
--cc=gcc \ | ||
--cc-bin=i486-pc-nto-qnx6.5.0-g++ \ | ||
--cc-abi-flags="-D_HAS_C9X -mstackrealign" \ | ||
--disable-shared \ | ||
--link-method=copy \ | ||
--prefix=$KAA_THIRDPARTY_HOME/usr | ||
|
||
make install | ||
|
||
ln -s $KAA_THIRDPARTY_HOME/include/botan-1.11/botan $KAA_THIRDPARTY_HOME/include/botan | ||
|
||
============================== Sqlite (autoconf) ============================== | ||
|
||
CC=i486-pc-nto-qnx6.5.0-gcc \ | ||
./configure \ | ||
--host=i486-pc-nto-qnx6.5.0 \ | ||
--enable-shared=no \ | ||
--enable-static=yes \ | ||
--prefix=$KAA_THIRDPARTY_HOME/usr | ||
|
||
make install | ||
|
||
============================== Kaa C++ SDK ============================== | ||
|
||
cmake \ | ||
-DQNX_HOST=$QNX_HOST \ | ||
-DQNX_TARGET=$QNX_TARGET \ | ||
-DCMAKE_TOOLCHAIN_FILE=../toolchains/qnx-x86.cmake \ | ||
-DCMAKE_INSTALL_PREFIX=$KAA_THIRDPARTY_HOME/usr \ | ||
-DCMAKE_FIND_ROOT_PATH=$KAA_THIRDPARTY_HOME \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
-DKAA_WITH_SQLITE_LOG_STORAGE=1 \ | ||
-DAvro_USE_STATIC_LIBS=ON \ | ||
-DBoost_USE_STATIC_LIBS=ON \ | ||
-DBotan_USE_STATIC_LIBS=ON \ | ||
.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Copyright 2014-2016 CyberVision, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set(CMAKE_SYSTEM_NAME QNX) | ||
set(CMAKE_SYSTEM_VERSION 6.5.0) | ||
|
||
set(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/i486-pc-nto-qnx${CMAKE_SYSTEM_VERSION}-gcc) | ||
set(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/i486-pc-nto-qnx${CMAKE_SYSTEM_VERSION}-g++) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE x86) | ||
|
||
set(CMAKE_FIND_ROOT_PATH | ||
${CMAKE_FIND_ROOT_PATH} | ||
${QNX_TARGET} | ||
${QNX_TARGET}/${CMAKE_LIBRARY_ARCHITECTURE}) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
add_definitions(-DQNX_650_CPP11_TO_STRING_PATCH) |
Oops, something went wrong.