configure: link with synchronization library when building for win8+ master
authorSteve Lhomme <robux4@ycbcr.xyz>
Fri, 5 Jun 2020 08:46:56 +0000 (10:46 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Fri, 5 Jun 2020 13:02:25 +0000 (15:02 +0200)
That's what should be used when calling WaitOnAddress.
It's not part of the kernel32.dll anymore.

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress

configure.ac

index 3f6e91a..08e87df 100644 (file)
@@ -266,6 +266,18 @@ case "${host_os}" in
     ],[
       AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
     ])
+    AC_MSG_CHECKING([if libsynchronization is needed])
+    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+      [[#if _WIN32_WINNT >= 0x0602
+       # error building for Win8+ and above
+       #endif
+      ]],[[;]])
+    ],[
+      AC_MSG_RESULT([no])
+    ],[
+      AC_MSG_RESULT([yes])
+      VLC_ADD_LIBS([libvlccore], [-lsynchronization])
+    ])
     AC_DEFINE([_WIN32_IE], [0x0600], [Define to '0x0600' for IE 6.0 (and shell) APIs.])
     AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
     AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])