Author: jgardou
Date: Fri Oct 8 10:46:54 2010
New Revision: 49049
URL:
http://svn.reactos.org/svn/reactos?rev=49049&view=rev
Log:
[CMAKE]
- add gcc dependencies to executables, not to mingw_(w)main
[STLPORT]
- move features definitions where it belongs.
[SDK]
- errno _must_ be defined in errno.h, nowhere else, or stlport headers choke.
Modified:
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/include/crt/stdlib.h
branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt
branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/user_config.h
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=490…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Fri Oct 8 10:46:54 2010
@@ -17,9 +17,6 @@
# Compiler Core
add_definitions(-pipe -fms-extensions)
-# stlport special
-add_definitions(-D_STLP_GCC_USES_GNU_LD)
-
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER>
<CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER>
<CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS>
<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS>
<LINK_LIBRARIES>")
@@ -35,6 +32,14 @@
# Optimizations
add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
+
+#linkage hell...
+add_library(gcc STATIC IMPORTED)
+set_target_properties(gcc PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libgcc.a
+ IMPORTED_LINK_INTERFACE_LIBRARIES "mingw_common -lkernel32")
+add_library(supc++ STATIC IMPORTED)
+set_target_properties(supc++ PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libsupc++.a
+ IMPORTED_LINK_INTERFACE_LIBRARIES "gcc -lmsvcrt")
# Macros
macro(set_entrypoint MODULE ENTRYPOINT)
@@ -81,7 +86,7 @@
else()
target_link_libraries(${MODULE} mingw_wmain)
endif(NOT IS_UNICODE)
- target_link_libraries(${MODULE} mingw_common)
+ target_link_libraries(${MODULE} mingw_common gcc)
endif()
if(${TYPE} MATCHES win32cui)
set_subsystem(${MODULE} console)
@@ -91,7 +96,7 @@
else()
target_link_libraries(${MODULE} mingw_wmain)
endif(NOT IS_UNICODE)
- target_link_libraries(${MODULE} mingw_common)
+ target_link_libraries(${MODULE} mingw_common gcc)
endif()
if(${TYPE} MATCHES win32dll)
set_entrypoint(${MODULE} DllMain@12)
@@ -137,14 +142,3 @@
endforeach()
add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
endmacro()
-
-#linkage hell...
-add_library(msvcrt_imp SHARED IMPORTED)
-set_target_properties(msvcrt_imp PROPERTIES IMPORTED_IMPLIB
${REACTOS_SOURCE_DIR}/importlibs/libmsvcrt.a)
-add_library(gcc STATIC IMPORTED)
-set_target_properties(gcc PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libgcc.a
- IMPORTED_LINK_INTERFACE_LIBRARIES "mingw_common -lkernel32")
-add_library(supc++ STATIC IMPORTED)
-set_target_properties(supc++ PROPERTIES IMPORTED_LOCATION
${REACTOS_SOURCE_DIR}/importlibs/libsupc++.a
- IMPORTED_LINK_INTERFACE_LIBRARIES "gcc -lmsvcrt")
-
Modified: branches/cmake-bringup/include/crt/stdlib.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/stdli…
==============================================================================
--- branches/cmake-bringup/include/crt/stdlib.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/stdlib.h [iso-8859-1] Fri Oct 8 10:46:54 2010
@@ -134,13 +134,7 @@
_invalid_parameter_handler __cdecl
_set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
_invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void);
-#ifndef _CRT_ERRNO_DEFINED
-#define _CRT_ERRNO_DEFINED
- _CRTIMP extern int *__cdecl _errno(void);
-#define errno (*_errno())
- errno_t __cdecl _set_errno(int _Value);
- errno_t __cdecl _get_errno(int *_Value);
-#endif
+#include <errno.h>
_CRTIMP unsigned long *__cdecl __doserrno(void);
#define _doserrno (*__doserrno())
errno_t __cdecl _set_doserrno(unsigned long _Value);
Modified: branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/ming…
==============================================================================
--- branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/3rdparty/mingw/CMakeLists.txt [iso-8859-1] Fri Oct 8
10:46:54 2010
@@ -57,10 +57,6 @@
set_property(TARGET mingw_wmain PROPERTY COMPILE_DEFINITIONS WPRFLAG UNICODE _UNICODE)
add_dependencies(mingw_wmain psdk)
-#hack : this way, every executable will be linked to libgcc
-target_link_libraries(mingw_main gcc)
-target_link_libraries(mingw_wmain gcc)
-
add_library(mingw_dllmain crtdll.c dllargv.c)
add_dependencies(mingw_dllmain psdk)
Modified: branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/user_config.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/3rdparty/stlp…
==============================================================================
--- branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/user_config.h
[iso-8859-1] (original)
+++ branches/cmake-bringup/lib/3rdparty/stlport/stlport/stl/config/user_config.h
[iso-8859-1] Fri Oct 8 10:46:54 2010
@@ -157,9 +157,9 @@
* It is being put in this file as there is no way to check if we are using GNU ld
automatically,
* so it becomes user's responsibility.
*/
-/*
-#define _STLP_GCC_USES_GNU_LD
-*/
+#ifdef __MINGW32__
+# define _STLP_GCC_USES_GNU_LD
+#endif
/*==========================================================
* Compatibility section