Confining CPPFLAGS=-P to only happen for GCC. (#3404)

This commit is contained in:
Jon Rood 2017-03-10 11:48:03 -07:00 committed by Adam J. Stewart
parent 22d7f9da40
commit 6066526492

View file

@ -46,9 +46,6 @@ class Ncurses(AutotoolsPackage):
def configure_args(self):
opts = [
# The CPPFLAGS setting works around this bug:
# <http://stackoverflow.com/questions/37475222/ncurses-6-0-compilation-error-error-expected-before-int>
'CPPFLAGS=-P',
'CFLAGS={0}'.format(self.compiler.pic_flag),
'CXXFLAGS={0}'.format(self.compiler.pic_flag),
'--with-shared',
@ -60,6 +57,13 @@ def configure_args(self):
'--enable-pc-files',
'--with-pkg-config-libdir={0}/lib/pkgconfig'.format(self.prefix)
]
if '+symlinks' in self.spec:
opts += ["--enable-symlinks"]
opts.append('--enable-symlinks')
# The CPPFLAGS setting works around this bug:
# <http://stackoverflow.com/questions/37475222/ncurses-6-0-compilation-error-error-expected-before-int>
if self.spec.satisfies('%gcc'):
opts.append('CPPFLAGS=-P')
return opts