diff --git a/.travis.yml b/.travis.yml index 8f3f68ce3..131e4e5ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ script: "python tools/run-tests.py $OPTS" env: - OPTS="--check-signed-off --check-cppcheck --check-vera" - OPTS="--jerry-tests --jerry-test-suite" - - OPTS="--jerry-tests --jerry-test-suite --toolchain=cmake/toolchain_linux_armv7l-hf.cmake" TIMEOUT=300 + - OPTS="--jerry-tests --jerry-test-suite --toolchain=cmake/toolchain_linux_armv7l.cmake" TIMEOUT=300 - OPTS=--buildoption-test - OPTS=--unittests diff --git a/cmake/toolchain_linux_armv7l-hf.cmake b/cmake/toolchain_linux_armv7l.cmake similarity index 95% rename from cmake/toolchain_linux_armv7l-hf.cmake rename to cmake/toolchain_linux_armv7l.cmake index 12aa58313..e1d5fa118 100644 --- a/cmake/toolchain_linux_armv7l-hf.cmake +++ b/cmake/toolchain_linux_armv7l.cmake @@ -13,7 +13,7 @@ # limitations under the License. set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR armv7l-hf) +set(CMAKE_SYSTEM_PROCESSOR armv7l) set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) # diff --git a/cmake/toolchain_mcu_stm32f3.cmake b/cmake/toolchain_mcu_stm32f3.cmake index ae97427b3..d93fd0aa4 100644 --- a/cmake/toolchain_mcu_stm32f3.cmake +++ b/cmake/toolchain_mcu_stm32f3.cmake @@ -15,7 +15,7 @@ include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME MCU) -set(CMAKE_SYSTEM_PROCESSOR armv7l-hf) +set(CMAKE_SYSTEM_PROCESSOR armv7l) set(CMAKE_SYSTEM_VERSION STM32F3) set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard) diff --git a/cmake/toolchain_mcu_stm32f4.cmake b/cmake/toolchain_mcu_stm32f4.cmake index 7b7ca7c6b..03a47bd4d 100644 --- a/cmake/toolchain_mcu_stm32f4.cmake +++ b/cmake/toolchain_mcu_stm32f4.cmake @@ -15,7 +15,7 @@ include(CMakeForceCompiler) set(CMAKE_SYSTEM_NAME MCU) -set(CMAKE_SYSTEM_PROCESSOR armv7l-hf) +set(CMAKE_SYSTEM_PROCESSOR armv7l) set(CMAKE_SYSTEM_VERSION STM32F4) set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard) diff --git a/docs/01.GETTING-STARTED.md b/docs/01.GETTING-STARTED.md index 8db41d293..b2bce19d2 100644 --- a/docs/01.GETTING-STARTED.md +++ b/docs/01.GETTING-STARTED.md @@ -74,7 +74,7 @@ python tools/build.py --toolchain=TOOLCHAIN For example the cross-compile to RaspberryPi 2 is something like this: ```bash -python tools/build.py --toolchain=cmake/toolchain_linux_armv7l-hf.cmake +python tools/build.py --toolchain=cmake/toolchain_linux_armv7l.cmake ``` ##### To get a list of all the available buildoptions for Linux: diff --git a/jerry-libc/CMakeLists.txt b/jerry-libc/CMakeLists.txt index 3b7e2b8bc..a634cb401 100644 --- a/jerry-libc/CMakeLists.txt +++ b/jerry-libc/CMakeLists.txt @@ -20,7 +20,7 @@ project (${JERRY_LIBC_NAME} C ASM) # Architecture-specific configuration if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_x64) -elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l-hf") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l") set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_HARD_FLOAT) elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l-el") set(DEFINES_LIBC ${DEFINES_LIBC} __TARGET_HOST_ARMv7 __TARGET_HOST_ARMv7_SOFT_FLOAT) diff --git a/targets/nuttx-stm32f4/Makefile.nuttx b/targets/nuttx-stm32f4/Makefile.nuttx index 972391e4d..da8327743 100644 --- a/targets/nuttx-stm32f4/Makefile.nuttx +++ b/targets/nuttx-stm32f4/Makefile.nuttx @@ -40,7 +40,7 @@ all: -DENABLE_LTO=OFF \ -DENABLE_VALGRIND=OFF \ -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_external.cmake \ - -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l-hf \ + -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l \ -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \ -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \ -DEXTERNAL_BUILD_ENTRY_FILE=./targets/nuttx-stm32f4/main-nuttx.c \ diff --git a/targets/riot-stm32f4/Makefile.riot b/targets/riot-stm32f4/Makefile.riot index 29d4e352c..c9953f353 100644 --- a/targets/riot-stm32f4/Makefile.riot +++ b/targets/riot-stm32f4/Makefile.riot @@ -37,7 +37,7 @@ libjerry: -DJERRY_CMDLINE=OFF \ -DCOMPILER_DEFAULT_LIBC=ON \ -DENABLE_ALL_IN_ONE=OFF \ - -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l-hf \ + -DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=armv7l \ -DEXTERNAL_CMAKE_C_COMPILER=arm-none-eabi-gcc \ -DEXTERNAL_CMAKE_C_COMPILER_ID=GNU \ -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \ diff --git a/tools/build.py b/tools/build.py index 66a6a2105..e93b4233f 100755 --- a/tools/build.py +++ b/tools/build.py @@ -19,11 +19,16 @@ import argparse import shutil import subprocess import sys -from os import makedirs +from os import makedirs, uname from settings import * BUILD_DIR = path.join(PROJECT_DIR, 'build') +def default_toolchain(): + (sysname, _, _, _, machine) = uname() + toolchain = path.join(PROJECT_DIR, 'cmake', 'toolchain_%s_%s.cmake' % (sysname.lower(), machine.lower())) + return toolchain if path.isfile(toolchain) else None + def add_build_args(parser): parser.add_argument('--verbose', '-v', action='store_const', const='ON', default='OFF', help='Increase verbosity') parser.add_argument('--unittests', action='store_const', const='ON', default='OFF', help='Build unittests too') @@ -45,7 +50,7 @@ def add_build_args(parser): parser.add_argument('--cmake-param', action='append', default=[], help='Add custom arguments to CMake') parser.add_argument('--compile-flag', action='append', default=[], help='Add custom compile flag') parser.add_argument('--linker-flag', action='append', default=[], help='Add custom linker flag') - parser.add_argument('--toolchain', action='store', default='', help='Add toolchain file') + parser.add_argument('--toolchain', action='store', default=default_toolchain(), help='Add toolchain file (default: %(default)s)') parser.add_argument('--jerry-libc', choices=['on', 'off'], default='on', help='Use jerry-libc (default: %(default)s)') parser.add_argument('--compiler-default-libc', choices=['on', 'off'], default='off', help='Use compiler-default libc (default: %(default)s)') parser.add_argument('--jerry-core', choices=['on', 'off'], default='on', help='Use jerry-core (default: %(default)s)')