summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-07-12 16:26:55 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2016-07-13 11:45:16 -0500
commitd09b0c95ec587cbb9ac45f6a2a106060dfb38643 (patch)
tree67f427c593886db8455ef667387d0b8ba2edee09 /var
parent27aa265abda39453d106b75c1131f00a0a50f25c (diff)
downloadspack-d09b0c95ec587cbb9ac45f6a2a106060dfb38643.tar.gz
spack-d09b0c95ec587cbb9ac45f6a2a106060dfb38643.tar.bz2
spack-d09b0c95ec587cbb9ac45f6a2a106060dfb38643.tar.xz
spack-d09b0c95ec587cbb9ac45f6a2a106060dfb38643.zip
Filter both makefiles to allow intel to build bzip2
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/bzip2/package.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/bzip2/package.py b/var/spack/repos/builtin/packages/bzip2/package.py
index 3b6d1d830e..ea76911dee 100644
--- a/var/spack/repos/builtin/packages/bzip2/package.py
+++ b/var/spack/repos/builtin/packages/bzip2/package.py
@@ -39,14 +39,17 @@ class Bzip2(Package):
def patch(self):
- mf = FileFilter('Makefile-libbz2_so')
- mf.filter(r'^CC=gcc', 'CC=cc')
+ # bzip2 comes with two separate Makefiles for static and dynamic builds
+ # Tell both to use Spack's compiler wrapper instead of GCC
+ filter_file(r'^CC=gcc', 'CC=cc', 'Makefile')
+ filter_file(r'^CC=gcc', 'CC=cc', 'Makefile-libbz2_so')
# Below stuff patches the link line to use RPATHs on Mac OS X.
if 'darwin' in self.spec.architecture:
v = self.spec.version
v1, v2, v3 = (v.up_to(i) for i in (1,2,3))
+ mf = FileFilter('Makefile-libbz2_so')
mf.filter('$(CC) -shared -Wl,-soname -Wl,libbz2.so.{0} -o libbz2.so.{1} $(OBJS)'.format(v2, v3),
'$(CC) -dynamiclib -Wl,-install_name -Wl,@rpath/libbz2.{0}.dylib -current_version {1} -compatibility_version {2} -o libbz2.{3}.dylib $(OBJS)'.format(v1, v2, v3, v3), string=True)
@@ -59,8 +62,10 @@ class Bzip2(Package):
def install(self, spec, prefix):
+ # Build the dynamic library first
make('-f', 'Makefile-libbz2_so')
- make('clean')
+ # Build the static library and everything else
+ make()
make("install", "PREFIX=%s" % prefix)
install('bzip2-shared', join_path(prefix.bin, 'bzip2'))