Author: akhaldi Date: Thu Jan 6 16:57:56 2011 New Revision: 50300
URL: http://svn.reactos.org/svn/reactos?rev=50300&view=rev Log: [CMAKE] - Initial support of the arm toolchain/build.
Added: branches/cmake-bringup/config-arm.cmake Modified: branches/cmake-bringup/CMakeLists.txt branches/cmake-bringup/gcc.cmake branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt branches/cmake-bringup/toolchain-mingw32.cmake
Modified: branches/cmake-bringup/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeLists.txt?rev... ============================================================================== --- branches/cmake-bringup/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/CMakeLists.txt [iso-8859-1] Thu Jan 6 16:57:56 2011 @@ -11,17 +11,18 @@ include(config.cmake) elseif(ARCH MATCHES amd64) include(config-amd64.cmake) +elseif(ARCH MATCHES arm) + include(config-arm.cmake) endif()
if(NOT CMAKE_CROSSCOMPILING)
+ add_definitions(-DTARGET_${ARCH}) + if(ARCH MATCHES i386) - add_definitions(-DTARGET_i386) if(MSVC) add_definitions(-Dinline=__inline) endif() - elseif(ARCH MATCHES amd64) - add_definitions(-DTARGET_amd64) endif()
include_directories( @@ -117,6 +118,9 @@ add_definitions(-D_M_IX86 -D_X86_ -D__i386__) elseif(ARCH MATCHES amd64) add_definitions(-D_M_AMD64 -D_AMD64_ -D_M_AXP64 -D__x86_64__ -D_WIN64) + elseif(ARCH MATCHES arm) + # _M_ARM is already defined by toolchain + add_definitions(-D_ARM_ -D__arm__) endif()
# Other @@ -124,6 +128,8 @@ add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T) elseif(ARCH MATCHES amd64) add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX) + elseif(ARCH MATCHES arm) + add_definitions(-DUSE_COMPILER_EXCEPTIONS) endif()
include_directories( @@ -140,6 +146,10 @@ include/reactos include/reactos/libs)
+ if(ARCH MATCHES arm) + include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm) + endif() + if(MSVC) include_directories(include/crt/msc) else()
Added: branches/cmake-bringup/config-arm.cmake URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/config-arm.cmake?r... ============================================================================== --- branches/cmake-bringup/config-arm.cmake (added) +++ branches/cmake-bringup/config-arm.cmake [iso-8859-1] Thu Jan 6 16:57:56 2011 @@ -1,0 +1,46 @@ + +set(SARCH "omap3-zoom2" CACHE STRING +"Sub-architecture (board) to build for. Specify one of: + kurobox versatile omap3-zoom2 omap3-beagle") + +set(OARCH "armv7-a" CACHE STRING +"Generate instructions for this CPU type. Specify one of: + armv5te armv7-a") + +set (OPTIMIZE "1" CACHE STRING +"What level of optimisation to use. + 0 = off + 1 = Default option, optimize for size (-Os) with some additional options + 2 = -Os + 3 = -O1 + 4 = -O2 + 5 = -O3") + +set(DBG TRUE CACHE BOOL +"Whether to compile for debugging.") + +set(KDBG FALSE CACHE BOOL +"Whether to compile in the integrated kernel debugger.") + +set(GDB FALSE CACHE BOOL +"Whether to compile for debugging with GDB. +If you don't use GDB, don't enable this.") + +set(_WINKD_ TRUE CACHE BOOL +"Whether to compile with the KD protocol.") + +set(_ELF_ FALSE CACHE BOOL +"Whether to compile support for ELF files. +Do not enable unless you know what you're doing.") + +set(NSWPAT FALSE CACHE BOOL +"Whether to compile apps/libs with features covered software patents or not. +If you live in a country where software patents are valid/apply, don't +enable this (except they/you purchased a license from the patent owner). +This settings is disabled (0) by default.") + +set(BUILD_MP TRUE CACHE BOOL +"Whether to compile the multi processor versions for ntoskrnl and hal.") + +set(NEWSPRINTF FALSE CACHE BOOL +"Whether to compile the new sprintf.")
Modified: branches/cmake-bringup/gcc.cmake URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=5030... ============================================================================== --- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Thu Jan 6 16:57:56 2011 @@ -26,7 +26,7 @@ # Tuning if(ARCH MATCHES i386) add_definitions(-march=${OARCH} -mtune=${TUNE}) -elseif(ARCH MATCHES amd64) +else() add_definitions(-march=${OARCH}) endif()
Modified: branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/sdk/crt/CMakeL... ============================================================================== --- branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt [iso-8859-1] Thu Jan 6 16:57:56 2011 @@ -31,7 +31,6 @@ except/cppexcept.c except/except.c except/matherr.c - except/${ARCH}/seh.s except/xcptfil.c float/chgsign.c float/copysign.c @@ -141,7 +140,6 @@ search/bsearch.c search/lfind.c search/lsearch.c - setjmp/${ARCH}/setjmp.s signal/signal.c signal/xcptinfo.c stdio/access.c @@ -281,6 +279,11 @@ wine/heap.c wine/undname.c)
+if(NOT ARCH MATCHES arm) +list(APPEND CRT_SOURCE + except/${ARCH}/seh.s) +endif() + if(ARCH MATCHES i386) list(APPEND CRT_SOURCE except/i386/chkstk_asm.s @@ -290,7 +293,8 @@ float/i386/cntrlfp.c float/i386/fpreset.c float/i386/logb.c - float/i386/statfp.c) + float/i386/statfp.c + setjmp/i386/setjmp.s) elseif(ARCH MATCHES amd64) list(APPEND CRT_SOURCE except/amd64/chkstk_asm.s @@ -298,8 +302,9 @@ float/i386/cntrlfp.c float/i386/fpreset.c float/i386/logb.c - float/i386/statfp.c) -endif(ARCH MATCHES i386) + float/i386/statfp.c + setjmp/amd64/setjmp.s) +endif()
if(ARCH MATCHES i386) list(APPEND CRT_SOURCE @@ -384,7 +389,7 @@ string/wcsncpy.c string/wcsnlen.c string/wcsrchr.c) -endif(ARCH MATCHES i386) +endif()
if(ARCH MATCHES amd64) list(APPEND CRT_SOURCE @@ -408,7 +413,7 @@ math/amd64/sqrt.S math/amd64/sqrtf.S math/amd64/tan.S) -endif(ARCH MATCHES amd64) +endif()
add_library(crt ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch ${CRT_SOURCE})
@@ -417,8 +422,6 @@ add_dependencies(crt psdk buildno_header asm)
list(APPEND LIBCNTPR_SOURCE - except/${ARCH}/chkstk_asm.s - except/${ARCH}/seh.s math/abs.c math/div.c math/labs.c @@ -428,7 +431,6 @@ mem/memicmp.c search/bsearch.c search/lfind.c - setjmp/${ARCH}/setjmp.s stdlib/qsort.c string/ctype.c string/scanf.c @@ -467,6 +469,13 @@ wstring/wcscspn.c wstring/wcsspn.c wstring/wcsstr.c) + +if(NOT ARCH MATCHES arm) +list(APPEND LIBCNTPR_SOURCE + except/${ARCH}/chkstk_asm.s + except/${ARCH}/seh.s + setjmp/${ARCH}/setjmp.s) +endif()
if(ARCH MATCHES i386) list(APPEND LIBCNTPR_SOURCE @@ -512,7 +521,7 @@ math/amd64/pow.S math/amd64/sqrt.S math/amd64/tan.S) -endif(ARCH MATCHES i386) +endif()
if(ARCH MATCHES i386) list(APPEND LIBCNTPR_SOURCE @@ -565,7 +574,7 @@ string/wcsncpy.c string/wcsnlen.c string/wcsrchr.c) -endif(ARCH MATCHES i386) +endif()
add_library(libcntpr ${LIBCNTPR_SOURCE}) set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE)
Modified: branches/cmake-bringup/toolchain-mingw32.cmake URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-mingw32.... ============================================================================== --- branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] Thu Jan 6 16:57:56 2011 @@ -14,6 +14,8 @@
elseif(ARCH MATCHES amd64) set(MINGW_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Prefix") +elseif(ARCH MATCHES arm) + set(MINGW_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Prefix") endif()
if(ENABLE_CCACHE) @@ -38,6 +40,8 @@ set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m32 --win32 -h -o <OBJECT> <SOURCE>") elseif(ARCH MATCHES amd64) set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -m64 --win64 -h -o <OBJECT> <SOURCE>") +elseif(ARCH MATCHES arm) +set(CMAKE_IDL_COMPILE_OBJECT "<CMAKE_IDL_COMPILER> <FLAGS> <DEFINES> -h -o <OBJECT> <SOURCE>") endif()
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT> ")