annotate DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/distutils/command/autodist.py @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2a2c65a20a8b
children
rev   line source
Chris@87 1 """This module implements additional tests ala autoconf which can be useful.
Chris@87 2
Chris@87 3 """
Chris@87 4 from __future__ import division, absolute_import, print_function
Chris@87 5
Chris@87 6
Chris@87 7 # We put them here since they could be easily reused outside numpy.distutils
Chris@87 8
Chris@87 9 def check_inline(cmd):
Chris@87 10 """Return the inline identifier (may be empty)."""
Chris@87 11 cmd._check_compiler()
Chris@87 12 body = """
Chris@87 13 #ifndef __cplusplus
Chris@87 14 static %(inline)s int static_func (void)
Chris@87 15 {
Chris@87 16 return 0;
Chris@87 17 }
Chris@87 18 %(inline)s int nostatic_func (void)
Chris@87 19 {
Chris@87 20 return 0;
Chris@87 21 }
Chris@87 22 #endif"""
Chris@87 23
Chris@87 24 for kw in ['inline', '__inline__', '__inline']:
Chris@87 25 st = cmd.try_compile(body % {'inline': kw}, None, None)
Chris@87 26 if st:
Chris@87 27 return kw
Chris@87 28
Chris@87 29 return ''
Chris@87 30
Chris@87 31 def check_compiler_gcc4(cmd):
Chris@87 32 """Return True if the C compiler is GCC 4.x."""
Chris@87 33 cmd._check_compiler()
Chris@87 34 body = """
Chris@87 35 int
Chris@87 36 main()
Chris@87 37 {
Chris@87 38 #if (! defined __GNUC__) || (__GNUC__ < 4)
Chris@87 39 #error gcc >= 4 required
Chris@87 40 #endif
Chris@87 41 }
Chris@87 42 """
Chris@87 43 return cmd.try_compile(body, None, None)