From 0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sat, 2 Oct 2021 14:53:24 +0200 Subject: clingo-bootstrap: add a variant for static libstdc++ (#26421) --- .../repos/builtin/packages/clingo-bootstrap/package.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py index fcb96fa1d8..657e25ab80 100644 --- a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py @@ -14,6 +14,9 @@ class ClingoBootstrap(Clingo): variant('build_type', default='Release', values=('Release',), description='CMake build type') + variant('static_libstdcpp', default=False, + description='Require a static version of libstdc++') + # CMake at version 3.16.0 or higher has the possibility to force the # Python interpreter, which is crucial to build against external Python # in environment where more than one interpreter is in the same prefix @@ -56,14 +59,17 @@ class ClingoBootstrap(Clingo): return args def setup_build_environment(self, env): + opts = None if '%apple-clang platform=darwin' in self.spec: opts = '-mmacosx-version-min=10.13' elif '%gcc' in self.spec: - # This is either linux or cray - opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL' + if '+static_libstdcpp' in self.spec: + # This is either linux or cray + opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL' else: msg = 'unexpected compiler for spec "{0}"'.format(self.spec) raise RuntimeError(msg) - env.set('CXXFLAGS', opts) - env.set('LDFLAGS', opts) + if opts: + env.set('CXXFLAGS', opts) + env.set('LDFLAGS', opts) -- cgit v1.2.3-70-g09d2