From cc87de83cd39f6a7d6ac6e5eb5642504967c4319 Mon Sep 17 00:00:00 2001 From: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Wed, 20 Apr 2022 15:47:51 +0000 Subject: [PATCH] make emconfigure and emcmake work, kinda --- lib/spack/spack/build_environment.py | 7 +++++++ lib/spack/spack/build_systems/autotools.py | 5 ++++- lib/spack/spack/build_systems/cmake.py | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index d967b699114..028978e298f 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -512,6 +512,7 @@ def _set_variables_for_single_module(pkg, module): m.make_jobs = jobs # TODO: make these build deps that can be installed if not found. + # FIXME: !!!!! m.make = MakeExecutable('make', jobs) m.gmake = MakeExecutable('gmake', jobs) m.scons = MakeExecutable('scons', jobs) @@ -523,9 +524,15 @@ def _set_variables_for_single_module(pkg, module): # Find the configure script in the archive path # Don't use which for this; we want to find it in the current dir. m.configure = Executable('./configure') + m.emconfigure = Executable('emconfigure') + m.emconfigure.add_default_arg('./configure') m.meson = Executable('meson') + m.cmake = Executable('cmake') + m.emcmake = Executable('emcmake') + m.emcmake.add_default_arg('cmake') + m.ctest = MakeExecutable('ctest', jobs) if sys.platform == 'win32': diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 08c65bcda2b..4836e7b3651 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -419,7 +419,10 @@ def configure(self, spec, prefix): options += self.configure_args() with working_dir(self.build_directory, create=True): - inspect.getmodule(self).configure(*options) + if self.spec.satisfies('%emscripten'): + inspect.getmodule(self).emconfigure(*options) + else: + inspect.getmodule(self).configure(*options) def setup_build_environment(self, env): if (self.spec.platform == 'darwin' diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index f934947604d..a1ccbf317e1 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -374,7 +374,10 @@ def cmake(self, spec, prefix): options += self.cmake_args() options.append(os.path.abspath(self.root_cmakelists_dir)) with working_dir(self.build_directory, create=True): - inspect.getmodule(self).cmake(*options) + if self.spec.satisfies('%emscripten'): + inspect.getmodule(self).emcmake(*options) + else: + inspect.getmodule(self).cmake(*options) def build(self, spec, prefix): """Make the build targets"""