multifdsink: depends on sys/socket.h
authorThomas Vander Stichele <thomas (at) apestaart (dot) org>
Sun, 12 Feb 2012 21:04:02 +0000 (22:04 +0100)
committerThomas Vander Stichele <thomas (at) apestaart (dot) org>
Sun, 12 Feb 2012 21:23:45 +0000 (22:23 +0100)
configure.ac
gst/tcp/Makefile.am
gst/tcp/gsttcpplugin.c

index 5cb21e3..22643b5 100644 (file)
@@ -187,6 +187,11 @@ AC_COMPILE_IFELSE(
 CPPFLAGS="$ac_cppflags_save"
 AM_CONDITIONAL(HAVE_LIBXML_HTML, test "x$HAVE_LIBXML_HTML" = "xyes")
 
+dnl used in gst/tcp
+AC_CHECK_HEADERS([sys/socket.h],
+  HAVE_SYS_SOCKET_H="yes", HAVE_SYS_SOCKET_H="no")
+AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
+
 dnl used in gst-libs/gst/pbutils and associated unit test
 AC_CHECK_HEADERS([process.h sys/types.h sys/wait.h sys/stat.h])
 
index 7c20dc6..0882761 100644 (file)
@@ -13,10 +13,17 @@ built_headers = gsttcp-enumtypes.h gsttcp-marshal.h
 
 BUILT_SOURCES = $(built_sources) $(built_headers)
 
+if HAVE_SYS_SOCKET_H
+multifdsink_SOURCES = \
+       gstmultifdsink.c
+else
+multifdsink_SOURCES =
+endif
+
 libgsttcp_la_SOURCES = \
        gsttcpplugin.c \
        gsttcpclientsrc.c gsttcpclientsink.c \
-       gstmultifdsink.c  \
+       $(multifdsink_SOURCES) \
        gstmultihandlesink.c  \
        gstmultisocketsink.c  \
        gsttcpserversrc.c gsttcpserversink.c
index f2a5953..2496d19 100644 (file)
@@ -45,9 +45,11 @@ plugin_init (GstPlugin * plugin)
   if (!gst_element_register (plugin, "tcpserversrc", GST_RANK_NONE,
           GST_TYPE_TCP_SERVER_SRC))
     return FALSE;
+#ifdef HAVE_SYS_SOCKET_H
   if (!gst_element_register (plugin, "multifdsink", GST_RANK_NONE,
           GST_TYPE_MULTI_FD_SINK))
     return FALSE;
+#endif
   if (!gst_element_register (plugin, "multisocketsink", GST_RANK_NONE,
           GST_TYPE_MULTI_SOCKET_SINK))
     return FALSE;