コード例 #1
0
from _setuputils import LIBRARIES
from _setuputils import DEFINE_MACROS
from _setuputils import glob_many
from _setuputils import dep_abspath
from _setuputils import should_embed

LIBEV_EMBED = should_embed('libev')

# Configure libev in place; but cp the config.h to the old directory;
# if we're building a CPython extension, the old directory will be
# the build/temp.XXX/libev/ directory. If we're building from a
# source checkout on pypy, OLDPWD will be the location of setup.py
# and the PyPy branch will clean it up.
libev_configure_command = ' '.join([
    "(cd ",
    quoted_dep_abspath('libev'), " && sh ./configure ",
    " && cp config.h \"$OLDPWD\"", ")", '> configure-output.txt'
])


def configure_libev(bext, ext):
    if WIN:
        return

    bdir = os.path.join(bext.build_temp, 'libev')
    ext.include_dirs.insert(0, bdir)

    if not os.path.isdir(bdir):
        os.makedirs(bdir)

    cwd = os.getcwd()
コード例 #2
0
ファイル: _setuplibev.py プロジェクト: sh9901/qa-gevent
from _setuputils import DEFINE_MACROS
from _setuputils import glob_many
from _setuputils import dep_abspath
from _setuputils import should_embed
from _setuputils import cythonize1


LIBEV_EMBED = should_embed('libev')

# Configure libev in place; but cp the config.h to the old directory;
# if we're building a CPython extension, the old directory will be
# the build/temp.XXX/libev/ directory. If we're building from a
# source checkout on pypy, OLDPWD will be the location of setup.py
# and the PyPy branch will clean it up.
libev_configure_command = ' '.join([
    "(cd ", quoted_dep_abspath('libev'),
    " && sh ./configure ",
    " && cp config.h \"$OLDPWD\"",
    ")",
    '> configure-output.txt'
])


def configure_libev(bext, ext):
    if WIN:
        return

    bdir = os.path.join(bext.build_temp, 'libev')
    ext.include_dirs.insert(0, bdir)

    if not os.path.isdir(bdir):
コード例 #3
0
ファイル: _setupares.py プロジェクト: gevent/gevent

CARES_EMBED = should_embed('c-ares')


# See #616, trouble building for a 32-bit python against a 64-bit platform
_config_vars = distutils.sysconfig.get_config_var("CFLAGS")
if _config_vars and "m32" in _config_vars:
    _m32 = 'CFLAGS="' + os.getenv('CFLAGS', '') + ' -m32" '
else:
    _m32 = ''

# Use -r, not -e, for support of old solaris. See
# https://github.com/gevent/gevent/issues/777
ares_configure_command = ' '.join([
    "(cd ", quoted_dep_abspath('c-ares'),
    " && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
    " && sh ./configure --disable-dependency-tracking -C " + _m32 + "CONFIG_COMMANDS= ",
    " && cp ares_config.h ares_build.h \"$OLDPWD\" ",
    " && cat ares_build.h ",
    " && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)",
    "> configure-output.txt"])



def configure_ares(bext, ext):
    print("Embedding c-ares", bext, ext)
    bdir = os.path.join(bext.build_temp, 'c-ares')
    ext.include_dirs.insert(0, bdir)
    print("Inserted ", bdir, "in include dirs", ext.include_dirs)
コード例 #4
0
ファイル: _setupares.py プロジェクト: winning1120xx/gevent
from _setuputils import get_include_dirs

CARES_EMBED = should_embed('c-ares')

# See #616, trouble building for a 32-bit python on a 64-bit platform
# (Linux).
_distutils_cflags = distutils.sysconfig.get_config_var("CFLAGS") or ''
cflags = _distutils_cflags + (
    (' ' + os.environ['CFLAGS']) if os.environ.get("CFLAGS") else '')
cflags = ('CFLAGS="%s"' % (cflags, )) if cflags else ''

# Use -r, not -e, for support of old solaris. See
# https://github.com/gevent/gevent/issues/777
ares_configure_command = ' '.join([
    "(cd ",
    quoted_dep_abspath('c-ares'),
    " && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
    " && sh ./configure --disable-dependency-tracking -C " + cflags,
    " && cp ares_config.h ares_build.h \"$OLDPWD\" ", " && cat ares_build.h ",
    " && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)",
    "> configure-output.txt"
])

if 'GEVENT_MANYLINUX' in os.environ:
    # Assumes that c-ares is pre-configured.
    ares_configure_command = '(echo preconfigured) > configure-output.txt'


def configure_ares(bext, ext):
    print("Embedding c-ares", bext, ext)
    bdir = os.path.join(bext.build_temp, 'c-ares')
コード例 #5
0
ファイル: _setuplibev.py プロジェクト: KobeHuo/gevent
from _setuputils import LIBRARIES
from _setuputils import DEFINE_MACROS
from _setuputils import glob_many
from _setuputils import dep_abspath
from _setuputils import should_embed


LIBEV_EMBED = should_embed('libev')

# Configure libev in place; but cp the config.h to the old directory;
# if we're building a CPython extension, the old directory will be
# the build/temp.XXX/libev/ directory. If we're building from a
# source checkout on pypy, OLDPWD will be the location of setup.py
# and the PyPy branch will clean it up.
libev_configure_command = ' '.join([
    "(cd ", quoted_dep_abspath('libev'),
    " && /bin/sh ./configure ",
    " && cp config.h \"$OLDPWD\"",
    ")",
    '> configure-output.txt'
])


def configure_libev(bext, ext):
    if WIN:
        return

    bdir = os.path.join(bext.build_temp, 'libev')
    ext.include_dirs.insert(0, bdir)

    if not os.path.isdir(bdir):