Commit 07a40685 authored by Chris Lane's avatar Chris Lane

made ok for pypy and py26; add to existing CFLAGS

parent 678a09cc
#!/usr/bin/env python
"""gevent build & installation script"""
from __future__ import print_function from __future__ import print_function
import sys import sys
import os import os
...@@ -10,7 +8,9 @@ from os.path import join, abspath, basename, dirname ...@@ -10,7 +8,9 @@ from os.path import join, abspath, basename, dirname
from subprocess import check_call from subprocess import check_call
from glob import glob from glob import glob
import sysconfig # to get CFLAGS to pass into c-ares configure script import distutils
import distutils.sysconfig # to get CFLAGS to pass into c-ares configure script
PYPY = hasattr(sys, 'pypy_version_info') PYPY = hasattr(sys, 'pypy_version_info')
...@@ -66,10 +66,12 @@ libev_configure_command = ' '.join(["(cd ", _quoted_abspath('libev/'), ...@@ -66,10 +66,12 @@ libev_configure_command = ' '.join(["(cd ", _quoted_abspath('libev/'),
" && /bin/sh ./configure ", " && /bin/sh ./configure ",
" && mv config.h \"$OLDPWD\")", " && mv config.h \"$OLDPWD\")",
'> configure-output.txt']) '> configure-output.txt'])
if "m32" in sysconfig.get_config_var("CFLAGS"):
_m32 = "CFLAGS=-m32 " _config_vars = distutils.sysconfig.get_config_var("CFLAGS")
if _config_vars and "m32" in _config_vars:
_m32 = 'CFLAGS="' + os.getenv('CFLAGS','') + ' -m32"'
else: else:
_m32 = "" _m32 = ''
ares_configure_command = ' '.join(["(cd ", _quoted_abspath('c-ares/'), ares_configure_command = ' '.join(["(cd ", _quoted_abspath('c-ares/'),
" && if [ -e ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ", " && if [ -e ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
...@@ -351,6 +353,7 @@ if run_make and os.path.exists("Makefile"): ...@@ -351,6 +353,7 @@ if run_make and os.path.exists("Makefile"):
else: else:
setup_requires = [] setup_requires = []
def run_setup(ext_modules, run_make): def run_setup(ext_modules, run_make):
if run_make: if run_make:
if isinstance(run_make, str): if isinstance(run_make, str):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment