diff options
author | Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com> | 2022-12-07 17:39:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 11:39:02 -0500 |
commit | d464185bba7fc6fb4f81f0687da4889451346cef (patch) | |
tree | 617131dddfc2f00be9da1e579fee875bac115af6 /var | |
parent | 7f4d71252b70cef18de03b5710da6eec514ec515 (diff) | |
download | spack-d464185bba7fc6fb4f81f0687da4889451346cef.tar.gz spack-d464185bba7fc6fb4f81f0687da4889451346cef.tar.bz2 spack-d464185bba7fc6fb4f81f0687da4889451346cef.tar.xz spack-d464185bba7fc6fb4f81f0687da4889451346cef.zip |
bcache: support external gettext when `libintl` is in glibc (#34114)
* bcache: support external gettext when `libintl` is in glibc
Many glibc-based Linux systems don't have gettext's libintl because
libintl is included in the standard system's glibc (libc) itself.
When using `spack external find gettext` on those, packages like
`bcache` which unconditionally to link using `-lintl` fail to link
with -lintl.
Description of the fix:
The libs property of spack's gettext recipe returns the list of libs,
so when gettext provides libintl, use it. When not, there is no
separate liblint library and the libintl API is provided by glibc.
Tested with `spack external find gettext` on glibc-based Linux and
in musl-based Alpine Linux to make sure that when -lintl is really
needed, it is really used and nothing breaks.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/bcache/package.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/bcache/package.py b/var/spack/repos/builtin/packages/bcache/package.py index 61ee6ff5ea..6cf3678c85 100644 --- a/var/spack/repos/builtin/packages/bcache/package.py +++ b/var/spack/repos/builtin/packages/bcache/package.py @@ -25,7 +25,9 @@ class Bcache(MakefilePackage): depends_on("pkgconfig", type="build") def setup_build_environment(self, env): - env.append_flags("LDFLAGS", "-lintl") + # Add -lintl if provided by gettext, otherwise libintl is provided by the system's glibc: + if any("libintl" in filename for filename in self.libs): + env.append_flags("LDFLAGS", "-lintl") patch( "func_crc64.patch", |