summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2018-07-10 16:20:52 +0200
committerArmin Rigo <arigo@tunes.org>2018-07-10 16:20:52 +0200
commitafdf962a5d21781f725eeef5bb860fef47b7b306 (patch)
tree773d68eede50c93fd0bc709fa070db31c19b0437 /setup.py
parente755ea0c90c20262834bd1a560006df18c4a789b (diff)
downloadcffi-afdf962a5d21781f725eeef5bb860fef47b7b306.tar.gz
setup.py now supports building in a context and installing in a different
context with no compiler. You still get the error message about no compiler found, but now the error is not fatal.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 5d2f9e8..d833d11 100644
--- a/setup.py
+++ b/setup.py
@@ -46,6 +46,7 @@ def _ask_pkg_config(resultlist, option, result_prefix='', sysroot=False):
#
resultlist[:] = res
+no_compiler_found = False
def no_working_compiler_found():
sys.stderr.write("""
No working compiler found, or bogus compiler options passed to
@@ -55,8 +56,13 @@ def no_working_compiler_found():
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
- the IRC channel #python on irc.freenode.net.)\n""")
- sys.exit(1)
+ the IRC channel #python on irc.freenode.net.)
+
+ Trying to continue anyway. If you are trying to install CFFI from
+ a build done in a different context, you can ignore this warning.
+ \n""")
+ global no_compiler_found
+ no_compiler_found = True
def get_config():
from distutils.core import Distribution
@@ -75,11 +81,12 @@ def ask_supports_thread():
ok1 = config.try_compile('int some_regular_variable_42;')
if not ok1:
no_working_compiler_found()
- sys.stderr.write("Note: will not use '__thread' in the C code\n")
- _safe_to_ignore()
+ else:
+ sys.stderr.write("Note: will not use '__thread' in the C code\n")
+ _safe_to_ignore()
def ask_supports_sync_synchronize():
- if sys.platform == 'win32':
+ if sys.platform == 'win32' or no_compiler_found:
return
config = get_config()
ok = config.try_link('int main(void) { __sync_synchronize(); return 0; }')