diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py index 74ed140a29..6a1e8d4996 100644 --- a/var/spack/repos/builtin/packages/ncurses/package.py +++ b/var/spack/repos/builtin/packages/ncurses/package.py @@ -46,9 +46,6 @@ class Ncurses(AutotoolsPackage): def configure_args(self): opts = [ - # The CPPFLAGS setting works around this bug: - # - '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: + # + if self.spec.satisfies('%gcc'): + opts.append('CPPFLAGS=-P') + return opts