diff options
author | Geoffrey Oxberry <goxberry@gmail.com> | 2018-01-28 06:36:24 -0800 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2018-01-28 15:36:24 +0100 |
commit | 784234ae8e246680ba77c946c1c348460cd2f145 (patch) | |
tree | 277a802637e67c6f7c6fe2bba9c971c0cff56647 /var | |
parent | 970c7e8f454fdaaa5d8826b5d696c05208e5a233 (diff) | |
download | spack-784234ae8e246680ba77c946c1c348460cd2f145.tar.gz spack-784234ae8e246680ba77c946c1c348460cd2f145.tar.bz2 spack-784234ae8e246680ba77c946c1c348460cd2f145.tar.xz spack-784234ae8e246680ba77c946c1c348460cd2f145.zip |
libtool, binutils: fix darwin linking (#7073)
* libtool: fix linking of libtool on darwin
* binutils, libtool: fix conflicts w/ BSD tools, v2
Fix namespace conflicts with BSD tools in a more elegant fashion,
using a program prefix, similar to Homebrew.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/binutils/package.py | 6 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/libtool/package.py | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index fde3810216..8d6777daf3 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -79,4 +79,10 @@ class Binutils(AutotoolsPackage): if '+libiberty' in spec: configure_args.append('--enable-install-libiberty') + # To avoid namespace collisions with Darwin/BSD system tools, + # prefix executables with "g", e.g., gar, gnm; see Homebrew + # https://github.com/Homebrew/homebrew-core/blob/master/Formula/binutils.rb + if spec.satisfies('platform=darwin'): + configure_args.append('--program-prefix=g') + return configure_args diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index 9e9005ccc5..b5d5c9b2b1 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -50,20 +50,19 @@ class Libtool(AutotoolsPackage): # the tools it provides to the dependent module. Some build # systems differentiate between BSD libtool (e.g., Darwin) and # GNU libtool, so also add 'glibtool' and 'glibtoolize' to the - # list of executables. + # list of executables. See Homebrew: + # https://github.com/Homebrew/homebrew-core/blob/master/Formula/libtool.rb executables = ['libtoolize', 'libtool', 'glibtoolize', 'glibtool'] for name in executables: setattr(module, name, self._make_executable(name)) - @run_after('install') - def post_install(self): + @when('platform=darwin') + def configure_args(self): # Some platforms name GNU libtool and GNU libtoolize # 'glibtool' and 'glibtoolize', respectively, to differentiate # them from BSD libtool and BSD libtoolize. On these BSD # platforms, build systems sometimes expect to use the assumed # GNU commands glibtool and glibtoolize instead of the BSD # variant; this happens frequently, for instance, on Darwin - symlink(join_path(self.prefix.bin, 'libtoolize'), - join_path(self.prefix.bin, 'glibtoolize')) - symlink(join_path(self.prefix.bin, 'libtoolize'), - join_path(self.prefix.bin, 'glibtoolize')) + args = ['--program-prefix=g'] + return args |