aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/build_detect_platform
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-12-21 14:41:48 -0500
committerGavin Andresen <gavinandresen@gmail.com>2013-01-23 10:42:46 -0500
commitb1024662eafddd5560fbfbac29333e5e967ca0f8 (patch)
treea8bdd5a1adf525847c8f7df4b2b62268f8d0a738 /src/leveldb/build_detect_platform
parent8aef119f43ee3b4e75e0f3bd7ea28cf7b29bb582 (diff)
Port leveldb to MinGW32
Several changes to make the native windows leveldb code compile with mingw32 and run on 32-bit Windows: * Remove -std=c++0x dependency (modified code to use NULL instead of nullptr) * Link with -lshlwapi * Only #define snprintf/etc if compiling with Visual Studio * Do not link against DbgHelp.lib (wrote a CreateDir instead of using DbgHelp's MakeSureDirectoryPathExists * Define WINVER=0x0500 so MinGW32 can use the 64-bit-filesystem Windows api calls * Define __USE_MINGW_ANSI_STDIO=1 to use MinGW's printf (which supports %ll) I also cleaned up makefile.mingw, assuming that dependencies would be in the standard /usr/local/{include,lib} by default but allowing overriding with make DEPSDIR=... etc
Diffstat (limited to 'src/leveldb/build_detect_platform')
-rwxr-xr-xsrc/leveldb/build_detect_platform6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform
index caf2352f93..1080df77f4 100755
--- a/src/leveldb/build_detect_platform
+++ b/src/leveldb/build_detect_platform
@@ -129,11 +129,9 @@ case "$TARGET_OS" in
;;
OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)
PLATFORM=OS_WINDOWS
- COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS"
- PLATFORM_SHARED_CFLAGS=""
+ COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1"
PLATFORM_SOURCES="util/env_win.cc"
- PLATFORM_CXXFLAGS="-std=c++0x"
- PLATFORM_LIBS="-lshlwapi -ldbghelp"
+ PLATFORM_LIBS="-lshlwapi"
PORT_FILE=port/port_win.cc
CROSS_COMPILE=true
;;