Patchwork [v3,4/4] use pkg-config for libcurl whenever available

login
register
mail settings
Submitter Paolo Bonzini
Date Jan. 13, 2010, 8:52 a.m.
Message ID <1263372776-23753-5-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/42798/
State New
Headers show

Comments

Paolo Bonzini - Jan. 13, 2010, 8:52 a.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/configure b/configure
index 2553724..b3d4640 100755
--- a/configure
+++ b/configure
@@ -1309,13 +1309,19 @@  fi
 ##########################################
 # curl probe
 
+if $pkgconfig libcurl --modversion >/dev/null 2>&1; then
+  curlconfig="$pkgconfig libcurl"
+else
+  curlconfig=curl-config
+fi
+
 if test "$curl" != "no" ; then
   cat > $TMPC << EOF
 #include <curl/curl.h>
 int main(void) { return curl_easy_init(); }
 EOF
-  curl_cflags=`curl-config --cflags 2>/dev/null`
-  curl_libs=`curl-config --libs 2>/dev/null`
+  curl_cflags=`$curlconfig --cflags 2>/dev/null`
+  curl_libs=`$curlconfig --libs 2>/dev/null`
   if compile_prog "$curl_cflags" "$curl_libs" ; then
     curl=yes
     libs_tools="$curl_libs $libs_tools"