Skip to content
Snippets Groups Projects
Unverified Commit 73fe3ce1 authored by Adam J. Stewart's avatar Adam J. Stewart Committed by GitHub
Browse files

M4: add spack external find support (#16693)

parent f901947f
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import * import re
class M4(AutotoolsPackage, GNUMirrorPackage): class M4(AutotoolsPackage, GNUMirrorPackage):
...@@ -32,6 +32,18 @@ class M4(AutotoolsPackage, GNUMirrorPackage): ...@@ -32,6 +32,18 @@ class M4(AutotoolsPackage, GNUMirrorPackage):
build_directory = 'spack-build' build_directory = 'spack-build'
executables = ['^g?m4$']
@classmethod
def determine_version(cls, exe):
# Output on macOS:
# GNU M4 1.4.6
# Output on Linux:
# m4 (GNU M4) 1.4.18
output = Executable(exe)('--version', output=str, error=str)
match = re.search(r'GNU M4\)?\s+(\S+)', output)
return match.group(1) if match else None
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
args = ['--enable-c++'] args = ['--enable-c++']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment