]> git.sesse.net Git - vlc/blobdiff - configure.ac.in
* configure.ac.in: vlc can now be built under cygwin with or without the
[vlc] / configure.ac.in
index fe4cd6577399c765e2f8b5f1a3971a84d72cf68a..5c78205fa80ccb8329441a7cad25a2ed698e3073 100644 (file)
@@ -95,21 +95,34 @@ case "x${target_os}" in
     LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
     LIBEXT=".dylib"
     ;;
-  x*mingw32*)
-    SYS=mingw32
-    AC_CHECK_TOOL(WINDRES, windres, :)
-    CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
-    LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
-    LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
-    LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
-    LDFLAGS_access_http="${LDFLAGS_http} -lws2_32"
-    LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
-    LIBEXT=".dll"
-    ;;
-  x*cygwin*)
-    SYS=cygwin
+  x*mingw32* | x*cygwin*)
     AC_CHECK_TOOL(WINDRES, windres, :)
     LIBEXT=".dll"
+
+    case "x${target_os}" in
+      x*mingw32*)
+        SYS=mingw32
+        ;;
+      x*cygwin*)
+        dnl Check if we are using the mno-cygwin mode in which case we are
+        dnl actually dealing with a mingw32 compiler.
+        AC_EGREP_CPP(yes,
+            [#ifdef WIN32
+             yes
+             #endif],
+            SYS=mingw32, SYS=cygwin)
+        ;;
+    esac
+
+    if test "x$SYS" = "xmingw32"; then
+        CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
+        CPPFLAGS="${CPPFLAGS_save}"
+        LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
+        LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
+        LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
+        LDFLAGS_access_http="${LDFLAGS_http} -lws2_32"
+        LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
+    fi
     ;;
   x*nto*)
     SYS=nto
@@ -1483,7 +1496,7 @@ AC_ARG_ENABLE(directx,
   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
 if test "x${enable_directx}" != "xno"
 then
-  if test "x${SYS}" = "xmingw32"
+  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
   then
     AC_ARG_WITH(directx,
     [    --with-directx=PATH   Win32 DirectX headers])
@@ -1667,10 +1680,11 @@ dnl  win32 waveOut plugin
 dnl
 AC_ARG_ENABLE(waveout,
   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
-if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
-  then
+if test "x${enable_waveout}" != "xno"; then
+  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
     PLUGINS="${PLUGINS} waveout"
     LDFLAGS_waveout="-lwinmm"
+  fi
 fi
 
 dnl