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.
This commit is contained in:
parent
e077532baf
commit
2f84db881b
@ -36,10 +36,14 @@ class Ncurses(AutotoolsPackage):
|
|||||||
def setup_environment(self, spack_env, run_env):
|
def setup_environment(self, spack_env, run_env):
|
||||||
spack_env.unset('TERMINFO')
|
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):
|
def configure(self, spec, prefix):
|
||||||
opts = [
|
opts = [
|
||||||
'CFLAGS={0}'.format(self.compiler.pic_flag),
|
|
||||||
'CXXFLAGS={0}'.format(self.compiler.pic_flag),
|
|
||||||
'--with-shared',
|
'--with-shared',
|
||||||
'--with-cxx-shared',
|
'--with-cxx-shared',
|
||||||
'--enable-overwrite',
|
'--enable-overwrite',
|
||||||
|
Loading…
Reference in New Issue
Block a user