diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-11-04 13:06:36 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-11-04 13:06:36 +0100 |
| commit | afe87de0131903e5e4c0d6bbfd553560fd7f89e9 (patch) | |
| tree | 0b87955433bc8c68619fd9a4687f6875190b83e8 /configure.ac | |
| parent | 5e91ecfd58708e101860ce33e25a9651652c5cd6 (diff) | |
Correctly add weak-linked frameworks for increasingly high macOS versions
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 5c38a5de0..ac5154d32 100644 --- a/configure.ac +++ b/configure.ac @@ -1023,13 +1023,29 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [ # MacOS X uses Cocoa for graphics. LIBS="$LIBS -framework Cocoa" - macosversion_maj=$(sw_vers -productVersion | cut -d. -f1) - AS_IF([test $macosversion_maj -ge 11], [ - LIBS="$LIBS -weak_framework UniformTypeIdentifiers" - ]) - AS_IF([test $macosversion_maj -ge 15], [ - LIBS="$LIBS -weak_framework ScreenCaptureKit" - ]) + # Add weak-linked additional frameworks for increasingly high macOS versions + AC_LANG_PUSH([C]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <AvailabilityMacros.h> + #if __MAC_OS_X_VERSION_MAX_ALLOWED < 110000 + #error __MAC_OS_X_VERSION_MAX_ALLOWED < 110000 + #endif + ]], [[ + ]])], + [LIBS="$LIBS -weak_framework UniformTypeIdentifiers"], + []) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <AvailabilityMacros.h> + #if __MAC_OS_X_VERSION_MAX_ALLOWED < 150000 + #error __MAC_OS_X_VERSION_MAX_ALLOWED < 150000 + #endif + ]], [[ + ]])], + [LIBS="$LIBS -weak_framework ScreenCaptureKit"], + []) + AC_LANG_POP([]) AS_IF([test x$have_pthread = xyes], [ AC_DEFINE([HAVE_PTHREAD]) |
