0a2fc21
From 009e170d2838346461ff0b31b0afa44f3d6278f3 Mon Sep 17 00:00:00 2001
0a2fc21
From: zanee <zanee>
0a2fc21
Date: Fri, 23 Apr 2010 16:06:41 +0000
0a2fc21
Subject: [PATCH 2/5] Fixes https://sourceforge.net/tracker/?func=detail&aid=2812016&group_id=28236&atid=392777 with applied patch from sourceforge user dbprice1.
0a2fc21
0a2fc21
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
0a2fc21
---
0a2fc21
 setup.py |   23 ++++++++++++++++++-----
0a2fc21
 1 files changed, 18 insertions(+), 5 deletions(-)
0a2fc21
0a2fc21
diff --git a/setup.py b/setup.py
0a2fc21
index 0ffd9d2..76b9d58 100644
0a2fc21
--- a/setup.py
0a2fc21
+++ b/setup.py
0a2fc21
@@ -1,7 +1,7 @@
0a2fc21
 #! /usr/bin/env python
0a2fc21
 # -*- coding: iso-8859-1 -*-
0a2fc21
 # vi:ts=4:et
0a2fc21
-# $Id: setup.py,v 1.150 2008/09/09 17:40:34 kjetilja Exp $
0a2fc21
+# $Id: setup.py,v 1.151 2010/04/23 16:06:41 zanee Exp $
0a2fc21
 
0a2fc21
 """Setup script for the PycURL module distribution."""
0a2fc21
 
0a2fc21
@@ -9,7 +9,7 @@ PACKAGE = "pycurl"
0a2fc21
 PY_PACKAGE = "curl"
0a2fc21
 VERSION = "7.19.0"
0a2fc21
 
0a2fc21
-import glob, os, re, sys, string
0a2fc21
+import glob, os, re, sys, string, subprocess
0a2fc21
 import distutils
0a2fc21
 from distutils.core import setup
0a2fc21
 from distutils.extension import Extension
0a2fc21
@@ -96,9 +96,22 @@ else:
0a2fc21
                 include_dirs.append(e[2:])
0a2fc21
         else:
0a2fc21
             extra_compile_args.append(e)
0a2fc21
-    libs = split_quoted(
0a2fc21
-        os.popen("'%s' --libs" % CURL_CONFIG).read()+\
0a2fc21
-        os.popen("'%s' --static-libs" % CURL_CONFIG).read())
0a2fc21
+
0a2fc21
+    # Run curl-config --libs and --static-libs.  Some platforms may not
0a2fc21
+    # support one or the other of these curl-config options, so gracefully
0a2fc21
+    # tolerate failure of either, but not both.
0a2fc21
+    optbuf = ""
0a2fc21
+    for option in ["--libs", "--static-libs"]:
0a2fc21
+        p = subprocess.Popen("'%s' %s" % (CURL_CONFIG, option), shell=True,
0a2fc21
+            stdout=subprocess.PIPE)
0a2fc21
+        (stdout, stderr) = p.communicate()
0a2fc21
+        if p.wait() == 0:
0a2fc21
+            optbuf += stdout
0a2fc21
+    if optbuf == "":
0a2fc21
+        raise Exception, ("Neither of curl-config --libs or --static-libs" +
0a2fc21
+            "produced output")
0a2fc21
+    libs = split_quoted(optbuf)
0a2fc21
+
0a2fc21
     for e in libs:
0a2fc21
         if e[:2] == "-l":
0a2fc21
             libraries.append(e[2:])
0a2fc21
-- 
0a2fc21
1.7.1
0a2fc21