diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-12-21 14:41:48 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-23 10:42:46 -0500 |
commit | b1024662eafddd5560fbfbac29333e5e967ca0f8 (patch) | |
tree | a8bdd5a1adf525847c8f7df4b2b62268f8d0a738 /src/makefile.linux-mingw | |
parent | 8aef119f43ee3b4e75e0f3bd7ea28cf7b29bb582 (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/makefile.linux-mingw')
-rw-r--r-- | src/makefile.linux-mingw | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index efbce1f047..c3cbe90bcd 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -21,6 +21,7 @@ LIBPATHS= \ -L"$(DEPSDIR)/openssl-1.0.1c" LIBS= \ + $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a \ -l boost_system-mt-s \ -l boost_filesystem-mt-s \ -l boost_program_options-mt-s \ @@ -91,11 +92,10 @@ OBJS= \ all: bitcoind.exe -LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a DEFS += -I"$(CURDIR)/leveldb/include" DEFS += -I"$(CURDIR)/leveldb/helpers" leveldb/libleveldb.a: - @echo "Building LevelDB ..." && cd leveldb && CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ TARGET_OS=OS_WINDOWS_CROSSCOMPILE CXXFLAGS="-I$(INCLUDEPATHS)" LDFLAGS="-L$(LIBPATHS)" $(MAKE) libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd .. + @echo "Building LevelDB ..." && cd leveldb && CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ TARGET_OS=OS_WINDOWS_CROSSCOMPILE CXXFLAGS="$(INCLUDEPATHS)" LDFLAGS="$(LIBPATHS)" $(MAKE) libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd .. obj/leveldb.o: leveldb/libleveldb.a obj/build.h: FORCE @@ -124,5 +124,6 @@ clean: -rm -f obj-test/*.o -rm -f test_bitcoin.exe -rm -f obj/build.h + cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) clean && cd .. FORCE: |