diff --git a/var/spack/repos/builtin/packages/libtiff/package.py b/var/spack/repos/builtin/packages/libtiff/package.py index 5fc01167aa..58f6b6171b 100644 --- a/var/spack/repos/builtin/packages/libtiff/package.py +++ b/var/spack/repos/builtin/packages/libtiff/package.py @@ -75,6 +75,9 @@ class Libtiff(CMakePackage, AutotoolsPackage): build_system(conditional("cmake", when="@4.0.5:"), "autotools", default="cmake") + variant("shared", default=True, description="Build shared") + variant("pic", default=False, description="Enable position-independent code (PIC)") + with when("build_system=cmake"): depends_on("cmake@3.9:", when="@4.3:", type="build") depends_on("cmake@2.8.11:", when="@4.0.10:4.2", type="build") @@ -112,6 +115,8 @@ class CMakeBuilder(CMakeBuilder): def cmake_args(self): args = [self.define_from_variant(var) for var in VARIANTS] args.append("-Dsphinx=OFF") + args += [self.define_from_variant("BUILD_SHARED_LIBS", "shared")] + args += [self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic")] # Remove empty strings args = [arg for arg in args if arg] @@ -124,6 +129,10 @@ def configure_args(self): args = [] for var in VARIANTS: args.extend(self.enable_or_disable(var)) + args.append("--disable-sphinx") + args.extend(self.enable_or_disable("shared")) + args.extend(self.with_or_without("pic")) + return args