# HG changeset patch # User Franz Glasner # Date 1758083446 -7200 # Node ID 76e05e28f6a83ebd17244b6bbfc9b251c0a47064 # Parent b2d41d02518f0a438b30eacf3854057ed3f98665 Also use the LLVM linker by symlinking and use LLVM's ar now diff -r b2d41d02518f -r 76e05e28f6a8 Makefile.freebsd --- a/Makefile.freebsd Wed Sep 17 06:11:34 2025 +0200 +++ b/Makefile.freebsd Wed Sep 17 06:30:46 2025 +0200 @@ -1,6 +1,7 @@ # -*- mode: makefile; coding: utf-8 -*- # -# Needs GNU make (aka gmake) and binutils/ar (instead of FreeBSD /usr/bin/ar). +# Needs GNU make (aka gmake) and binutils/ar or LLVM/ar +# (instead of FreeBSD /usr/bin/ar). # # Building against an installed mupdf package fails because the libmupdfcpp.so # is missing. @@ -9,20 +10,21 @@ # # - Create a Python venv and activate it # -# - In the "bin"-directory of the venv symlink "make" to /usr/local/bin/ggmake -# and "ar" to /usr/local/bin/ar +# - Install a LLVM package that has the same version as the libclang +# Python package that will be used/installed +# (e.g. pkg install llvm18 because of libclang>=18,<19) +# +# - In the "bin"-directory of the venv symlink "make" to /usr/local/bin/gmake +# and "ar" to /usr/local/llvm18/bin/llvm-ar # # * Makefiles have GNU syntax -# * ar is called with @-response-files -- which are a GNU feature +# * ar is called with @-response-files -- which are a GNU feature (also +# implemented by LLVM's ar) # # - At first to not build with tesseract (OCR) # # export PYMUPDF_SETUP_MUPDF_TESSERACT=0 # -# - Install a LLVM package that has the same version as the libclang -# Python package that will be used/installed -# (e.g. pkg install llvm18 because of libclang>=18,<19) -# .PHONY: build @@ -40,16 +42,21 @@ PYTHON_PREFIXES!= $(PYTHON) -c 'import sys; print(sys.prefix); print(sys.base_prefix)' CLANG_DIR?= /usr/local/llvm18 -# Setting these does not work for some parts built by sub-makes +# +# Setting these does not work for some parts built by sub-makes. +# Symlink in the venv instead. +# #CC= $(CLANG_DIR)/bin/clang #CXX= $(CLANG_DIR)/bin/clang++ build: ifneq ($(firstword $(PYTHON_PREFIXES)),$(lastword $(PYTHON_PREFIXES))) $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/make || $(SYMLINK) $(LOCALBASE)/bin/gmake $(firstword $(PYTHON_PREFIXES))/bin/make - $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/ar || $(SYMLINK) $(LOCALBASE)/bin/ar $(firstword $(PYTHON_PREFIXES))/bin/ar +# $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/ar || $(SYMLINK) $(LOCALBASE)/bin/ar $(firstword $(PYTHON_PREFIXES))/bin/ar + $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/ar || $(SYMLINK) $(CLANG_DIR)/bin/llvm-ar $(firstword $(PYTHON_PREFIXES))/bin/ar $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/cc || $(SYMLINK) $(CLANG_DIR)/bin/clang $(firstword $(PYTHON_PREFIXES))/bin/cc $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/c++ || $(SYMLINK) $(CLANG_DIR)/bin/clang++ $(firstword $(PYTHON_PREFIXES))/bin/c++ + $(TEST) -e $(firstword $(PYTHON_PREFIXES))/bin/ld || $(SYMLINK) $(CLANG_DIR)/bin/ld.lld $(firstword $(PYTHON_PREFIXES))/bin/ld LIBCLANG_LIBRARY_PATH=$(LIBCLANG_LIBRARY_PATH) PYMUPDF_SETUP_MUPDF_BUILD=$(PYMUPDF_SETUP_MUPDF_BUILD) PYMUPDF_SETUP_MUPDF_TESSERACT=$(PYMUPDF_SETUP_MUPDF_TESSERACT) $(PYTHON) -m build --wheel --verbose --no-isolation else $(error Not in a Python virtual environment)