Fix built of the festival plugin with mingw32 by linking to ws2_32.dll and including winsock headers. Fixes bug #541522.

Original commit message from CVS:
Patch by: Damien Lespiau <damien dot lespiau at gmail dot com>
* configure.ac:
* gst/festival/Makefile.am:
* gst/festival/gstfestival.c:
Fix built of the festival plugin with mingw32 by linking to ws2_32.dll
and including winsock headers. Fixes bug #541522.
This commit is contained in:
Damien Lespiau 2008-07-04 16:06:09 +00:00 committed by Sebastian Dröge
parent 4e2dcf4015
commit 1f25b18c45
4 changed files with 28 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2008-07-04 Sebastian Dröge <sebastian.droege@collabora.co.uk>
Patch by: Damien Lespiau <damien dot lespiau at gmail dot com>
* configure.ac:
* gst/festival/Makefile.am:
* gst/festival/gstfestival.c:
Fix built of the festival plugin with mingw32 by linking to ws2_32.dll
and including winsock headers. Fixes bug #541522.
2008-07-03 Peter Kjellerstedt <pkj@axis.com> 2008-07-03 Peter Kjellerstedt <pkj@axis.com>
* ChangeLog: * ChangeLog:

View file

@ -303,6 +303,9 @@ dnl FIXME: maybe move to sys, or make work with winsock2
AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes) AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes) AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
dnl needed for festival
AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")
if test "x$HAVE_SYS_SOCKET_H" != "xyes"; then if test "x$HAVE_SYS_SOCKET_H" != "xyes"; then
AG_GST_DISABLE_PLUGIN(librfb) AG_GST_DISABLE_PLUGIN(librfb)
fi fi

View file

@ -1,11 +1,18 @@
plugin_LTLIBRARIES = libgstfestival.la plugin_LTLIBRARIES = libgstfestival.la
if HAVE_WINSOCK2_H
WINSOCK2_LIBS = -lws2_32
else
WINSOCK2_LIBS =
endif
libgstfestival_la_SOURCES = gstfestival.c libgstfestival_la_SOURCES = gstfestival.c
libgstfestival_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) libgstfestival_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
# we use net connection now... perhaps use the lib later # we use net connection now... perhaps use the lib later
# libgstfestival_la_LIBADD = $(FESTIVAL_LIBS) # libgstfestival_la_LIBADD = $(FESTIVAL_LIBS)
libgstfestival_la_LIBADD = $(GST_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-0.10 libgstfestival_la_LIBADD = $(GST_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-0.10 $(WINSOCK2_LIBS)
libgstfestival_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstfestival_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstfestival.h noinst_HEADERS = gstfestival.h

View file

@ -79,16 +79,23 @@
#include "config.h" #include "config.h"
#endif #endif
#include <glib.h> /* Needed for G_OS_XXXX macros */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef G_OS_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif
#include "gstfestival.h" #include "gstfestival.h"
#include <gst/audio/audio.h> #include <gst/audio/audio.h>