From a8802247d5a8b2b468fb7bfc536e956b83978ad0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 28 Jul 2020 02:21:12 -0400 Subject: [PATCH] Use same Make as FreeType's configure to build it. Namely, it's necessary to use `gmake` on BSD, since their `make` does not work. --- setupext.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/setupext.py b/setupext.py index 958a01ae1093..1be0e744f7b5 100644 --- a/setupext.py +++ b/setupext.py @@ -597,7 +597,21 @@ def do_custom_build(self, env): "--with-png=no", "--with-harfbuzz=no", "--enable-static", "--disable-shared"], env=env, cwd=src_path) - subprocess.check_call(["make"], env=env, cwd=src_path) + if 'GNUMAKE' in env: + make = env['GNUMAKE'] + elif 'MAKE' in env: + make = env['MAKE'] + else: + try: + output = subprocess.check_output(['make', '-v'], + stderr=subprocess.DEVNULL) + except subprocess.CalledProcessError: + output = b'' + if b'GNU' not in output and b'makepp' not in output: + make = 'gmake' + else: + make = 'make' + subprocess.check_call([make], env=env, cwd=src_path) else: # compilation on windows shutil.rmtree(src_path / "objs", ignore_errors=True) msbuild_platform = (