Skip to content

Commit

Permalink
Bugfix: Support building test_bitcoin with shared-object boost test f…
Browse files Browse the repository at this point in the history
…ramework
  • Loading branch information
luke-jr committed Jan 23, 2012
1 parent 1240a1b commit ca9afa8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ ifdef STATIC
ifeq (${STATIC}, all)
LMODE2 = static
endif
else
TESTDEFS += -DBOOST_TEST_DYN_LINK
endif

# for boost 1.37, add -mt to the boost libraries
Expand Down Expand Up @@ -124,14 +126,14 @@ bitcoind: $(OBJS:obj/%=obj/%)
TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))

obj/test/%.o: test/%.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)

test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
$(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
$(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)

clean:
-rm -f bitcoind test_bitcoin
Expand Down

0 comments on commit ca9afa8

Please sign in to comment.