test FIONREAD ioctl presence in an alternate header for Solaris 10 (and perhaps earli...
authorStéphane Loeuillet <gstreamer@leroutier.net>
Thu, 20 May 2004 19:19:26 +0000 (19:19 +0000)
committerStéphane Loeuillet <gstreamer@leroutier.net>
Thu, 20 May 2004 19:19:26 +0000 (19:19 +0000)
Original commit message from CVS:
test FIONREAD ioctl presence in an alternate header for Solaris 10 (and perhaps earlier versions)

configure.ac
gst/tcp/gsttcpclientsrc.c
m4/gst-fionread.m4 [new file with mode: 0644]

index af048155d4e75fb86e74ab7faf039e686263c5b2..452362d728ecdcb7ffc706ace374fcb76b9ee55b 100644 (file)
@@ -95,6 +95,9 @@ if test "x$GST_CVS" = "xyes"; then
   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
 fi
 
+dnl Check for FIONREAD ioctl declaration :
+HAVE_FIONREAD()
+
 dnl ############################################
 dnl # Super Duper options for plug-in building #
 dnl ############################################
index 86a46dd5f3ce9ee9941d6e6a5422750cc3a82018..11c65b6e9ce903757feabd73e1c37bebda4978f0 100644 (file)
 #include <arpa/inet.h>
 #include <sys/ioctl.h>
 
+#ifdef FIONREAD_IN_SYS_FILIO
+#include <sys/filio.h>
+#endif
+
 GST_DEBUG_CATEGORY (tcpclientsrc_debug);
 #define GST_CAT_DEFAULT tcpclientsrc_debug
 
diff --git a/m4/gst-fionread.m4 b/m4/gst-fionread.m4
new file mode 100644 (file)
index 0000000..820d5ce
--- /dev/null
@@ -0,0 +1,42 @@
+AC_DEFUN([HAVE_FIONREAD], [
+
+  AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
+  AC_CACHE_VAL(GST_FIONREAD_IN_SYS_IOCTL, [
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ioctl.h>
+], [
+int x = FIONREAD;
+if ( x )
+  return 0;
+    ], GST_FIONREAD_IN_SYS_IOCTL="yes",GST_FIONREAD_IN_SYS_IOCTL="no")
+  ])
+
+  AC_MSG_RESULT($GST_FIONREAD_IN_SYS_IOCTL)
+
+  if test "$GST_FIONREAD_IN_SYS_IOCTL" = "yes"; then
+    AC_DEFINE([FIONREAD_IN_SYS_IOCTL], 1, [FIONREAD ioctl found in sys/ioclt.h])
+
+  else
+
+    AC_MSG_CHECKING(for FIONREAD in sys/filio.h)
+    AC_CACHE_VAL(GST_FIONREAD_IN_SYS_FILIO, [
+      AC_TRY_COMPILE([
+  #include <sys/types.h>
+  #include <sys/filio.h>
+  ], [
+  int x = FIONREAD;
+  if ( x )
+    return 0;
+      ], GST_FIONREAD_IN_SYS_FILIO="yes",GST_FIONREAD_IN_SYS_FILIO="no")
+    ])
+
+    AC_MSG_RESULT($GST_FIONREAD_IN_SYS_FILIO)
+
+    if test "$GST_FIONREAD_IN_SYS_FILIO" = "yes"; then   
+      AC_DEFINE([FIONREAD_IN_SYS_FILIO], 1, [FIONREAD ioctl found in sys/filio.h])
+    fi
+
+  fi
+
+])