From 34e8b1b2f072a0bcd8bed200703bdef8e57679fe Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 25 Oct 2025 13:42:27 +0100 Subject: [PATCH] Update compiler flags for homebrew packages on Apple silicon Add /opt/homebrew/{include,lib} flags for apple silicon macs, which are not included as default search paths by Clang/GCC. (Homebrew uses /usr/local/{include,lib} on intel macs) --- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f9346fdf..b716a349 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,11 @@ AC_DEFINE_UNQUOTED([PACKAGE_STATUS], ["$PACKAGE_STATUS"], [Status of this build] AS_IF([test "x$PLATFORM" = xcygwin], [AC_DEFINE([PLATFORM_CYGWIN], [1], [Cygwin])]) AS_IF([test "x$PLATFORM" = xosx], - [AC_DEFINE([PLATFORM_OSX], [1], [OSx])]) + [AC_DEFINE([PLATFORM_OSX], [1], [OSx]) + # Apple silicon homebrew flags + AC_CHECK_FILE([/opt/homebrew/include], + [AM_CFLAGS="$AM_CFLAGS -I/opt/homebrew/include" + AM_LDFLAGS="$AM_LDFLAGS -L/opt/homebrew/lib"])]) ## Environment variables AC_ARG_VAR([PYTHON_FRAMEWORK], [Set base directory for Python Framework])