From 2788f53c283d212030dc2fdaa97d494cabf4a640 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 25 Mar 2011 17:06:19 +0100 Subject: ENH: distutils: provide better support for C++ code on HPUX. Closes #1383. --- numpy/distutils/unixccompiler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'numpy/distutils') diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py index cc1a9a4f9..dfc5a676f 100644 --- a/numpy/distutils/unixccompiler.py +++ b/numpy/distutils/unixccompiler.py @@ -17,6 +17,18 @@ else: # Note that UnixCCompiler._compile appeared in Python 2.3 def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): """Compile a single source files with a Unix-style compiler.""" + # HP ad-hoc fix, see ticket 1383 + ccomp = self.compiler_so + if ccomp[0] == 'aCC': + # remove flags that will trigger ANSI-C mode for aCC + if '-Ae' in ccomp: + ccomp.remove('-Ae') + if '-Aa' in ccomp: + ccomp.remove('-Aa') + # add flags for (almost) sane C++ handling + ccomp += ['-AA'] + self.compiler_so = ccomp + display = '%s: %s' % (os.path.basename(self.compiler_so[0]),src) try: self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -- cgit v1.2.1