summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/autodist.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/command/autodist.py')
-rw-r--r--numpy/distutils/command/autodist.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/distutils/command/autodist.py b/numpy/distutils/command/autodist.py
index f246eb9f9..fe40119ef 100644
--- a/numpy/distutils/command/autodist.py
+++ b/numpy/distutils/command/autodist.py
@@ -23,3 +23,17 @@ static %(inline)s int static_func (void)
return kw
return ''
+
+def check_compiler_gcc4(cmd):
+ """Return True if the C compiler is GCC 4.x."""
+ cmd._check_compiler()
+ body = """
+int
+main()
+{
+#ifndef __GNUC__ && (__GNUC__ >= 4)
+die in an horrible death
+#endif
+}
+"""
+ return cmd.try_compile(body, None, None)