comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/distutils/command/autodist.py @ 87:2a2c65a20a8b

Add Python libs and headers
author Chris Cannam
date Wed, 25 Feb 2015 14:05:22 +0000
parents
children
comparison
equal deleted inserted replaced
86:413a9d26189e 87:2a2c65a20a8b
1 """This module implements additional tests ala autoconf which can be useful.
2
3 """
4 from __future__ import division, absolute_import, print_function
5
6
7 # We put them here since they could be easily reused outside numpy.distutils
8
9 def check_inline(cmd):
10 """Return the inline identifier (may be empty)."""
11 cmd._check_compiler()
12 body = """
13 #ifndef __cplusplus
14 static %(inline)s int static_func (void)
15 {
16 return 0;
17 }
18 %(inline)s int nostatic_func (void)
19 {
20 return 0;
21 }
22 #endif"""
23
24 for kw in ['inline', '__inline__', '__inline']:
25 st = cmd.try_compile(body % {'inline': kw}, None, None)
26 if st:
27 return kw
28
29 return ''
30
31 def check_compiler_gcc4(cmd):
32 """Return True if the C compiler is GCC 4.x."""
33 cmd._check_compiler()
34 body = """
35 int
36 main()
37 {
38 #if (! defined __GNUC__) || (__GNUC__ < 4)
39 #error gcc >= 4 required
40 #endif
41 }
42 """
43 return cmd.try_compile(body, None, None)