From 8089aedde11bc2aa0ae5bd478bde01b0960ccbd2 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Sun, 8 Oct 2023 08:42:21 -0700 Subject: [PATCH] gettext: Add static and pic options (#37957) --- var/spack/repos/builtin/packages/gettext/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/gettext/package.py b/var/spack/repos/builtin/packages/gettext/package.py index 4ae7eb59d9..d7cccfb339 100644 --- a/var/spack/repos/builtin/packages/gettext/package.py +++ b/var/spack/repos/builtin/packages/gettext/package.py @@ -33,6 +33,8 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage): variant("tar", default=True, description="Enable tar support") variant("bzip2", default=True, description="Enable bzip2 support") variant("xz", default=True, description="Enable xz support") + variant("shared", default=True, description="Build shared libraries") + variant("pic", default=True, description="Enable position-independent code (PIC)") # Optional variants variant("libunistring", default=False, description="Use libunistring") @@ -54,6 +56,8 @@ class Gettext(AutotoolsPackage, GNUMirrorPackage): depends_on("libunistring", when="+libunistring") # depends_on('cvs') + conflicts("+shared~pic") + patch("test-verify-parallel-make-check.patch", when="@:0.19.8.1") patch("nvhpc-builtin.patch", when="@:0.21.0 %nvhpc") patch("nvhpc-export-symbols.patch", when="%nvhpc") @@ -87,6 +91,8 @@ def configure_args(self): "--without-cvs", ] + config_args.extend(self.enable_or_disable("shared")) + if self.spec["iconv"].name == "libc": config_args.append("--without-libiconv-prefix") elif not is_system_path(self.spec["iconv"].prefix): @@ -115,12 +121,16 @@ def configure_args(self): else: config_args.append("--with-included-libunistring") + config_args.extend(self.with_or_without("pic")) + return config_args @property def libs(self): - return find_libraries( + libs = find_libraries( ["libasprintf", "libgettextlib", "libgettextpo", "libgettextsrc", "libintl"], root=self.prefix, recursive=True, + shared=self.spec.variants["shared"].value, ) + return libs