Commit 2e4c3a62 authored by Klint Youngmeyer's avatar Klint Youngmeyer
Browse files

Add i586 toolchain, selector file, and location file example

parent 0044ac09
The toolchain_loc.cmake file will need to be auto-generated by the installer.
When an EMAC project is run with cmake, the CMakeLists.txt file will run the
toolchain-selector.cmake file, which sources the toolchain_loc.cmake file, which
holds the location of the various toolchains.
if(EXISTS "/etc/emac/toolchain_loc.cmake")
include(/etc/emac/toolchain_loc.cmake)
else()
MESSAGE(FATAL_ERROR "ERROR: Toolchain location file could not be found at /etc/emac/toolchain_loc.cmake")
endif()
if(DEFINED ARCH)
else()
SET(ARCH "def")
endif()
if(DEFINED REMOTE)
else()
SET(REMOTE "/tmp\n")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release
MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
if(${ARCH} STREQUAL "i586")
if(EXISTS ${TC_i586_LOC})
SET(CMAKE_TOOLCHAIN_FILE ${TC_i586_LOC})
else()
MESSAGE(FATAL_ERROR "Warning: i586 toolchain is not installed")
endif()
elseif(${ARCH} STREQUAL "core2")
if(EXISTS ${TC_core2_LOC})
SET(CMAKE_TOOLCHAIN_FILE ${TC_core2_LOC})
else()
MESSAGE(FATAL_ERROR "Warning: core2 toolchain is not installed")
endif()
elseif(${ARCH} STREQUAL "armv5")
if(EXISTS ${TC_ARMV5_LOC})
SET(CMAKE_TOOLCHAIN_FILE ${TC_ARMV5_LOC})
else()
MESSAGE(FATAL_ERROR "Warning: armv5 toolchain is not installed")
endif()
elseif(${ARCH} STREQUAL "armv7")
if(EXISTS ${TC_ARMV7_LOC})
SET(CMAKE_TOOLCHAIN_FILE ${TC_ARMV7_LOC})
else()
MESSAGE(FATAL_ERROR "Warning: armv7 toolchain is not installed")
endif()
elseif(${ARCH} STREQUAL "def")
MESSAGE(STATUS "Using system compiler")
else()
MESSAGE(FATAL_ERROR "ERROR: Not a valid toolchain name. Options are: i586, core2, armv5, and armv7")
endif()
......@@ -6,9 +6,9 @@ SET(TC_ARMV5_VERSION ${TC_ARMV5_MAJOR_VERSION}.${TC_ARMV5_MINOR_VERSION}.${TC_AR
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0/sysroots/armv5te-emac-linux-gnueabi/)
SET(CMAKE_C_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0.0/sysroots/armv5te-emac-linux-gnueabi/)
SET(CMAKE_C_FLAGS " -march=armv5te -marm -mthumb-interwork -pipe -feliminate-unused-debug-types -Wall -MMD")
SET(CMAKE_CXX_FLAGS " -march=armv5te -marm -mthumb-interwork -pipe -feliminate-unused-debug-types -fpermissive -Wall -MMD")
......
......@@ -6,9 +6,9 @@ SET(TC_ARMV7_VERSION ${TC_ARMV7_MAJOR_VERSION}.${TC_ARMV7_MINOR_VERSION}.${TC_AR
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0/sysroots/armv7a-vfp-neon-emac-linux-gnueabi/)
SET(CMAKE_C_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/arm-emac-linux-gnueabi/arm-emac-linux-gnueabi-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0.0/sysroots/armv7a-vfp-neon-emac-linux-gnueabi/)
SET(CMAKE_C_FLAGS " -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -pipe -feliminate-unused-debug-types -Wall -MMD")
SET(CMAKE_CXX_FLAGS " -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -pipe -feliminate-unused-debug-types -fpermissive -Wall -MMD")
......
#Version Information
SET(TC_X86_MAJOR_VERSION 1)
SET(TC_X86_MINOR_VERSION 0)
SET(TC_X86_PATCH_VERSION 0)
SET(TC_X86_VERSION ${TC_X86_MAJOR_VERSION}.${TC_X86_MINOR_VERSION}.${TC_X86_PATCH_VERSION})
SET(TC_CORE2_MAJOR_VERSION 1)
SET(TC_CORE2_MINOR_VERSION 0)
SET(TC_CORE2_PATCH_VERSION 0)
SET(TC_CORE2_VERSION ${TC_CORE2_MAJOR_VERSION}.${TC_CORE2_MINOR_VERSION}.${TC_CORE2_PATCH_VERSION})
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0/sysroots/core2-emac-linux/)
SET(CMAKE_C_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0.0/sysroots/core2-emac-linux/)
SET(CMAKE_C_FLAGS " -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse -pipe -feliminate-unused-debug-types -Wall -MMD")
SET(CMAKE_CXX_FLAGS " -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse -pipe -feliminate-unused-debug-types -fpermissive -Wall -MMD")
......
#Version Information
SET(TC_I586_MAJOR_VERSION 1)
SET(TC_I586_MINOR_VERSION 0)
SET(TC_I586_PATCH_VERSION 0)
SET(TC_I586_VERSION ${TC_I586_MAJOR_VERSION}.${TC_I586_MINOR_VERSION}.${TC_I586_PATCH_VERSION})
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/emac/5.0.0/sysroots/i686-emacsdk-linux/usr/bin/i586-emac-linux/i586-emac-linux-g++)
SET(CMAKE_FIND_ROOT_PATH /opt/emac/5.0.0/sysroots/core2-emac-linux/)
SET(CMAKE_C_FLAGS " -m32 -march=i586 -pipe -feliminate-unused-debug-types -Wall -MMD")
SET(CMAKE_CXX_FLAGS " -m32 -march=i586 -pipe -feliminate-unused-debug-types -fpermissive -Wall -MMD")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ${CMAKE_C_FLAGS}")
SET(CMAKE_C_FLAGS_RELEASE "-O2 -s ${CMAKE_C_FLAGS}")
SET(CMAKE_C_FLAGS_MINSIZEREL "-O3 -s ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g ${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -s ${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O3 -s ${CMAKE_CXX_FLAGS}")
#Custom Build Config
SET(CMAKE_C_FLAGS_CUSTOM "-O1 -s ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_CUSTOM "-O1 -s ${CMAKE_CXX_FLAGS}")
###
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s") ## Strip binary for RELEASE
#Toolchain file locations
#Locations subject to change
SET(TC_ARMV5_LOC /opt/emac/5.0.0/toolchain.armv5te.cmake)
SET(TC_ARMV7_LOC /opt/emac/5.0.0/toolchain.armv7a.cmake)
SET(TC_i586_LOC /opt/emac/5.0.0/toolchain.i586.cmake)
SET(TC_core2_LOC /opt/emac/5.0.0/toolchain.core2.cmake)
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