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