From 3ad6754c1a92b8205e4d5b9ba71303307988c8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=A5=E7=BE=8E=E7=8C=AB?= Date: Sat, 8 Apr 2017 02:11:22 +0800 Subject: [PATCH] Add the 'shared' variant for protobuf. (#3703) --- var/spack/repos/builtin/packages/protobuf/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index e8010a496b..14eaf3739e 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -40,3 +40,14 @@ class Protobuf(AutotoolsPackage): depends_on('autoconf', type='build') depends_on('libtool', type='build') depends_on('m4', type='build') + + variant('shared', default=True, description='Build shared libraries.') + + def configure_args(self): + if '+shared' in self.spec: + return ['--enable-shared=yes', + '--enable-static=no'] + else: + return ['--enable-shared=no', + '--enable-static=yes', + '--with-pic=yes']