Bug 270514

Summary: tools/build/Makefile: should include `/opt/local/bin` in PATH for host tools
Product: Base System Reporter: Tim McIntosh <tkmcintosh>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: pat
Priority: ---    
Version: 13.1-RELEASE   
Hardware: Any   
OS: Any   

Description Tim McIntosh 2023-03-29 07:19:27 UTC
MacPorts (the primary packaging system for macOS) places installed tools under `/opt/local/bin` by default. This path should be included in PATH as an alternative to `/usr/local/bin` for cross-building under macOS:

--- tools/build/Makefile.orig	2023-03-29 00:13:46
+++ tools/build/Makefile	2023-03-29 00:14:16
@@ -302,7 +302,7 @@
 host-symlinks:
 	@echo "Linking host tools into ${DESTDIR}/bin"
 .for _tool in ${_host_tools_to_symlink}
-	@export PATH=$${PATH}:/usr/local/bin; \
+	@export PATH=$${PATH}:/usr/local/bin:/opt/local/bin; \
 	source_path=`which ${_tool} || echo /dev/null/no/such`; \
 	if [ ! -e "$${source_path}" ] ; then \
 		echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \