1 Use correct curl-config program
3 Instead of calling directly curl-config in src/Makefile (which ends up
4 calling the wrong curl-config: the one in the PATH instead of the one
5 pointed at by the environment variables at configure time), let's
6 define a CURL_CONFIG variable that contains the path to the proper
7 curl-config program, and use it where appropriate.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 ===================================================================
16 TRANSPORT_MODS += blddir/lib/curl_transport/curltransaction
17 TRANSPORT_MODS += blddir/lib/curl_transport/curlmulti
18 TRANSPORT_MODS += blddir/lib/curl_transport/lock_pthread
19 - TRANSPORT_LIBDEP += $(shell curl-config --libs)
20 + TRANSPORT_LIBDEP += $(shell $CURL_CONFIG --libs)
22 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
23 TRANSPORT_MODS += blddir/lib/libwww_transport/xmlrpc_libwww_transport
25 ===================================================================
30 WININET_LDADD = @WININET_LDADD@
31 WININET_LIBDIR = @WININET_LIBDIR@
32 +CURL_CONFIG = @CURL_CONFIG@
33 CURL_LDADD = @CURL_LDADD@
34 CURL_LIBDIR = @CURL_LIBDIR@
35 LIBWWW_LDADD = @LIBWWW_LDADD@
37 ===================================================================
41 dnl So we don't do any check now. If we find out there's a problem with
42 dnl older Curls, we will revisit that.
44 + AC_SUBST(CURL_CONFIG)
46 CURL_LDADD=$($CURL_CONFIG --libs)
49 Index: b/lib/curl_transport/Makefile
50 ===================================================================
51 --- a/lib/curl_transport/Makefile
52 +++ b/lib/curl_transport/Makefile
55 $(SRCDIR)/common.mk: srcdir blddir
57 -CURL_VERSION := $(shell curl-config --vernum)
58 +CURL_VERSION := $(shell $(CURL_CONFIG) --vernum)
60 # Some time at or before Curl 7.12, <curl/types.h> became an empty file
61 # (no-op). Some time after Curl 7.18, <curl/types.h> ceased to exist.
63 CFLAGS_LOCAL += -DNEED_CURL_TYPES_H
66 -CURL_INCLUDES := $(shell curl-config --cflags)
67 +CURL_INCLUDES := $(shell $(CURL_CONFIG) --cflags)
68 # We expect that curl-config --cflags just gives us -I options, because
69 # we need just the -I options for 'make dep'. Plus, it's scary to think
70 # of what any other compiler flag would do to our compile.
71 Index: b/src/cpp/test/Makefile
72 ===================================================================
73 --- a/src/cpp/test/Makefile
74 +++ b/src/cpp/test/Makefile
76 LIBS := $(shell $(XMLRPC_C_CONFIG) client --ldadd)
78 ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
79 - LIBS += $(shell curl-config --libs)
80 + LIBS += $(shell $(CURL_CONFIG) --libs)
82 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
83 LIBS += $(shell libwww-config --libs)
84 Index: b/tools/common.mk
85 ===================================================================
89 CLIENT_LDLIBS += $(shell libwww-config --libs)
91 ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
92 - CLIENT_LDLIBS += $(shell curl-config --libs)
93 + CLIENT_LDLIBS += $(shell $(CURL_CONFIG) --libs)
95 ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
96 CLIENT_LDLIBS += $(shell wininet-config --libs)