summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Lee <lee218@llnl.gov>2017-07-06 21:07:54 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-07-06 23:07:54 -0500
commit28cb1e43790ab1d7103e9a7705dfafa923c8977b (patch)
tree78cee03c060022dc35c3901c120343d5a04b86a6 /lib
parente003e2f78b9e71b6315a657f9ce10a978a00cfc5 (diff)
downloadspack-28cb1e43790ab1d7103e9a7705dfafa923c8977b.tar.gz
spack-28cb1e43790ab1d7103e9a7705dfafa923c8977b.tar.bz2
spack-28cb1e43790ab1d7103e9a7705dfafa923c8977b.tar.xz
spack-28cb1e43790ab1d7103e9a7705dfafa923c8977b.zip
patch config.guess after autoreconf step (#4604)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/autotools.py27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py
index 4378d7aa58..84f019f1b3 100644
--- a/lib/spack/spack/build_systems/autotools.py
+++ b/lib/spack/spack/build_systems/autotools.py
@@ -95,10 +95,15 @@ class AutotoolsPackage(PackageBase):
#: Options to be passed to autoreconf when using the default implementation
autoreconf_extra_args = []
+ @run_after('autoreconf')
def _do_patch_config_guess(self):
"""Some packages ship with an older config.guess and need to have
this updated when installed on a newer architecture."""
+ if not self.patch_config_guess or not self.spec.satisfies(
+ 'arch=linux-rhel7-ppc64le'
+ ):
+ return
my_config_guess = None
config_guess = None
if os.path.exists('config.guess'):
@@ -120,11 +125,11 @@ class AutotoolsPackage(PackageBase):
try:
check_call([my_config_guess], stdout=PIPE, stderr=PIPE)
# The package's config.guess already runs OK, so just use it
- return True
+ return
except Exception:
pass
else:
- return True
+ return
# Look for a spack-installed automake package
if 'automake' in self.spec:
@@ -149,11 +154,11 @@ class AutotoolsPackage(PackageBase):
mod = stat(my_config_guess).st_mode & 0o777 | S_IWUSR
os.chmod(my_config_guess, mod)
shutil.copyfile(config_guess, my_config_guess)
- return True
+ return
except Exception:
pass
- return False
+ raise RuntimeError('Failed to find suitable config.guess')
@property
def configure_directory(self):
@@ -176,20 +181,6 @@ class AutotoolsPackage(PackageBase):
"""Override to provide another place to build the package"""
return self.configure_directory
- def patch(self):
- """Patches config.guess if
- :py:attr:``~.AutotoolsPackage.patch_config_guess`` is True
-
- :raise RuntimeError: if something goes wrong when patching
- ``config.guess``
- """
-
- if self.patch_config_guess and self.spec.satisfies(
- 'arch=linux-rhel7-ppc64le'
- ):
- if not self._do_patch_config_guess():
- raise RuntimeError('Failed to find suitable config.guess')
-
@run_before('autoreconf')
def delete_configure_to_force_update(self):
if self.force_autoreconf: