diff --git a/CMakeLists.txt b/CMakeLists.txt index 44073c18050..f46358f0cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,17 +11,18 @@ if(ARCH MATCHES i386) 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 @@ if(CMAKE_CROSSCOMPILING) 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 @@ if(CMAKE_CROSSCOMPILING) 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 @@ if(CMAKE_CROSSCOMPILING) 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() diff --git a/config-arm.cmake b/config-arm.cmake new file mode 100644 index 00000000000..02ae1497e36 --- /dev/null +++ b/config-arm.cmake @@ -0,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.") diff --git a/gcc.cmake b/gcc.cmake index 5c2a4110af9..563ef56a060 100644 --- a/gcc.cmake +++ b/gcc.cmake @@ -26,7 +26,7 @@ add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unus # Tuning if(ARCH MATCHES i386) add_definitions(-march=${OARCH} -mtune=${TUNE}) -elseif(ARCH MATCHES amd64) +else() add_definitions(-march=${OARCH}) endif() diff --git a/lib/sdk/crt/CMakeLists.txt b/lib/sdk/crt/CMakeLists.txt index 0d2c9842963..04173629a97 100644 --- a/lib/sdk/crt/CMakeLists.txt +++ b/lib/sdk/crt/CMakeLists.txt @@ -31,7 +31,6 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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 @@ list(APPEND CRT_SOURCE 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_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE}) 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 @@ list(APPEND LIBCNTPR_SOURCE mem/memicmp.c search/bsearch.c search/lfind.c - setjmp/${ARCH}/setjmp.s stdlib/qsort.c string/ctype.c string/scanf.c @@ -468,6 +470,13 @@ list(APPEND LIBCNTPR_SOURCE 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 math/i386/alldiv_asm.s @@ -512,7 +521,7 @@ list(APPEND LIBCNTPR_SOURCE 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 @@ list(APPEND LIBCNTPR_SOURCE 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) diff --git a/toolchain-mingw32.cmake b/toolchain-mingw32.cmake index 5e9d0e519fe..1d209222175 100644 --- a/toolchain-mingw32.cmake +++ b/toolchain-mingw32.cmake @@ -14,6 +14,8 @@ if(ARCH MATCHES i386) 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 @@ if(ARCH MATCHES i386) set(CMAKE_IDL_COMPILE_OBJECT " -m32 --win32 -h -o ") elseif(ARCH MATCHES amd64) set(CMAKE_IDL_COMPILE_OBJECT " -m64 --win64 -h -o ") +elseif(ARCH MATCHES arm) +set(CMAKE_IDL_COMPILE_OBJECT " -h -o ") endif() set(CMAKE_RC_COMPILE_OBJECT " -i -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 ")