[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Aug 2010 10:41:24 +0000 (10:41 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Aug 2010 10:41:24 +0000 (10:41 +0000)
- Sync the recent crt changes from trunk.
- Improve crt build.

svn path=/branches/cmake-bringup/; revision=48541

lib/sdk/crt/CMakeLists.txt
lib/sdk/crt/locale/locale.c

index c12f3e2..bd1c60c 100644 (file)
@@ -4,10 +4,66 @@ include_directories(include)
 add_definitions(-D_CRTBLD)
 
 file(GLOB_RECURSE CRT_SOURCE "*.c")
 add_definitions(-D_CRTBLD)
 
 file(GLOB_RECURSE CRT_SOURCE "*.c")
-LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdio/findgen.c)
-LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strtold.c)
 
 
-add_library(crt ${CRT_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch)
+if(NOT ARCH MATCHES i386)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/except/i386/unwind.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/*.c)
+if(NOT ARCH MATCHES amd64)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/float/i386/*.c)
+endif(NOT ARCH MATCHES amd64)
+else(NOT ARCH MATCHES i386)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/stubs.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/mem/memchr.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/mem/memcpy.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/mem/memmove.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/mem/memset.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strcat.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strchr.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strcmp.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strcpy.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strlen.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strncat.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strncmp.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strncpy.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strnlen.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strrchr.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcscat.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcschr.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcscmp.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcscpy.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcslen.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcsncat.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcsncmp.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcsncpy.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcsnlen.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcsrchr.c)
+endif(NOT ARCH MATCHES i386)
+
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/abs.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/cos.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/j0_y0.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/j1_y1.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/jn_yn.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/labs.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/rand_nt.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/math/sin.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdio/findgen.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdlib/atold.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdlib/malloc.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/mbstowcs_nt.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strtold.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/wcstombs_nt.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/witoa.c)
+list(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/witow.c)
+
+file(GLOB_RECURSE CRT_ASM_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/except/${ARCH}/*.s" 
+                                 "${CMAKE_CURRENT_SOURCE_DIR}/math/${ARCH}/*.s"
+                                 "${CMAKE_CURRENT_SOURCE_DIR}/mem/${ARCH}/*.s"
+                                 "${CMAKE_CURRENT_SOURCE_DIR}/string/${ARCH}/*.s"
+                                 "${CMAKE_CURRENT_SOURCE_DIR}/setjmp/${ARCH}/*.s")
+
+add_library(crt ${CRT_SOURCE} ${CRT_ASM_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch)
+
 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT)
 add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
 add_dependencies(crt psdk)
 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT)
 add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
 add_dependencies(crt psdk)
index 7e7b1af..b5aa7f1 100644 (file)
@@ -755,38 +755,20 @@ int CDECL _setmbcp(int cp)
 
 
 /*********************************************************************
 
 
 /*********************************************************************
- *             __lc_collate_cp (MSVCRT.@)
- *
- * @unimplemented
+ *      ___lc_handle_func (MSVCRT.@)
  */
  */
-void __lc_collate_cp(int cp)
+HANDLE * CDECL ___lc_handle_func(void)
 {
 {
-FIXME("__lc_collate_cp - stub\n");
-return;
+    return MSVCRT___lc_handle;
 }
 
 
 /*********************************************************************
 }
 
 
 /*********************************************************************
- *             __lc_handle (MSVCRT.@)
- *
- * @unimplemented
+ *      ___lc_codepage_func (MSVCRT.@)
  */
  */
-void __lc_handle(void)
+int CDECL ___lc_codepage_func(void)
 {
 {
-FIXME("__lc_handle - stub\n");
-return;
-}
-
-
-/*********************************************************************
- *             __lc_codepage (MSVCRT.@)
- *
- * @unimplemented
- */
-void __lc_codepage(void)
-{
-FIXME("__lc_codepage - stub\n");
-return;
+    return MSVCRT___lc_codepage;
 }
 
 
 }