gcc: fixed compilation on OpenSUSE (#18190)

Set location for dependencies specifying explicitly both
the include and lib path. This permits to handle cases where
the libraries are installed in lib64 instead of lib.

fixes #17556
fixes #10842
closes #18150
This commit is contained in:
Massimiliano Culpo 2020-08-20 17:42:18 +02:00 committed by GitHub
parent 1addcff724
commit 573ce3fe81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,9 +451,7 @@ def configure_args(self):
'--enable-languages={0}'.format(
','.join(spec.variants['languages'].value)),
# Drop gettext dependency
'--disable-nls',
'--with-mpfr={0}'.format(spec['mpfr'].prefix),
'--with-gmp={0}'.format(spec['gmp'].prefix),
'--disable-nls'
]
# Use installed libz
@ -483,13 +481,23 @@ def configure_args(self):
'--enable-bootstrap',
])
# MPC
if 'mpc' in spec:
options.append('--with-mpc={0}'.format(spec['mpc'].prefix))
# Configure include and lib directories explicitly for these
# dependencies since the short GCC option assumes that libraries
# are installed in "/lib" which might not be true on all OS
# (see #10842)
#
# More info at: https://gcc.gnu.org/install/configure.html
for dep_str in ('mpfr', 'gmp', 'mpc', 'isl'):
if dep_str not in spec:
continue
# ISL
if 'isl' in spec:
options.append('--with-isl={0}'.format(spec['isl'].prefix))
dep_spec = spec[dep_str]
include_dir = dep_spec.headers.directories[0]
lib_dir = dep_spec.libs.directories[0]
options.extend([
'--with-{0}-include={1}'.format(dep_str, include_dir),
'--with-{0}-lib={1}'.format(dep_str, lib_dir)
])
# nvptx-none offloading for host compiler
if spec.satisfies('+nvptx'):