summaryrefslogtreecommitdiff
path: root/m4/gst-fionread.m4
blob: 820d5cea640256bce8675d1c12fc9451cffde956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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

])