diff --git a/CMakeLists.txt b/CMakeLists.txt index 6536f27bb35..c76289b1f86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,8 @@ include_directories(include/ndk) include_directories(include/reactos) include_directories(include/reactos/libs) +include_directories(BEFORE lib/3rdparty/stlport/stlport) + add_subdirectory(include/psdk) add_subdirectory(include/dxsdk) add_subdirectory(include/reactos/idl) diff --git a/base/applications/games/solitaire/CMakeLists.txt b/base/applications/games/solitaire/CMakeLists.txt index fc41803bfcf..6912fbd6789 100644 --- a/base/applications/games/solitaire/CMakeLists.txt +++ b/base/applications/games/solitaire/CMakeLists.txt @@ -9,7 +9,8 @@ add_executable(sol solitaire.cpp rsrc.rc) -target_link_libraries(sol cardlib) +target_link_libraries(sol stlport cardlib) set_module_type(sol win32gui) -add_importlibs(sol advapi32 comctl32 user32 gdi32 stdc++ gcc mingw32 msvcrt) + +add_importlibs(sol advapi32 comctl32 user32 gdi32 msvcrt) diff --git a/base/applications/network/telnet/CMakeLists.txt b/base/applications/network/telnet/CMakeLists.txt index cd1100e5e80..7ca9b8c6c95 100644 --- a/base/applications/network/telnet/CMakeLists.txt +++ b/base/applications/network/telnet/CMakeLists.txt @@ -22,6 +22,8 @@ add_executable(telnet src/ttelhndl.cpp telnet.rc) +target_link_libraries(telnet stlport) + set_module_type(telnet win32cui) add_importlibs(telnet ws2_32 user32 msvcrt) diff --git a/base/applications/sndrec32/CMakeLists.txt b/base/applications/sndrec32/CMakeLists.txt index 5d0d7c20a4c..cc10dfdb995 100644 --- a/base/applications/sndrec32/CMakeLists.txt +++ b/base/applications/sndrec32/CMakeLists.txt @@ -10,6 +10,8 @@ add_executable(sndrec32 sndrec32.cpp rsrc.rc) +target_link_libraries(sndrec32 stlport) + set_module_type(sndrec32 win32gui) add_importlibs(sndrec32 winmm user32 msacm32 comctl32 comdlg32 gdi32 msvcrt) diff --git a/gcc.cmake b/gcc.cmake index 80fe006eeed..5430309991e 100644 --- a/gcc.cmake +++ b/gcc.cmake @@ -1,136 +1,150 @@ - - -if(NOT CMAKE_CROSSCOMPILING) - -add_definitions(-fshort-wchar) - - -else() - -# Linking -link_directories("${REACTOS_SOURCE_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw) -set(CMAKE_C_LINK_EXECUTABLE " -o ") -set(CMAKE_CXX_LINK_EXECUTABLE " -o -lstdc++ -lsupc++ -lgcc -lmingwex -lmingw32 ") -set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at") -# -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds - -# Compiler Core -add_definitions(-pipe -fms-extensions) - -set(CMAKE_C_CREATE_SHARED_LIBRARY " -o ") - -set(CMAKE_RC_CREATE_SHARED_LIBRARY " -o ") - -# Debugging (Note: DWARF-4 on 4.5.1 when we ship) -#add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types) - -# Tuning -add_definitions(-march=pentium -mtune=i686) - -# Warnings -add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value -Winvalid-pch) - -# Optimizations -add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls) - -# Macros -macro(set_entrypoint MODULE ENTRYPOINT) - if(${ENTRYPOINT} STREQUAL "0") - set(NEW_LINKER_FLAGS "-Wl,-entry,0") - else() - set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}") - endif() - get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS) - if(LINKER_FLAGS) - set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}") - endif() - set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS}) -endmacro() - -macro(set_subsystem MODULE SUBSYSTEM) - set(NEW_LINKER_FLAGS "-Wl,--subsystem,${SUBSYSTEM}") - get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS) - if(LINKER_FLAGS) - set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}") - endif() - set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS}) -endmacro() - -macro(add_importlibs MODULE) - foreach(LIB ${ARGN}) - target_link_libraries(${MODULE} ${LIB}.a) - endforeach() -endmacro() - -macro(set_module_type MODULE TYPE) - - add_dependencies(${MODULE} psdk buildno_header) - - if(${TYPE} MATCHES nativecui) - set_subsystem(${MODULE} native) - set_entrypoint(${MODULE} NtProcessStartup@4) - endif() - if(${TYPE} MATCHES win32gui) - set_subsystem(${MODULE} windows) - set_entrypoint(${MODULE} WinMainCRTStartup) - if(NOT IS_UNICODE) - target_link_libraries(${MODULE} mingw_main) - else() - target_link_libraries(${MODULE} mingw_wmain) - endif(NOT IS_UNICODE) - target_link_libraries(${MODULE} mingw_common) - endif() - if(${TYPE} MATCHES win32cui) - set_subsystem(${MODULE} console) - set_entrypoint(${MODULE} mainCRTStartup) - if(NOT IS_UNICODE) - target_link_libraries(${MODULE} mingw_main) - else() - target_link_libraries(${MODULE} mingw_wmain) - endif(NOT IS_UNICODE) - target_link_libraries(${MODULE} mingw_common) - endif() - if(${TYPE} MATCHES win32dll) - set_entrypoint(${MODULE} DllMain@12) - endif() - if(${TYPE} MATCHES win32ocx) - set_entrypoint(${MODULE} DllMain@12) - set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx") - endif() -endmacro() - -endif() - -macro(set_unicode) - add_definitions(-DUNICODE -D_UNICODE) - set(IS_UNICODE 1) -endmacro() - -# Workaround lack of mingw RC support in cmake -macro(set_rc_compiler) - get_directory_property(defines COMPILE_DEFINITIONS) - get_directory_property(includes INCLUDE_DIRECTORIES) - - foreach(arg ${defines}) - set(result_defs "${result_defs} -D${arg}") - endforeach(arg ${defines}) - - foreach(arg ${includes}) - set(result_incs "-I${arg} ${result_incs}") - endforeach(arg ${includes}) - - set(CMAKE_RC_COMPILE_OBJECT " ${result_defs} ${result_incs} -i -O coff -o ") -endmacro() - -#typelib support -macro(ADD_TYPELIB TARGET) - foreach(SOURCE ${ARGN}) - get_filename_component(FILE ${SOURCE} NAME_WE) - set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb) - add_custom_command(OUTPUT ${OBJECT} - COMMAND native-widl -I${REACTOS_SOURCE_DIR}/include/dxsdk -I. -I${REACTOS_SOURCE_DIR}/include -I${REACTOS_SOURCE_DIR}/include/psdk -m32 --win32 -t -T ${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} - DEPENDS native-widl) - list(APPEND OBJECTS ${OBJECT}) - endforeach() - add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS}) -endmacro() + + +if(NOT CMAKE_CROSSCOMPILING) + +add_definitions(-fshort-wchar) + + +else() + +# Linking +link_directories("${REACTOS_SOURCE_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw) +set(CMAKE_C_LINK_EXECUTABLE " -o ") +set(CMAKE_CXX_LINK_EXECUTABLE " -o ") +set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at") +# -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds + +# Compiler Core +add_definitions(-pipe -fms-extensions) + +# stlport special +add_definitions(-D_STLP_GCC_USES_GNU_LD) + +set(CMAKE_C_CREATE_SHARED_LIBRARY " -o ") + +set(CMAKE_RC_CREATE_SHARED_LIBRARY " -o ") + +# Debugging (Note: DWARF-4 on 4.5.1 when we ship) +#add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types) + +# Tuning +add_definitions(-march=pentium -mtune=i686) + +# Warnings +add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value -Winvalid-pch) + +# Optimizations +add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls) + +# Macros +macro(set_entrypoint MODULE ENTRYPOINT) + if(${ENTRYPOINT} STREQUAL "0") + set(NEW_LINKER_FLAGS "-Wl,-entry,0") + else() + set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}") + endif() + get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS) + if(LINKER_FLAGS) + set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}") + endif() + set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS}) +endmacro() + +macro(set_subsystem MODULE SUBSYSTEM) + set(NEW_LINKER_FLAGS "-Wl,--subsystem,${SUBSYSTEM}") + get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS) + if(LINKER_FLAGS) + set(NEW_LINKER_FLAGS "${LINKER_FLAGS} ${NEW_LINKER_FLAGS}") + endif() + set_target_properties(${MODULE} PROPERTIES LINK_FLAGS ${NEW_LINKER_FLAGS}) +endmacro() + +macro(add_importlibs MODULE) + foreach(LIB ${ARGN}) + target_link_libraries(${MODULE} ${LIB}.dll.a) + endforeach() +endmacro() + +macro(set_module_type MODULE TYPE) + + add_dependencies(${MODULE} psdk buildno_header) + + if(${TYPE} MATCHES nativecui) + set_subsystem(${MODULE} native) + set_entrypoint(${MODULE} NtProcessStartup@4) + endif() + if(${TYPE} MATCHES win32gui) + set_subsystem(${MODULE} windows) + set_entrypoint(${MODULE} WinMainCRTStartup) + if(NOT IS_UNICODE) + target_link_libraries(${MODULE} mingw_main) + else() + target_link_libraries(${MODULE} mingw_wmain) + endif(NOT IS_UNICODE) + target_link_libraries(${MODULE} mingw_common) + endif() + if(${TYPE} MATCHES win32cui) + set_subsystem(${MODULE} console) + set_entrypoint(${MODULE} mainCRTStartup) + if(NOT IS_UNICODE) + target_link_libraries(${MODULE} mingw_main) + else() + target_link_libraries(${MODULE} mingw_wmain) + endif(NOT IS_UNICODE) + target_link_libraries(${MODULE} mingw_common) + endif() + if(${TYPE} MATCHES win32dll) + set_entrypoint(${MODULE} DllMain@12) + endif() + if(${TYPE} MATCHES win32ocx) + set_entrypoint(${MODULE} DllMain@12) + set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx") + endif() +endmacro() + +endif() + +macro(set_unicode) + add_definitions(-DUNICODE -D_UNICODE) + set(IS_UNICODE 1) +endmacro() + +# Workaround lack of mingw RC support in cmake +macro(set_rc_compiler) + get_directory_property(defines COMPILE_DEFINITIONS) + get_directory_property(includes INCLUDE_DIRECTORIES) + + foreach(arg ${defines}) + set(result_defs "${result_defs} -D${arg}") + endforeach(arg ${defines}) + + foreach(arg ${includes}) + set(result_incs "-I${arg} ${result_incs}") + endforeach(arg ${includes}) + + set(CMAKE_RC_COMPILE_OBJECT " ${result_defs} ${result_incs} -i -O coff -o ") +endmacro() + +#typelib support +macro(ADD_TYPELIB TARGET) + foreach(SOURCE ${ARGN}) + get_filename_component(FILE ${SOURCE} NAME_WE) + set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb) + add_custom_command(OUTPUT ${OBJECT} + COMMAND native-widl -I${REACTOS_SOURCE_DIR}/include/dxsdk -I. -I${REACTOS_SOURCE_DIR}/include -I${REACTOS_SOURCE_DIR}/include/psdk -m32 --win32 -t -T ${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE} + DEPENDS native-widl) + list(APPEND OBJECTS ${OBJECT}) + 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") + diff --git a/include/crt/stddef.h b/include/crt/stddef.h index 9482677272d..07b6191c16d 100644 --- a/include/crt/stddef.h +++ b/include/crt/stddef.h @@ -13,13 +13,7 @@ extern "C" { #endif -#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 _CRTIMP extern unsigned long __cdecl __threadid(void); #define _threadid (__threadid()) diff --git a/include/psdk/winbase.h b/include/psdk/winbase.h index 79c52ac5579..4b15fdf0a0b 100644 --- a/include/psdk/winbase.h +++ b/include/psdk/winbase.h @@ -1850,8 +1850,8 @@ VOID WINAPI InitializeSRWLock(PSRWLOCK); LONG WINAPI InterlockedOr(IN OUT LONG volatile *,LONG); LONG WINAPI InterlockedAnd(IN OUT LONG volatile *,LONG); LONG WINAPI InterlockedCompareExchange(IN OUT LONG volatile *,LONG,LONG); -LONG WINAPI InterlockedDecrement(IN OUT LONG volatile *); -LONG WINAPI InterlockedExchange(IN OUT LONG volatile *,LONG); +WINBASEAPI LONG WINAPI InterlockedDecrement(IN OUT LONG volatile *); +WINBASEAPI LONG WINAPI InterlockedExchange(IN OUT LONG volatile *,LONG); #if defined(_WIN64) /* PVOID WINAPI InterlockedExchangePointer(PVOID*,PVOID); */ #define InterlockedExchangePointer(t,v) \ @@ -1871,7 +1871,7 @@ LONG WINAPI InterlockedExchangeAdd(IN OUT LONG volatile *,LONG); #if (_WIN32_WINNT >= 0x0501) PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER); #endif -LONG WINAPI InterlockedIncrement(IN OUT LONG volatile *); +WINBASEAPI LONG WINAPI InterlockedIncrement(IN OUT LONG volatile *); #if (_WIN32_WINNT >= 0x0501) PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER); PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY); @@ -2063,8 +2063,8 @@ HANDLE WINAPI OpenThread(DWORD,BOOL,DWORD); BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE); HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR); HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR); -void WINAPI OutputDebugStringA(LPCSTR); -void WINAPI OutputDebugStringW(LPCWSTR); +WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR); +WINBASEAPI void WINAPI OutputDebugStringW(LPCWSTR); BOOL WINAPI PeekNamedPipe(HANDLE,PVOID,DWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI PostQueuedCompletionStatus(HANDLE,DWORD,ULONG_PTR,LPOVERLAPPED); DWORD WINAPI PrepareTape(HANDLE,DWORD,BOOL); @@ -2243,7 +2243,7 @@ BOOL WINAPI SetVolumeMountPointW(LPCWSTR,LPCWSTR); BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,PVOID,BOOL); DWORD WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL); DWORD WINAPI SizeofResource(HINSTANCE,HRSRC); -void WINAPI Sleep(DWORD); +WINBASEAPI void WINAPI Sleep(DWORD); #if (_WIN32_WINNT >= 0x0600) BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE,PCRITICAL_SECTION,DWORD); BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE,PSRWLOCK,DWORD,ULONG); diff --git a/include/psdk/winefs.h b/include/psdk/winefs.h index f4a2282f1e9..a46f7a50fbf 100644 --- a/include/psdk/winefs.h +++ b/include/psdk/winefs.h @@ -47,11 +47,6 @@ BOOL WINAPI EncryptionDisable ( BOOL ); -BOOL WINAPI FileEncryptionStatus ( - LPCTSTR, - LPDWORD - ); - DWORD WINAPI QueryUsersOnEncryptedFile ( LPCWSTR, PENCRYPTION_CERTIFICATE_HASH_LIST* diff --git a/lib/3rdparty/CMakeLists.txt b/lib/3rdparty/CMakeLists.txt index b59d9599381..7a508c630f2 100644 --- a/lib/3rdparty/CMakeLists.txt +++ b/lib/3rdparty/CMakeLists.txt @@ -11,4 +11,5 @@ add_subdirectory(libsamplerate) add_subdirectory(libwine) add_subdirectory(libxml2) add_subdirectory(mingw) +add_subdirectory(stlport) add_subdirectory(zlib) \ No newline at end of file diff --git a/lib/3rdparty/mingw/CMakeLists.txt b/lib/3rdparty/mingw/CMakeLists.txt index 41e48f84586..98667cd55f3 100644 --- a/lib/3rdparty/mingw/CMakeLists.txt +++ b/lib/3rdparty/mingw/CMakeLists.txt @@ -41,8 +41,9 @@ list(APPEND MINGW_COMMON_SOURCE add_library(mingw_common ${MINGW_COMMON_SOURCE}) if(NOT MSVC) - target_link_libraries(mingw_common oldnames) - add_importlibs(mingw_common kernel32 ntdll) + target_link_libraries(mingw_common) + add_importlibs(mingw_common kernel32 ntdll oldnames) + add_dependencies(mingw_common oldnames) endif(NOT MSVC) set_target_properties(mingw_common PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE) @@ -56,6 +57,10 @@ add_library(mingw_wmain crt0_w.c crtexe.c dllargv.c) 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) diff --git a/lib/3rdparty/stlport/CMakeLists.txt b/lib/3rdparty/stlport/CMakeLists.txt new file mode 100644 index 00000000000..b8222ddea93 --- /dev/null +++ b/lib/3rdparty/stlport/CMakeLists.txt @@ -0,0 +1,47 @@ + +#uncomment this if you want to test c++ compilation +#add_subdirectory(test) + +add_definitions(-D_STLP_USE_EXCEPTIONS) + +list(APPEND SOURCE + src/allocators.cpp + src/bitset.cpp + src/codecvt.cpp + src/collate.cpp + src/complex.cpp + src/complex_io.cpp + src/complex_trig.cpp + src/ctype.cpp + src/dll_main.cpp + src/facets_byname.cpp + src/fstream.cpp + src/ios.cpp + src/iostream.cpp + src/istream.cpp + src/locale.cpp + src/locale_catalog.cpp + src/locale_impl.cpp + src/messages.cpp + src/monetary.cpp + src/num_get.cpp + src/num_get_float.cpp + src/num_put.cpp + src/num_put_float.cpp + src/numpunct.cpp + src/ostream.cpp + src/sstream.cpp + src/stdio_streambuf.cpp + src/string.cpp + src/strstream.cpp + src/time_facets.cpp + src/c_locale.c + src/cxa.c) + +add_library(stlport ${SOURCE}) + +if(NOT MSVC) + #those are mandatory to get correctly ordered linked libraries. + target_link_libraries(stlport supc++ msvcrt.dll.a) + add_importlibs(stlport msvcrt) +endif() diff --git a/lib/3rdparty/stlport/INSTALL b/lib/3rdparty/stlport/INSTALL new file mode 100644 index 00000000000..c22b62647fc --- /dev/null +++ b/lib/3rdparty/stlport/INSTALL @@ -0,0 +1,166 @@ +********************************************************************** +* INSTALL file for STLport * +* * +********************************************************************** + +STLport is a full ANSI C++ Standard library. + +This distribution contains STLport sources only, no binaries. +To use STLport iostreams, locale and complex numbers, you have to build STLport +library from sources in "build/lib" directory and link your programs with it. + +Starting with 5.0 the 'wrapper' mode is not supported anymore. You cannot use native +compiler iostreams implementation with STLport STL (see doc/FAQ for explanations). +Now you have to choose between STLport iostreams or no iostreams. + +==== Unpacking and installing STLport ========== + +1) Unpack STLport archive to a directory accessible during compilation. + NOTE: DO NOT overwrite header files coming with the compiler, even if you made + a backup - this won't work! Most probably, you've already unpacked the archive before + reading this file though ;) + +2) Make sure "stlport" directory of this distribution comes before compiler's one + in your include paths when you compile the project. + + Note: for SunPro CC 5.0 and higher, there used to be special directory "stlport/SC5" + this is now obsolete, please make sure you do not use it anymore. + +3) Make sure you do not rename this "stlport" subdirectory - + that may result in compilation errors. + + NOTE: Your compiler should be recognized by STLport source code with no configuring. + Please edit appropriate configuration header for your compiler + directly if you have to make compiler-specific configuration changes + (see stlport/stl/config). + +4) Run: + + configure --help + + Depending on your environment, Windows command shell or Unix like shell, + configure.bat or configure script will be run respectively. For Windows users + running configure script is mandatory in order to declare the compiler you are + going to use. + +5) Go to "build/lib" subdirectory. It contains various makefiles for different + compilers and 'make' utilities (GNU Make and Microsoft's nmake supported). + + Verify you can do command line compiles. IDE users may have to do something + special, like add environment variables (for Microsoft) or install + additional compiler components (for Metrowerks), before they can use their + command line compilers (see doc/README.xxxx for additionnal information). + + configure script should have already created a Makefile file so that you only + have to call 'make' or 'nmake' (for some platforms GNU make might be hidden + behind 'gmake'). + + IMPORTANT: + + If you DO NOT plan to use STLport iostreams and/or locale implementation but just + the STL, you do not have to build the library. + + If you have decided to disable STLport iostreams and locale using _STLP_NO_IOSTREAMS + configuration macro in stlport/stl/config/user_config.h, you may stop reading here. + + +==== Building STLport iostreams library ========== + +Below are step-by-step instructions to build STLport streams library. This is a general +build process description, for a more detailed one check README files in the doc folder: + +5) Using appropriate make command (make or nmake), do + + make clean install + + to build the STLport libraries. Make files are set up to build several different + flavors - debug/nondebug, static/dynamic versions. But not all flavors will be build + by default. See build/lib/README for other make targets. + + Note: 'install' target work slightly different than usual - it installs libraries into + /lib and bin catalogs, NOT IN SYSTEM CATALOG. You can do the system + install by just copying stlport and lib folder to the destination of your choise. For + example on UNIX-like platforms this can be done with the following commands: + + su + tar cf - stlport | (cd /usr/local/include; tar xf -) + chmod -R a+r /usr/local/include/stlport + chown -R root:root /usr/local/include/stlport + (cd lib; tar cf - --exclude=CVS --exclude=.cvsignore .) | (cd /usr/local/lib; tar xf -) + chown -R root:root /usr/local/lib/libstlport* + exit + + Note: System install is optional, most of compilers/linkers support searching for includes + and libs throught out the whole filesystem, just check your documentation on how to achieve + this. + + If you use cross-compiler, you can find libraries in the /lib/ + catalog. + +6) If build fails, you may choose to : + - try fixing the build ;) + - wait until somebody else will submit corresponding changes to be incorporated in next STLport + release/snapshot. + + In case you do patch STLport, please submit your patches to + https://sourceforge.net/tracker/?atid=766246&group_id=146814&func=browse + +==== Linking your application with STLport library ========== + +7) Check the build: + + Example: + + - under Linux and other Unixes: + + cd build/test/unit + make install + ../../../bin/stl_unit_test + ../../../bin-g/stl_unit_test + + - under Windows: + + cd build\test\unit + nmake install + cd ..\..\..\bin + stl_unit_test + stl_unit_testd + stl_unit_teststld + +8) Supply the "lib" subdirectory to the library search path and add desired + library to the list of libraries to link with. + Examples (imagine you have mytest.cpp in the same directory as this file is): + With GCC : g++ -pthread -I./stlport mytest.cpp -L./lib/ -lstlport + With DEC CC : cxx -I./stlport mytest.cpp -L./lib/ -lstlport + With SUN CC : CC -mt -I./stlport mytest.cpp -L./lib/ -lstlport + ..... + For several compilers supporting auto linking feature (VC++, Borland, DMC), + you do not have to specify "stlport.M.m.lib" explicitly, as it is being choosen + and forced to link automatically by "#pragma"'s in compiler config files + Appropriate version is being selected based on compiler options and _STLP_DEBUG + setting. All you have to do is to set library search path for the linker. + + Example : + cl.exe /I.\stlport mytest.cpp /link /libpath:.\lib /MD + +9) If you linked your application with shared STLport library (.so or .dll), please + make suze that your .so or .dll can be found by the dynamic linker. + Under Windows, the paths searched depend on the particular flavor, see the MSDN + documentation for LoadLibrary at http://msdn.microsoft.com. The easiest ways are to + either modify the PATH environment variable or copy all .dll's next to the + executable like it is done per default when unit tests executable are put next + to dlls. + Under Linux, the environment variable LD_LIBRARY_PATH can be adjusted to point + to the dir containing .so. See the manpage for ld.so for more info. + +10) STLport builds only multithreaded libraries, so your application should be compiled + as multithreaded, too. Use -pthread (or -pthreads on Solaris) option for GCC, -mt for SunPro, + /MT for VC, and so on. Sometimes you should define _REENTRANT or something else, depends + upon platform/compiler. See compiler's and linker's options on command line when you build + unit tests (build/test/unit) for reference. The last is useful for ANY platform. + +11) Don't hesitate to read READMEs (doc/README*, build/lib/README*, build/test/unit/README*) + and doc/FAQ. + +12) Have fun! + diff --git a/lib/3rdparty/stlport/INSTALL.unixes b/lib/3rdparty/stlport/INSTALL.unixes new file mode 100644 index 00000000000..f9b2e21c34c --- /dev/null +++ b/lib/3rdparty/stlport/INSTALL.unixes @@ -0,0 +1,120 @@ +********************************************************************** +* INSTALL file for STLport 5.2 * +* * +********************************************************************** + +STLport is a full ANSI C++ Standard library. + +This distribution contains STLport sources only, no binaries. +To use STLport iostreams, locale and complex numbers, you have +to build STLport library from sources and link your programs with it. + +Starting with 5.0 the 'wrapper' mode is not supported anymore. +You cannot use native compiler iostreams implementation with STLport STL +(see doc/FAQ for explanations). + +==== Installing STLport ========== + +0) DO NOT overwrite/move/rename header files coming with the compiler, + even if you made a backup---STLport need this headers and don't + override ones. + +1) Run + + ./configure --help + + read options description; if you use compiler + different from gcc, pay attention to --use-compiler-family= option. + +2) Run + + ./configure