Skip to content

Commit

Permalink
Merge pull request #7068 from radarhere/ldconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed May 15, 2023
2 parents ce22ad9 + ca2bf04 commit 86a70fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os
import re
import shutil
import struct
import subprocess
import sys
Expand Down Expand Up @@ -150,6 +151,7 @@ def _dbg(s, tp=None):
def _find_library_dirs_ldconfig():
# 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 struct.calcsize("l") == 4:
machine = os.uname()[4] + "-32"
Expand All @@ -166,14 +168,14 @@ def _find_library_dirs_ldconfig():

# Assuming GLIBC's ldconfig (with option -p)
# Alpine Linux uses musl that can't print cache
args = ["ldconfig", "-p"]
args = [ldconfig, "-p"]
expr = rf".*\({abi_type}.*\) => (.*)"
env = dict(os.environ)
env["LC_ALL"] = "C"
env["LANG"] = "C"

elif sys.platform.startswith("freebsd"):
args = ["ldconfig", "-r"]
args = [ldconfig, "-r"]
expr = r".* => (.*)"
env = {}

Expand Down

0 comments on commit 86a70fc

Please sign in to comment.