Skip to content

Commit 2441044

Browse files
committed
Fix setup.py for FreeBSD, NetBSD
1 parent c26690d commit 2441044

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020

2121
ISA_L_SOURCE = os.path.join("src", "isal", "isa-l")
2222

23+
SYSTEM_IS_BSD = (sys.platform.startswith("freebsd") or
24+
sys.platform.startswith("netbsd"))
2325
SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or
24-
sys.platform.startswith("darwin"))
26+
sys.platform.startswith("darwin") or
27+
SYSTEM_IS_BSD)
2528
SYSTEM_IS_WINDOWS = sys.platform.startswith("win")
2629

2730
# Since pip builds in a temp directory by default, setting a fixed file in
@@ -113,7 +116,10 @@ def build_isa_l():
113116
cflags_param = "CFLAGS_aarch64"
114117
else:
115118
cflags_param = "CFLAGS_"
116-
subprocess.run(["make", "-j", str(cpu_count), "-f", "Makefile.unx",
119+
make_cmd = "make"
120+
if SYSTEM_IS_BSD:
121+
make_cmd = "gmake"
122+
subprocess.run([make_cmd, "-j", str(cpu_count), "-f", "Makefile.unx",
117123
"isa-l.h", "bin/isa-l.a",
118124
f"{cflags_param}={build_env.get('CFLAGS', '')}"],
119125
**run_args)

0 commit comments

Comments
 (0)