diff options
author | Mark W. Krentel <krentel@rice.edu> | 2019-08-06 22:21:25 -0500 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-08-06 22:21:25 -0500 |
commit | 2f84db881bf93d428aed101edf84e9dfa649317a (patch) | |
tree | 262a3cb6540b5573cbc61badfa695d3278eab0c0 | |
parent | e077532baf2ce214c407cdecfdd025405a085b4d (diff) | |
download | spack-2f84db881bf93d428aed101edf84e9dfa649317a.tar.gz spack-2f84db881bf93d428aed101edf84e9dfa649317a.tar.bz2 spack-2f84db881bf93d428aed101edf84e9dfa649317a.tar.xz spack-2f84db881bf93d428aed101edf84e9dfa649317a.zip |
ncurses: fix pic and opt flags (#12272)
Resolves #11932.
Move the PIC flags from CFLAGS on the configure line to the spack
compiler wrapper for ncurses. The problem with the configure line for
autotools is that specifying CFLAGS sets the entire flags, thus
deleting the flags that configure would add itself.
By default, if CFLAGS is unspecified, then configure picks a sensible
default of `-g -O2`. But adding `-fPIC` erases these and it ends up
building unoptimized.
-rw-r--r-- | var/spack/repos/builtin/packages/ncurses/package.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py index 383c0bf1d5..a68021f078 100644 --- a/var/spack/repos/builtin/packages/ncurses/package.py +++ b/var/spack/repos/builtin/packages/ncurses/package.py @@ -36,10 +36,14 @@ class Ncurses(AutotoolsPackage): def setup_environment(self, spack_env, run_env): spack_env.unset('TERMINFO') + def flag_handler(self, name, flags): + if name == 'cflags' or name == 'cxxflags': + flags.append(self.compiler.pic_flag) + + return (flags, None, None) + def configure(self, spec, prefix): opts = [ - 'CFLAGS={0}'.format(self.compiler.pic_flag), - 'CXXFLAGS={0}'.format(self.compiler.pic_flag), '--with-shared', '--with-cxx-shared', '--enable-overwrite', |