summaryrefslogtreecommitdiff
blob: a0d9fcbe76fb14c0952200602b89b73c99d64003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 83ffe0eaa4800f0bdfec2302185ee5ab2b57ab3c Mon Sep 17 00:00:00 2001
From: Peter Alfredsen <loki_val@gentoo.org>
Date: Fri, 23 Jan 2009 23:59:49 +0100
Subject: [PATCH 10/10] Fix C++ tests linking order.

---
 src/cpp/test/Makefile |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/cpp/test/Makefile b/src/cpp/test/Makefile
index 664a459..03e1402 100644
--- a/src/cpp/test/Makefile
+++ b/src/cpp/test/Makefile
@@ -19,18 +19,16 @@ XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
 
 CXXFLAGS = $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
 
-LDFLAGS += $(shell $(XMLRPC_C_CONFIG) client --ldadd)
+LIBS := $(shell $(XMLRPC_C_CONFIG) client --ldadd)
 
 ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
-  LDFLAGS += $(shell curl-config --libs)
+  LIBS += $(shell curl-config --libs)
 endif
 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
-  LDFLAGS += $(shell libwww-config --libs)
+  LIBS += $(shell libwww-config --libs)
 endif
 
-LDFLAGS += "-lpthread"
-
-LDFLAGS += $(LADD)
+LIBS += -lpthread
 
 INCLUDES = -Isrcdir/include -I$(BLDDIR) -Isrcdir -Isrcdir/lib/util/include
 
@@ -69,13 +67,13 @@ TEST_LIBS = \
 ifneq ($(ENABLE_LIBXML2_BACKEND),yes)
   # We're using the internal Expat XML parser
   TEST_LIBS += $(LIBXMLRPC_XMLPARSE_A) $(LIBXMLRPC_XMLTOK_A)
-  LDADD_XML =
+  LIB_XML =
 else
-  LDADD_XML = $(shell xml2-config --libs)
+  LIB_XML = $(shell xml2-config --libs)
 endif
 
 test: $(TEST_OBJS) $(TEST_LIBS)
-	$(CXXLD) -o $@ $(LDFLAGS) $(LDADD_XML) $^
+	$(CXXLD) -o $@ $(LADD) $^ $(LIB_XML) $(LIBS)
 
 %.o:%.cpp
 	$(CXX) -c $(INCLUDES) $(CXXFLAGS) $<
-- 
1.6.1