mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Use "/sbin/ldconfig" if ldconfig is not found
This commit is contained in:
parent
943a7a89c5
commit
ca2bf046d3
6
setup.py
6
setup.py
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
import struct
|
import struct
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -150,6 +151,7 @@ def _dbg(s, tp=None):
|
||||||
def _find_library_dirs_ldconfig():
|
def _find_library_dirs_ldconfig():
|
||||||
# Based on ctypes.util from Python 2
|
# Based on ctypes.util from Python 2
|
||||||
|
|
||||||
|
ldconfig = "ldconfig" if shutil.which("ldconfig") else "/sbin/ldconfig"
|
||||||
if sys.platform.startswith("linux") or sys.platform.startswith("gnu"):
|
if sys.platform.startswith("linux") or sys.platform.startswith("gnu"):
|
||||||
if struct.calcsize("l") == 4:
|
if struct.calcsize("l") == 4:
|
||||||
machine = os.uname()[4] + "-32"
|
machine = os.uname()[4] + "-32"
|
||||||
|
@ -166,14 +168,14 @@ def _find_library_dirs_ldconfig():
|
||||||
|
|
||||||
# Assuming GLIBC's ldconfig (with option -p)
|
# Assuming GLIBC's ldconfig (with option -p)
|
||||||
# Alpine Linux uses musl that can't print cache
|
# Alpine Linux uses musl that can't print cache
|
||||||
args = ["ldconfig", "-p"]
|
args = [ldconfig, "-p"]
|
||||||
expr = rf".*\({abi_type}.*\) => (.*)"
|
expr = rf".*\({abi_type}.*\) => (.*)"
|
||||||
env = dict(os.environ)
|
env = dict(os.environ)
|
||||||
env["LC_ALL"] = "C"
|
env["LC_ALL"] = "C"
|
||||||
env["LANG"] = "C"
|
env["LANG"] = "C"
|
||||||
|
|
||||||
elif sys.platform.startswith("freebsd"):
|
elif sys.platform.startswith("freebsd"):
|
||||||
args = ["ldconfig", "-r"]
|
args = [ldconfig, "-r"]
|
||||||
expr = r".* => (.*)"
|
expr = r".* => (.*)"
|
||||||
env = {}
|
env = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user