Clean up the gcc package (#3511)
* Clean up the gcc package * Add preliminary testing support * Older versions of GCC do not depend on MPC * DejaGnu 1.4.4 cannot be built in parallel * Fix GCC test dir * Add two more deps required to run the testsuite
This commit is contained in:
parent
268d48b407
commit
1fe987949f
@ -37,3 +37,7 @@ class Dejagnu(AutotoolsPackage):
|
||||
|
||||
depends_on('expect')
|
||||
depends_on('tcl@8.5:')
|
||||
|
||||
# DejaGnu 1.4.4 cannot be built in parallel
|
||||
# `make check` also fails but this can be ignored
|
||||
parallel = False
|
||||
|
@ -59,9 +59,6 @@ class Gcc(AutotoolsPackage):
|
||||
variant('binutils',
|
||||
default=sys.platform != 'darwin',
|
||||
description="Build via binutils")
|
||||
variant('gold',
|
||||
default=sys.platform != 'darwin',
|
||||
description="Build the gold linker plugin for ld-based LTO")
|
||||
variant('piclibs',
|
||||
default=False,
|
||||
description="Build PIC versions of libgfortran.a and libstdc++.a")
|
||||
@ -70,12 +67,20 @@ class Gcc(AutotoolsPackage):
|
||||
depends_on("gmp")
|
||||
depends_on("mpc", when='@4.5:')
|
||||
depends_on("isl", when='@5.0:')
|
||||
depends_on("binutils~libiberty", when='+binutils ~gold')
|
||||
depends_on("binutils~libiberty+gold", when='+binutils +gold')
|
||||
depends_on("binutils~libiberty", when='+binutils')
|
||||
|
||||
# TODO: integrate these libraries.
|
||||
# depends_on("ppl")
|
||||
# depends_on("cloog")
|
||||
|
||||
# TODO: Add a 'test' deptype
|
||||
# https://github.com/LLNL/spack/issues/1279
|
||||
# depends_on('dejagnu@1.4.4', type='test')
|
||||
# depends_on('expect', type='test')
|
||||
# depends_on('tcl', type='test')
|
||||
# depends_on('autogen@5.5.4:', type='test')
|
||||
# depends_on('guile@1.4.1:', type='test')
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
patch('darwin/gcc-4.9.patch1', when='@4.9.3')
|
||||
patch('darwin/gcc-4.9.patch2', when='@4.9.3')
|
||||
@ -88,9 +93,6 @@ class Gcc(AutotoolsPackage):
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
prefix = self.spec.prefix
|
||||
# libjava/configure needs a minor fix to install into spack paths.
|
||||
filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure',
|
||||
string=True)
|
||||
|
||||
enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc'))
|
||||
|
||||
@ -112,12 +114,16 @@ def configure_args(self):
|
||||
new_header)
|
||||
|
||||
# Generic options to compile GCC
|
||||
options = ["--prefix=%s" % prefix, "--libdir=%s/lib64" % prefix,
|
||||
"--disable-multilib",
|
||||
"--enable-languages=" + ','.join(enabled_languages),
|
||||
"--with-mpc=%s" % spec['mpc'].prefix, "--with-mpfr=%s" %
|
||||
spec['mpfr'].prefix, "--with-gmp=%s" % spec['gmp'].prefix,
|
||||
"--enable-lto", "--with-quad"]
|
||||
options = [
|
||||
'--libdir={0}'.format(prefix.lib64),
|
||||
'--disable-multilib',
|
||||
'--enable-languages={0}'.format(','.join(enabled_languages)),
|
||||
'--with-mpfr={0}'.format(spec['mpfr'].prefix),
|
||||
'--with-gmp={0}'.format(spec['gmp'].prefix),
|
||||
'--enable-lto',
|
||||
'--with-quad'
|
||||
]
|
||||
|
||||
# Binutils
|
||||
if spec.satisfies('+binutils'):
|
||||
static_bootstrap_flags = "-static-libstdc++ -static-libgcc"
|
||||
@ -131,14 +137,18 @@ def configure_args(self):
|
||||
"--with-as=%s/bin/as" % spec['binutils'].prefix
|
||||
]
|
||||
options.extend(binutils_options)
|
||||
# Isl
|
||||
if 'isl' in spec:
|
||||
isl_options = ["--with-isl=%s" % spec['isl'].prefix]
|
||||
options.extend(isl_options)
|
||||
|
||||
# MPC
|
||||
if 'mpc' in spec:
|
||||
options.append('--with-mpc={0}'.format(spec['mpc'].prefix))
|
||||
|
||||
# ISL
|
||||
if 'isl' in spec:
|
||||
options.append('--with-isl={0}'.format(spec['isl'].prefix))
|
||||
|
||||
# macOS
|
||||
if sys.platform == 'darwin':
|
||||
darwin_options = ["--with-build-config=bootstrap-debug"]
|
||||
options.extend(darwin_options)
|
||||
options.append('--with-build-config=bootstrap-debug')
|
||||
|
||||
return options
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user