# HG changeset patch # User Franz Glasner # Date 1758134145 -7200 # Node ID 59f1bd90b2a09c4c2b9d6602b128eef9294bdcd4 # Parent d6cbc8049ab0d8dd7b5113df771b9b1fe6d90049 Use "soname" on FreeBSD also. FreeBSD and Linux are now handled identical with regard to soname and library naming and packaging. diff -r d6cbc8049ab0 -r 59f1bd90b2a0 mupdf-source/Makerules --- a/mupdf-source/Makerules Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/Makerules Wed Sep 17 20:35:45 2025 +0200 @@ -139,6 +139,8 @@ LDFLAGS += -sTOTAL_MEMORY=48MB else ifeq ($(OS),Linux) LIB_LDFLAGS = -shared -Wl,-soname,$(notdir $@) + else ifeq ($(OS),FreeBSD) + LIB_LDFLAGS = -shared -Wl,-soname,$(notdir $@) else LIB_LDFLAGS = -shared endif diff -r d6cbc8049ab0 -r 59f1bd90b2a0 mupdf-source/scripts/pipcl.py --- a/mupdf-source/scripts/pipcl.py Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/scripts/pipcl.py Wed Sep 17 20:35:45 2025 +0200 @@ -1860,6 +1860,10 @@ def openbsd(): return platform.system() == 'OpenBSD' +def freebsd(): + return platform.system() == 'FreeBSD' + + class PythonFlags: ''' Compile/link flags for the current python, for example the include path @@ -2309,7 +2313,7 @@ return `path`. Useful if Linux shared libraries have been created with `-Wl,-soname,...`, where we need to embed the versioned library. ''' - if linux() and os.path.islink(path): + if (linux() or freebsd()) and os.path.islink(path): path2 = os.path.realpath(path) if subprocess.run(f'objdump -p {path2}|grep SONAME', shell=1, check=0).returncode == 0: return path2 diff -r d6cbc8049ab0 -r 59f1bd90b2a0 mupdf-source/scripts/wrap/__main__.py --- a/mupdf-source/scripts/wrap/__main__.py Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/scripts/wrap/__main__.py Wed Sep 17 20:35:45 2025 +0200 @@ -1674,7 +1674,7 @@ elif 'shared' in dir_so_flags: link_soname_arg = '' - if state.state_.linux and so_version: + if (state.state_.linux or state.state_.freebsd) and so_version: link_soname_arg = f'-Wl,-soname,{os.path.basename(libmupdfcpp)}' command = ( textwrap.dedent( f''' diff -r d6cbc8049ab0 -r 59f1bd90b2a0 pipcl.py --- a/pipcl.py Wed Sep 17 20:31:46 2025 +0200 +++ b/pipcl.py Wed Sep 17 20:35:45 2025 +0200 @@ -2317,6 +2317,9 @@ def openbsd(): return platform.system() == 'OpenBSD' +def freebsd(): + return platform.system() == 'FreeBSD' + def show_system(): ''' @@ -2863,7 +2866,7 @@ return `path`. Useful if Linux shared libraries have been created with `-Wl,-soname,...`, where we need to embed the versioned library. ''' - if linux() and os.path.islink(path): + if (linux() or freebsd()) and os.path.islink(path): path2 = os.path.realpath(path) if subprocess.run(f'objdump -p {path2}|grep SONAME', shell=1, check=0).returncode == 0: return path2