diff options
author | Geoffrey Oxberry <goxberry@gmail.com> | 2018-01-24 18:48:28 -0800 |
---|---|---|
committer | scheibelp <scheibel1@llnl.gov> | 2018-01-24 18:48:28 -0800 |
commit | e0082e0564ccb1fc838e3248e6d8306132166364 (patch) | |
tree | 190e544c764c72c1031d1cfc2fbb9d7633da155c | |
parent | b5daa51c06095fde57ffe05622bb1079355d3b73 (diff) | |
download | spack-e0082e0564ccb1fc838e3248e6d8306132166364.tar.gz spack-e0082e0564ccb1fc838e3248e6d8306132166364.tar.bz2 spack-e0082e0564ccb1fc838e3248e6d8306132166364.tar.xz spack-e0082e0564ccb1fc838e3248e6d8306132166364.zip |
libtool: symlink libtool{ize} to glibtool{ize} (#7060)
On Darwin and other BSD systems, the system 'libtool' and 'libtoolize'
are BSD libtool and libtoolize, respectively. Some build systems
require the GNU versions of these commands, so BSD package systems
tend to name the GNU versions 'glibtool' and 'glibtoolize',
respectively, to avoid namespace collisions.
A problem with the current libtool package is that it installs the GNU
libtool commands as 'libtool' and 'libtoolize', respectively, but
build systems on BSD platforms will attempt to run 'glibtool' and
'glibtoolize'. The expedient solution to this problem is to symlink
'libtool' to 'glibtool' and 'libtoolize' to 'glibtoolize', because
attempting to patch the detection logic one build system at a time
seems impractical.
-rw-r--r-- | var/spack/repos/builtin/packages/libtool/package.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index eca530ce0c..9e9005ccc5 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -46,8 +46,24 @@ class Libtool(AutotoolsPackage): join_path(self.prefix.share, 'aclocal')) def setup_dependent_package(self, module, dependent_spec): - # Automake is very likely to be a build dependency, - # so we add the tools it provides to the dependent module - executables = ['libtoolize', 'libtool'] + # Automake is very likely to be a build dependency, so we add + # 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. + executables = ['libtoolize', 'libtool', 'glibtoolize', 'glibtool'] for name in executables: setattr(module, name, self._make_executable(name)) + + @run_after('install') + def post_install(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')) |