1 diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py
2 --- a/numpy/distutils/unixccompiler.py
3 +++ b/numpy/distutils/unixccompiler.py
4 @@ -44,8 +44,6 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
6 self.linker_so = llink_s.split() + opt.split()
8 - display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
10 # gcc style automatic dependencies, outputs a makefile (-MF) that lists
11 # all headers needed by a c file as a side effect of compilation (-MMD)
12 if getattr(self, '_auto_depends', False):
13 @@ -54,8 +52,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts
17 - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
18 - extra_postargs, display = display)
19 + if self.detect_language(src) == 'c++':
20 + display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src)
21 + self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + deps +
22 + extra_postargs, display = display)
24 + display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src)
25 + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps +
26 + extra_postargs, display = display)
28 except DistutilsExecError:
29 msg = str(get_exception())
30 raise CompileError(msg)