diff --git a/patches/macos-compile/0001-configure-Don-t-link-to-libunwind-if-not-necessary.patch b/patches/macos-compile/0001-configure-Don-t-link-to-libunwind-if-not-necessary.patch new file mode 100644 index 00000000..0bc900c7 --- /dev/null +++ b/patches/macos-compile/0001-configure-Don-t-link-to-libunwind-if-not-necessary.patch @@ -0,0 +1,44 @@ +From 4b299b286d73648250fedd699f2ef98e73a5e1a8 Mon Sep 17 00:00:00 2001 +From: Alexandre Julliard +Date: Mon, 2 Sep 2019 20:44:56 +0200 +Subject: [PATCH] configure: Don't link to libunwind if not necessary. + +Signed-off-by: Alexandre Julliard +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 0377509c60..e374edfdc5 100755 +--- a/configure ++++ b/configure +@@ -14904,9 +14904,9 @@ rm -f core conftest.err conftest.$ac_objext \ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_libunwind_unw_getcontext" >&5 + $as_echo "$wine_cv_have_libunwind_unw_getcontext" >&6; } +- test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" + LIBS=$save_libs + fi ++ test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" + if test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono + then + +diff --git a/configure.ac b/configure.ac +index d0af7ef4a1..ff81a172f9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1697,9 +1697,9 @@ then + [[unw_context_t context; unw_getcontext( &context );]])], + [wine_cv_have_libunwind_unw_getcontext="yes"], + [wine_cv_have_libunwind_unw_getcontext="no"])]) +- test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" + LIBS=$save_libs + fi ++ test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" + if test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono + then + AC_DEFINE(HAVE_LIBUNWIND,1,[Define to 1 if you have the `unwind' library (-lunwind).]) +-- +2.23.0.rc1 + diff --git a/patches/macos-compile/0002-winemac.drv-Fix-build-with-older-macOS-SDKs.patch b/patches/macos-compile/0002-winemac.drv-Fix-build-with-older-macOS-SDKs.patch new file mode 100644 index 00000000..18d54efb --- /dev/null +++ b/patches/macos-compile/0002-winemac.drv-Fix-build-with-older-macOS-SDKs.patch @@ -0,0 +1,141 @@ +From 0d23ecd9ec8a0c24e5444e0fc9cf6933cc39c960 Mon Sep 17 00:00:00 2001 +From: Zhiyi Zhang +Date: Mon, 2 Sep 2019 12:04:21 +0800 +Subject: [PATCH] winemac.drv: Fix build with older macOS SDKs. + +macOS SDKs older than 10.11 doesn't support Metal. +macOS 10.11 and 10.12 SDK support Metal but don't +support registryID in MTLDevice protocol. Recommend +using 10.13+ SDK. + +Signed-off-by: Zhiyi Zhang +Signed-off-by: Ken Thomases +Signed-off-by: Alexandre Julliard +--- + configure | 40 ++++++++++++++++++++++++++++++++ + configure.ac | 12 ++++++++++ + dlls/winemac.drv/cocoa_display.m | 5 ++-- + include/config.h.in | 3 +++ + 4 files changed, 57 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index a52e346b68..0c54e27f5f 100755 +--- a/configure ++++ b/configure +@@ -8952,6 +8952,46 @@ rm -f core conftest.err conftest.$ac_objext \ + then + METAL_LIBS="-framework Metal -framework QuartzCore" + ++ fi ++ ++ if test "$ac_cv_header_Metal_Metal_h" = "yes" ++ then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MTLDevice protocol supports registryID property" >&5 ++$as_echo_n "checking whether MTLDevice protocol supports registryID property... " >&6; } ++ ac_ext=m ++ac_cpp='$OBJCPP $CPPFLAGS' ++ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_objc_compiler_gnu ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++id device; device.registryID; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_objc_try_compile "$LINENO"; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++$as_echo "#define HAVE_MTLDEVICE_REGISTRYID 1" >>confdefs.h ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ + fi + + if test "$ac_cv_header_ApplicationServices_ApplicationServices_h" = "yes" +diff --git a/configure.ac b/configure.ac +index 1592812bf7..b39b6b2c90 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -859,6 +859,18 @@ case $host_os in + AC_SUBST(METAL_LIBS,"-framework Metal -framework QuartzCore") + fi + ++ dnl Check for MTLDevice registryID property ++ if test "$ac_cv_header_Metal_Metal_h" = "yes" ++ then ++ AC_MSG_CHECKING([whether MTLDevice protocol supports registryID property]) ++ AC_LANG_PUSH([Objective C]) ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[id device; device.registryID;]])], ++ [AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_MTLDEVICE_REGISTRYID, 1, [Define if MTLDevice protocol has registryID property.])], ++ [AC_MSG_RESULT(no)]) ++ AC_LANG_POP([Objective C]) ++ fi ++ + dnl Enable Mac driver on Mac OS X 10.6 or later + if test "$ac_cv_header_ApplicationServices_ApplicationServices_h" = "yes" + then +diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m +index 3863557d96..9d95eee99a 100644 +--- a/dlls/winemac.drv/cocoa_display.m ++++ b/dlls/winemac.drv/cocoa_display.m +@@ -21,7 +21,7 @@ + #include "config.h" + + #import +-#ifdef HAVE_METAL_METAL_H ++#ifdef HAVE_MTLDEVICE_REGISTRYID + #import + #endif + #include "macdrv_cocoa.h" +@@ -234,7 +234,7 @@ static int macdrv_get_gpu_info_from_entry(struct macdrv_gpu* gpu, io_registry_en + return ret; + } + +-#ifdef HAVE_METAL_METAL_H ++#ifdef HAVE_MTLDEVICE_REGISTRYID + + /*********************************************************************** + * macdrv_get_gpu_info_from_registry_id +@@ -337,7 +337,6 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count) + + static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count) + { +- TRACE("Metal support not compiled in\n"); + return -1; + } + +diff --git a/include/config.h.in b/include/config.h.in +index 924e11eac0..5f690df7b0 100644 +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -584,6 +584,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_MPG123_H + ++/* Define if MTLDevice protocol has registryID property. */ ++#undef HAVE_MTLDEVICE_REGISTRYID ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_NCURSES_H + +-- +2.23.0.rc1 + diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index eae5d4b0..60541019 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -169,6 +169,7 @@ patch_enable_all () enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_loader_KeyboardLayouts="$1" + enable_macos_compile="$1" enable_mmsystem_dll16_MIDIHDR_Refcount="$1" enable_mountmgr_DosDevices="$1" enable_mscoree_CorValidateImage="$1" @@ -632,6 +633,9 @@ patch_enable () loader-KeyboardLayouts) enable_loader_KeyboardLayouts="$2" ;; + macos-compile) + enable_macos_compile="$2" + ;; mmsystem.dll16-MIDIHDR_Refcount) enable_mmsystem_dll16_MIDIHDR_Refcount="$2" ;; @@ -4357,6 +4361,20 @@ if test "$enable_loader_KeyboardLayouts" -eq 1; then ) >> "$patchlist" fi +# Patchset macos-compile +# | +# | Modified files: +# | * configure, configure.ac, dlls/winemac.drv/cocoa_display.m, include/config.h.in +# | +if test "$enable_macos_compile" -eq 1; then + patch_apply macos-compile/0001-configure-Don-t-link-to-libunwind-if-not-necessary.patch + patch_apply macos-compile/0002-winemac.drv-Fix-build-with-older-macOS-SDKs.patch + ( + printf '%s\n' '+ { "Alexandre Julliard", "configure: Don'\''t link to libunwind if not necessary.", 1 },'; + printf '%s\n' '+ { "Zhiyi Zhang", "winemac.drv: Fix build with older macOS SDKs.", 1 },'; + ) >> "$patchlist" +fi + # Patchset mmsystem.dll16-MIDIHDR_Refcount # | # | This patchset fixes the following Wine bugs: