]> git.sesse.net Git - vlc/blobdiff - configure.ac
configure.ac: Fix poll() presence check
[vlc] / configure.ac
index 134a4502fc0549a8b0171143421471d112b14e29..6e25605e10633fd9242e8f6653f4ceb19305d2c5 100644 (file)
@@ -258,8 +258,6 @@ case "${host_os}" in
         # DEP, ASLR, NO SEH
         LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
 
-        VLC_ADD_LDFLAGS([vlc],[-mwindows])
-        VLC_ADD_LIBS([win32text],[-lgdi32])
         AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
         ac_default_prefix="`pwd`/_win32"
         DESTDIR="`pwd`/_win32/"
@@ -456,6 +454,7 @@ AM_ICONV
 dnl
 dnl checks for mingw
 AS_IF([test "${SYS}" = "mingw32"], [
+
 dnl Check for broken versions of mingw-runtime compatability library
     AC_MSG_CHECKING(for broken mingw-runtime)
     AC_PREPROC_IFELSE([AC_LANG_SOURCE([
@@ -473,10 +472,14 @@ dnl Check for broken versions of mingw-runtime compatability library
         AC_MSG_RESULT([present])
         AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
     ])
+
     dnl force use of mingw provided c99 *printf over msvcrt
     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
 
-dnl Check for the need to include the mingwex lib for mingw32
+    dnl Add WinMainCRTStartup entry point to show it's a WinMain application
+    VLC_ADD_LDFLAGS([vlc],[-mwindows])
+
+    dnl Check for the need to include the mingwex lib for mingw32
     VLC_SAVE_FLAGS
     AC_CHECK_LIB(mingwex,opendir,
         AC_CHECK_LIB(mingw32,opendir,,
@@ -484,7 +487,7 @@ dnl Check for the need to include the mingwex lib for mingw32
     )
     VLC_RESTORE_FLAGS
 
-dnl Check for fnative-struct or mms-bitfields support for mingw32
+    dnl Check for fnative-struct or mms-bitfields support for mingw32
     VLC_SAVE_FLAGS
     CFLAGS="${CFLAGS} -mms-bitfields"
     CXXFLAGS="${CXXFLAGS} -mms-bitfields"
@@ -512,6 +515,7 @@ AS_IF([test "${SYS}" = "mingw32"],[
     vlc_winstore_app=1
      VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
     ],[
+     VLC_ADD_LIBS([win32text],[-lgdi32])
      VLC_ADD_LIBS([libvlccore],[-lwinmm])
     ])
   ])
@@ -605,6 +609,7 @@ AC_CHECK_TYPES([struct pollfd],,,
 #if HAVE_POLL
 # include <poll.h>
 #elif defined (_WIN32)
+# define _WIN32_WINNT 0x502
 # include <winsock2.h>
 #endif
 ])
@@ -3309,7 +3314,9 @@ if test "${enable_freetype}" != "no"; then
             ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
           fi
       else
-          VLC_ADD_LIBS([freetype],[-lgdi32])
+          AS_IF([test "$vlc_winstore_app" != "1"],[
+            VLC_ADD_LIBS([freetype],[-lgdi32])
+          ])
       fi
 
       dnl fribidi support