aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-25 15:11:33 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-25 15:11:33 -0400
commite531c0179299de7fbaa84dda39ab1bd289cecf88 (patch)
treeef36533c3e27db68404ce787aaf7f0abe96ca327 /Makefile
parent4740cc22f39f6eb1c056c07b66fec11d76340704 (diff)
Speculative fix for Mac: use llvm-objcopy instead of patchelf for Mach-O
shared library files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 75ed5ef7..fd51f8d3 100644
--- a/Makefile
+++ b/Makefile
@@ -155,11 +155,16 @@ examples:
deps:
bash ./install_dependencies.sh
-check-utilities:
+check-utilities: check-c-compiler
@which objcopy 2>/dev/null >/dev/null \
|| { printf '\033[31;1m%s\033[m\n' "I couldn't find 'objcopy' on your system! Try installing the package 'binutils' with your package manager."; exit 1; }
- @which patchelf 2>/dev/null >/dev/null \
- || { printf '\033[31;1m%s\033[m\n' "I couldn't find 'patchelf' on your system! Try installing the package 'binutils' with your package manager."; exit 1; }
+ @if echo | $(DEFAULT_C_COMPILER) -dM -E - | grep -q '__ELF__'; then \
+ which patchelf 2>/dev/null >/dev/null \
+ || { printf '\033[31;1m%s\033[m\n' "I couldn't find 'patchelf' on your system! Try installing the package 'binutils' with your package manager."; exit 1; }; \
+ else \
+ which llvm-objcopy 2>/dev/null >/dev/null \
+ || { printf '\033[31;1m%s\033[m\n' "I couldn't find 'llvm-objcopy' on your system! Try installing the package 'llvm' with your package manager."; exit 1; }; \
+ fi
@which nm 2>/dev/null >/dev/null \
|| { printf '\033[31;1m%s\033[m\n' "I couldn't find 'nm' on your system! Try installing the package 'binutils' with your package manager."; exit 1; }
@which awk 2>/dev/null >/dev/null \