From 2399c2e78d2ae0f28040ca345c80d11ef42e060e Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 12 Oct 2020 16:35:52 +0200 Subject: autotools: refactor search paths for aclocal in its own method (#19258) This commit refactors the computation of the search path for aclocal in its own method, so that it's easier to reuse for packages that need to have a custom autoreconf phase. Co-authored-by: Toyohisa Kameyama --- lib/spack/spack/build_systems/autotools.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 50f0208741..e4b9f566ae 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -266,14 +266,19 @@ class AutotoolsPackage(PackageBase): # This line is what is needed most of the time # --install, --verbose, --force autoreconf_args = ['-ivf'] - for dep in spec.dependencies(deptype='build'): - if os.path.exists(dep.prefix.share.aclocal): - autoreconf_args.extend([ - '-I', dep.prefix.share.aclocal - ]) + autoreconf_args += self.autoreconf_search_path_args autoreconf_args += self.autoreconf_extra_args m.autoreconf(*autoreconf_args) + @property + def autoreconf_search_path_args(self): + """Arguments to autoreconf to modify the search paths""" + search_path_args = [] + for dep in self.spec.dependencies(deptype='build'): + if os.path.exists(dep.prefix.share.aclocal): + search_path_args.extend(['-I', dep.prefix.share.aclocal]) + return search_path_args + @run_after('autoreconf') def set_configure_or_die(self): """Checks the presence of a ``configure`` file after the -- cgit v1.2.3-70-g09d2