[MPlayer-cygwin] [PATCH] live.com on mingw

Joey Parrish joey at nicewarrior.org
Tue Apr 20 05:43:27 CEST 2004


Okay,

Ross and list, here is my next attempt.  It's a bit cleaner for both the
mplayer patch and the live.com patch.  Hopefully this will cause no
problems in either live.com VC++, or in other MPlayer ports.  Also, the
mplayer patch contains a fix for an error in my last one, and the
live.com patch contains the config.mingw32 file that I left out of the
first one.  With this patch, all of the live.com distribution compiles
cleanly for me on mingw.

Ross: Let me know if this version is more acceptable.
List: Please test with these latest versions, and write back whether it
      works or not on your system.

--Joey

-- 
All philosophy is naive.
-------------- next part --------------
diff -Nur live/config.mingw32 live.com/config.mingw32
--- live/config.mingw32	Thu Jan  1 00:00:00 1970
+++ live.com/config.mingw32	Tue Apr 20 03:06:54 2004
@@ -0,0 +1,17 @@
+COMPILE_OPTS =		$(INCLUDES) -I. -O -DSOCKLEN_T=int
+C =			c
+C_COMPILER =		gcc
+C_FLAGS =		$(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D__MINGW32__
+CPP =			cpp
+CPLUSPLUS_COMPILER =	c++
+CPLUSPLUS_FLAGS =	$(COMPILE_OPTS) -D__MINGW32__ -Wall -Wno-deprecated
+OBJ =			o
+LINK =			c++ -o 
+LINK_OPTS =		-L.
+CONSOLE_LINK_OPTS =	$(LINK_OPTS)
+LIBRARY_LINK =		ld -o 
+LIBRARY_LINK_OPTS =	$(LINK_OPTS) -r -Bstatic
+LIB_SUFFIX =			a
+LIBS_FOR_CONSOLE_APPLICATION = -lws2_32
+LIBS_FOR_GUI_APPLICATION = -lws2_32
+EXE =
diff -Nur live/groupsock/Groupsock.cpp live.com/groupsock/Groupsock.cpp
--- live/groupsock/Groupsock.cpp	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/Groupsock.cpp	Tue Apr 20 02:34:11 2004
@@ -23,7 +23,7 @@
 //##### Eventually fix the following #include; we shouldn't know about tunnels
 #include "TunnelEncaps.hh"
 
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
 #include <strstrea.h>
 #else
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
diff -Nur live/groupsock/NetInterface.cpp live.com/groupsock/NetInterface.cpp
--- live/groupsock/NetInterface.cpp	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/NetInterface.cpp	Tue Apr 20 02:34:11 2004
@@ -21,7 +21,7 @@
 #include "NetInterface.hh"
 #include "GroupsockHelper.hh"
 
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__MINGW32__)
 #include <strstrea.h>
 #else
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
diff -Nur live/groupsock/include/NetCommon.h live.com/groupsock/include/NetCommon.h
--- live/groupsock/include/NetCommon.h	Fri Apr  9 18:03:04 2004
+++ live.com/groupsock/include/NetCommon.h	Tue Apr 20 03:08:41 2004
@@ -28,7 +28,7 @@
 
 #elif defined(__WIN32__) || defined(_WIN32)
 /* Windows */
-#if defined(_WINNT) || defined(__BORLANDC__)
+#if defined(_WINNT) || defined(__BORLANDC__) || defined(__MINGW32__)
 #define _MSWSOCK_
 #include <winsock2.h>
 #include <ws2tcpip.h>
-------------- next part --------------
diff -ur main.cvs/configure main.dev/configure
--- main.cvs/configure	Tue Apr 20 03:25:27 2004
+++ main.dev/configure	Tue Apr 20 03:24:05 2004
@@ -409,7 +409,7 @@
   [cC][yY][gG][wW][iI][nN]*)
     system_name=CYGWIN
     ;;
-  MINGW32*)
+  MINGW32*|MSYS*)
     system_name=MINGW32
     ;;
   MorphOS)
@@ -4975,6 +4975,10 @@
 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
 LIVE_LIBS += -lstdc++"
+  if mingw32 ; then
+    _live_libs_def="$_live_libs_def
+LIVE_LIBS += -lws2_32"
+  fi
   _ld_live='$(LIVE_LIBS)'
  _inputmodules="live.com $_inputmodules"
 else
diff -ur main.cvs/libmpdemux/demux_rtp.cpp main.dev/libmpdemux/demux_rtp.cpp
--- main.cvs/libmpdemux/demux_rtp.cpp	Tue Apr 20 03:25:27 2004
+++ main.dev/libmpdemux/demux_rtp.cpp	Tue Apr 20 03:33:54 2004
@@ -2,6 +2,10 @@
 ////////// and the "LIVE.COM Streaming Media" libraries:
 
 extern "C" {
+// on mingw, we must include windows.h before the things it conflicts
+#ifdef __MINGW32__    // with.  they are each protected from from
+#include <windows.h>  // windows.h, but not the other way around.
+#endif
 #include "demux_rtp.h"
 #include "stheader.h"
 }
diff -ur main.cvs/libmpdemux/demux_rtp_codec.cpp main.dev/libmpdemux/demux_rtp_codec.cpp
--- main.cvs/libmpdemux/demux_rtp_codec.cpp	Thu Nov  6 05:55:52 2003
+++ main.dev/libmpdemux/demux_rtp_codec.cpp	Tue Apr 20 03:35:21 2004
@@ -1,6 +1,9 @@
 ////////// Codec-specific routines used to interface between "MPlayer"
 ////////// and the "LIVE.COM Streaming Media" libraries:
 
+#ifdef __MINGW32__
+#define _OLE2_H // to avoid conflict on mingw
+#endif
 #include "demux_rtp_internal.h"
 extern "C" {
 #include "stheader.h"
diff -ur main.cvs/libmpdemux/stheader.h main.dev/libmpdemux/stheader.h
--- main.cvs/libmpdemux/stheader.h	Tue Apr 20 03:25:27 2004
+++ main.dev/libmpdemux/stheader.h	Tue Apr 20 03:24:05 2004
@@ -4,6 +4,8 @@
 // for AVIStreamHeader:
 #include "wine/avifmt.h"
 
+#ifndef _WINGDI_H // these conflict with wingdi.h:
+
 #ifndef _WAVEFORMATEX_
 #define _WAVEFORMATEX_
 typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
@@ -38,6 +40,8 @@
 	int	bmiColors[1];
 } BITMAPINFO, *LPBITMAPINFO;
 #endif
+
+#endif // ! _WINGDI_H
 
 // Stream headers:
 
diff -ur main.cvs/loader/wine/windef.h main.dev/loader/wine/windef.h
--- main.cvs/loader/wine/windef.h	Tue Apr 20 03:25:27 2004
+++ main.dev/loader/wine/windef.h	Tue Apr 20 03:33:36 2004
@@ -4,6 +4,8 @@
  * Copyright 1996 Alexandre Julliard
  */
 
+#ifndef _WINDEF_H // this file conflicts with windef.h on mingw32
+
 #ifndef __WINE_WINDEF_H
 #define __WINE_WINDEF_H
 
@@ -672,3 +674,5 @@
 #endif
 
 #endif /* __WINE_WINDEF_H */
+
+#endif // ! _WINDEF_H


More information about the MPlayer-cygwin mailing list