aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-04-08 18:03:03 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-04-08 18:03:03 -0700
commitf49992d983d2202f1e8210e86201b6741726dd88 (patch)
tree389a23bce1d4ed207cb53576e31aee5b323550ca /src
parentfb17911e9a29399ff46cf3c539a48027924e1afc (diff)
parent3a9c2d51e12fcf321daa78303e38c725b6477b66 (diff)
Merge pull request #2243 from luke-jr/bugfix_leveldb
LevelDB build bugfix
Diffstat (limited to 'src')
-rw-r--r--src/makefile.linux-mingw14
-rw-r--r--src/makefile.unix6
2 files changed, 12 insertions, 8 deletions
diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw
index 694cacd632..7719cd2637 100644
--- a/src/makefile.linux-mingw
+++ b/src/makefile.linux-mingw
@@ -36,9 +36,9 @@ LIBS= \
DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEBUGFLAGS=-g
-CFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
+xCXXFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) $(CXXFLAGS)
# enable: ASLR, DEP and large address aware
-LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware
+xLDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware $(LDFLAGS)
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
@@ -98,7 +98,7 @@ all: bitcoind.exe
DEFS += -I"$(CURDIR)/leveldb/include"
DEFS += -I"$(CURDIR)/leveldb/helpers"
leveldb/libleveldb.a:
- @echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(CFLAGS)" libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd ..
+ @echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd ..
obj/build.h: FORCE
/bin/sh ../share/genbuild.sh obj/build.h
@@ -106,18 +106,18 @@ version.cpp: obj/build.h
DEFS += -DHAVE_BUILD_INFO
obj/%.o: %.cpp $(HEADERS)
- $(CXX) -c $(CFLAGS) -o $@ $<
+ $(CXX) -c $(xCXXFLAGS) -o $@ $<
bitcoind.exe: $(OBJS:obj/%=obj/%)
- $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
+ $(CXX) $(xCXXFLAGS) $(xLDFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
obj-test/%.o: test/%.cpp $(HEADERS)
- $(CXX) -c $(TESTDEFS) $(CFLAGS) -o $@ $<
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -o $@ $<
test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
+ $(CXX) $(xCXXFLAGS) $(xLDFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
clean:
diff --git a/src/makefile.unix b/src/makefile.unix
index 4401cf0d56..081edaf63e 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -36,6 +36,10 @@ LIBS += \
-l ssl \
-l crypto
+TESTLIBS += \
+ -Wl,-B$(LMODE) \
+ -l boost_unit_test_framework$(BOOST_LIB_SUFFIX)
+
ifndef USE_UPNP
override USE_UPNP = -
endif
@@ -178,7 +182,7 @@ obj-test/%.o: test/%.cpp
rm -f $(@:%.o=%.d)
test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(xLDFLAGS) $(LIBS)
+ $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
clean:
-rm -f bitcoind test_bitcoin