Commit 97bca2d7 authored by Ghislain MARY's avatar Ghislain MARY

Improve bb10 toolchain to detect compiler version automatically.

parent 5cf70ca6
......@@ -29,15 +29,22 @@ if ("$ENV{QNX_HOST}" STREQUAL "")
message(FATAL_ERROR "Some environment variables need to be defined by using the bbndk-env*.sh delivered with the bbndk.")
endif()
file(GLOB COMPILER_PATH $ENV{QNX_HOST}/usr/bin/arm-unknown-nto-qnx*eabi-gcc)
if("${COMPILER_PATH}" STREQUAL "")
message(FATAL_ERROR "Could not find compiler")
endif()
get_filename_component(COMPILER_NAME ${COMPILER_PATH} NAME)
string(REGEX REPLACE "-gcc$" "" LINPHONE_BUILDER_TOOLCHAIN_PATH ${COMPILER_PATH})
string(REGEX REPLACE "-gcc$" "" LINPHONE_BUILDER_TOOLCHAIN_HOST ${COMPILER_NAME})
set(LINPHONE_BUILDER_TOOLCHAIN_HOST "arm-unknown-nto-qnx8.0.0eabi")
set(LINPHONE_BUILDER_TOOLCHAIN_CC "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-gcc")
set(LINPHONE_BUILDER_TOOLCHAIN_CXX "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-g++")
set(LINPHONE_BUILDER_TOOLCHAIN_LD "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ld")
set(LINPHONE_BUILDER_TOOLCHAIN_AR "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ar")
set(LINPHONE_BUILDER_TOOLCHAIN_RANLIB "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ranlib")
set(LINPHONE_BUILDER_TOOLCHAIN_STRIP "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-strip")
set(LINPHONE_BUILDER_TOOLCHAIN_NM "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-nm")
set(LINPHONE_BUILDER_TOOLCHAIN_CC "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-gcc")
set(LINPHONE_BUILDER_TOOLCHAIN_CXX "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-g++")
set(LINPHONE_BUILDER_TOOLCHAIN_LD "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ld")
set(LINPHONE_BUILDER_TOOLCHAIN_AR "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ar")
set(LINPHONE_BUILDER_TOOLCHAIN_RANLIB "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ranlib")
set(LINPHONE_BUILDER_TOOLCHAIN_STRIP "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-strip")
set(LINPHONE_BUILDER_TOOLCHAIN_NM "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-nm")
set(LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS "-D_REENTRANT -D__QNXNTO__ -Dasm=__asm")
#-D__PLAYBOOK__
......
......@@ -29,15 +29,22 @@ if ("$ENV{QNX_HOST}" STREQUAL "")
message(FATAL_ERROR "Some environment variables need to be defined by using the bbndk-env*.sh delivered with the bbndk.")
endif()
file(GLOB COMPILER_PATH $ENV{QNX_HOST}/usr/bin/i486-pc-nto-qnx*-gcc)
if("${COMPILER_PATH}" STREQUAL "")
message(FATAL_ERROR "Could not find compiler")
endif()
get_filename_component(COMPILER_NAME ${COMPILER_PATH} NAME)
string(REGEX REPLACE "-gcc$" "" LINPHONE_BUILDER_TOOLCHAIN_PATH ${COMPILER_PATH})
string(REGEX REPLACE "-gcc$" "" LINPHONE_BUILDER_TOOLCHAIN_HOST ${COMPILER_NAME})
set(LINPHONE_BUILDER_TOOLCHAIN_HOST "i486-pc-nto-qnx8.0.0")
set(LINPHONE_BUILDER_TOOLCHAIN_CC "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-gcc")
set(LINPHONE_BUILDER_TOOLCHAIN_CXX "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-g++")
set(LINPHONE_BUILDER_TOOLCHAIN_LD "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ld")
set(LINPHONE_BUILDER_TOOLCHAIN_AR "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ar")
set(LINPHONE_BUILDER_TOOLCHAIN_RANLIB "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-ranlib")
set(LINPHONE_BUILDER_TOOLCHAIN_STRIP "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-strip")
set(LINPHONE_BUILDER_TOOLCHAIN_NM "${LINPHONE_BUILDER_TOOLCHAIN_HOST}-nm")
set(LINPHONE_BUILDER_TOOLCHAIN_CC "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-gcc")
set(LINPHONE_BUILDER_TOOLCHAIN_CXX "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-g++")
set(LINPHONE_BUILDER_TOOLCHAIN_LD "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ld")
set(LINPHONE_BUILDER_TOOLCHAIN_AR "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ar")
set(LINPHONE_BUILDER_TOOLCHAIN_RANLIB "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-ranlib")
set(LINPHONE_BUILDER_TOOLCHAIN_STRIP "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-strip")
set(LINPHONE_BUILDER_TOOLCHAIN_NM "${LINPHONE_BUILDER_TOOLCHAIN_PATH}-nm")
set(LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS "-D_REENTRANT -D__QNXNTO__ -Dasm=__asm")
#-D__PLAYBOOK__
......
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