libxpm: cope with system gettext if configured. (#10881)

* If gettext is installed in the system it won't be in the spec tree.
This commit is contained in:
Chris Green 2019-07-19 08:36:58 -05:00 committed by GitHub
parent ba0cd4d912
commit 9b763980b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,5 +27,9 @@ class Libxpm(AutotoolsPackage):
depends_on('util-macros', type='build')
def setup_environment(self, spack_env, run_env):
spack_env.append_flags('LDFLAGS', '-L{0} -lintl'.format(
self.spec['gettext'].prefix.lib))
# If libxpm is installed as an external package, gettext won't
# be available in the spec. See
# https://github.com/spack/spack/issues/9149 for details.
if 'gettext' in self.spec:
spack_env.append_flags('LDFLAGS', '-L{0} -lintl'.format(
self.spec['gettext'].prefix.lib))