Merge branch 'RC_1_1'
This commit is contained in:
commit
96a4a8b549
13
.travis.yml
13
.travis.yml
|
@ -37,12 +37,17 @@ addons:
|
|||
- libboost1.55-tools-dev
|
||||
- python2.7-dev
|
||||
- g++-4.8
|
||||
- python3-docutils
|
||||
- python3-pygments
|
||||
|
||||
before_install:
|
||||
- git submodule update --init --recursive
|
||||
- if [ $TRAVIS_OS_NAME == "osx" ]; then brew update > /dev/null && brew install --quiet ccache boost-build boost-python; fi
|
||||
- 'if [[ $TRAVIS_OS_NAME == "osx" && $docs = "1" ]]; then
|
||||
brew install --quiet https://raw.githubusercontent.com/catap/homebrew/docutils/Library/Formula/docutils.rb;
|
||||
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages;
|
||||
echo ''import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")'' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth;
|
||||
sudo easy_install Pygments;
|
||||
sudo easy_install -U aafigure;
|
||||
fi'
|
||||
|
||||
# disable simulations on OSX for now. It hangs on travis
|
||||
- if [ $TRAVIS_OS_NAME == "osx" ]; then export toolset="darwin-${lang}"; export sim="0"; fi
|
||||
|
@ -69,12 +74,12 @@ install:
|
|||
- 'echo "using darwin : cpp98 : ccache clang++ : <cflags>-std=c99 <cxxflags>-std=c++98 <compileflags>-Wno-deprecated-declarations ;" >> ~/user-config.jam'
|
||||
- 'echo "using python : 2.7 ;" >> ~/user-config.jam'
|
||||
- ccache -V && ccache --show-stats && ccache --zero-stats
|
||||
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "linux" ]]; then rst2html --version; fi
|
||||
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "osx" ]]; then rst2html.py --version; fi
|
||||
|
||||
script:
|
||||
# disable invoking docutils for now, until we can have a modern version of it
|
||||
- cd docs
|
||||
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "linux" ]]; then make rst RST2HTML=rst2html; fi
|
||||
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "osx" ]]; then make RST2HTML=rst2html.py; fi
|
||||
- cd ..
|
||||
|
||||
- cd test
|
||||
|
|
|
@ -1 +1 @@
|
|||
@COMPILETIME_OPTIONS@ @CPPFLAGS@ @LIBS@ @BOOST_CPPFLAGS@ @BOOST_SYSTEM_LIB@ @BOOST_PYTHON_LIB@ @PTHREAD_LIBS@ @OPENSSL_LIBS@ @OPENSSL_LDFLAGS@ @OPENSSL_INCLUDES@ -I@top_srcdir@/include
|
||||
-I@top_srcdir@/include @COMPILETIME_OPTIONS@ @CPPFLAGS@ @BOOST_CPPFLAGS@ @OPENSSL_INCLUDES@
|
||||
|
|
|
@ -1 +1 @@
|
|||
-L@top_builddir@/src/.libs @BOOST_LDFLAGS@ @LDFLAGS@
|
||||
-L@top_builddir@/src/.libs @LDFLAGS@ @LIBS@ @BOOST_LDFLAGS@ @BOOST_SYSTEM_LIB@ @BOOST_PYTHON_LIB@ @PTHREAD_LIBS@ @OPENSSL_LIBS@ @OPENSSL_LDFLAGS@
|
||||
|
|
|
@ -9,15 +9,26 @@ import shutil
|
|||
import multiprocessing
|
||||
import subprocess
|
||||
|
||||
def parse_cmd(cmdline, prefix, keep_prefix = False):
|
||||
ret = []
|
||||
for token in cmdline.split():
|
||||
if token[:len(prefix)] == prefix:
|
||||
if keep_prefix:
|
||||
ret.append(token)
|
||||
class flags_parser:
|
||||
def __init__(self):
|
||||
self.include_dirs = []
|
||||
self.library_dirs = []
|
||||
self.libraries = []
|
||||
|
||||
def parse(self, args):
|
||||
"""Parse out the -I -L -l directives and return a list of all other arguments"""
|
||||
ret = []
|
||||
for token in args.split():
|
||||
prefix = token[:2]
|
||||
if prefix == '-I':
|
||||
self.include_dirs.append(token[2:])
|
||||
elif prefix == '-L':
|
||||
self.library_dirs.append(token[2:])
|
||||
elif prefix == '-l':
|
||||
self.libraries.append(token[2:])
|
||||
else:
|
||||
ret.append(token[len(prefix):])
|
||||
return ret
|
||||
ret.append(token)
|
||||
return ret
|
||||
|
||||
def arch():
|
||||
if platform.system() != 'Darwin': return []
|
||||
|
@ -98,15 +109,19 @@ else:
|
|||
source_list = [os.path.abspath(os.path.join(os.path.dirname(__file__), "src", s)) for s in source_list if s.endswith(".cpp")]
|
||||
|
||||
if extra_cmd:
|
||||
flags = flags_parser()
|
||||
# ldflags must be parsed first to ensure the correct library search path order
|
||||
extra_link = flags.parse(ldflags)
|
||||
extra_compile = flags.parse(extra_cmd)
|
||||
|
||||
ext = [Extension('libtorrent',
|
||||
sources = source_list,
|
||||
language='c++',
|
||||
include_dirs = parse_cmd(extra_cmd, '-I'),
|
||||
library_dirs = parse_cmd(extra_cmd, '-L'),
|
||||
extra_link_args = ldflags.split() + arch(),
|
||||
extra_compile_args = parse_cmd(extra_cmd, '-D', True) + arch() \
|
||||
+ target_specific(),
|
||||
libraries = ['torrent-rasterbar'] + parse_cmd(extra_cmd, '-l'))]
|
||||
include_dirs = flags.include_dirs,
|
||||
library_dirs = flags.library_dirs,
|
||||
extra_link_args = extra_link + arch(),
|
||||
extra_compile_args = extra_compile + arch() + target_specific(),
|
||||
libraries = ['torrent-rasterbar'] + flags.libraries)]
|
||||
|
||||
setup(name = 'python-libtorrent',
|
||||
version = '1.1.0',
|
||||
|
|
Loading…
Reference in New Issue