Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 1bfe30d

Browse files
author
Matthias Koeppe
committed
sage.env.cython_aliases: Another fix for macOS without zlib pc
1 parent b1b3787 commit 1bfe30d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sage/env.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,17 +398,20 @@ def cython_aliases():
398398
aliases[var + "CFLAGS"] = ""
399399
try:
400400
pc = pkgconfig.parse('zlib')
401+
libs = pkgconfig.libs(lib)
401402
except pkgconfig.PackageNotFoundError:
402403
from collections import defaultdict
403404
pc = defaultdict(list, {'libraries': ['z']})
405+
libs = "-lz"
404406
else:
405407
aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split()
406408
pc = pkgconfig.parse(lib)
409+
libs = pkgconfig.libs(lib)
407410
# INCDIR should be redundant because the -I options are also
408411
# passed in CFLAGS
409412
aliases[var + "INCDIR"] = pc['include_dirs']
410413
aliases[var + "LIBDIR"] = pc['library_dirs']
411-
aliases[var + "LIBEXTRA"] = list(filter(lambda s: not s.startswith(('-l','-L')), pkgconfig.libs(lib).split()))
414+
aliases[var + "LIBEXTRA"] = list(filter(lambda s: not s.startswith(('-l','-L')), libs.split()))
412415
aliases[var + "LIBRARIES"] = pc['libraries']
413416

414417
# LinBox needs special care because it actually requires C++11 with

0 commit comments

Comments
 (0)