Add field support for the media bus format
[media-ctl.git] / configure.ac
1 AC_PREREQ([2.61])
2 AC_INIT([media-ctl], [0.0.1], [laurent.pinchart@ideasonboard.com])
3 AC_CONFIG_SRCDIR([src/main.c])
4 AC_CONFIG_AUX_DIR([config])
5 AC_CONFIG_HEADERS([config.h])
6 AC_CONFIG_MACRO_DIR([m4])
7
8 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
9
10 AC_MSG_ERROR([
11     --------------------------------------------------------------------
12     The media-ctl utility and libraries have been moved to the v4l-utils
13     package available at
14     
15         git://linuxtv.org/v4l-utils.git
16     
17     My v4l-utils development tree can be found at
18     
19         git://linuxtv.org/pinchartl/v4l-utils.git
20     
21     This git tree is deprecated and will not be updated.
22     --------------------------------------------------------------------
23 ])
24
25 # Checks for programs.
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 # automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
29 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
30 AC_PROG_LIBTOOL
31
32 # Checks for libraries.
33
34 AC_ARG_WITH([libudev],
35     AS_HELP_STRING([--with-libudev],
36         [Enable libudev to detect a device name]))
37
38 AS_IF([test "x$with_libudev" = "xyes"],
39     [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)],
40     [have_libudev=no])
41
42 AS_IF([test "x$have_libudev" = "xyes"],
43     [
44         AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
45         LIBUDEV_CFLAGS="$libudev_CFLAGS"
46         LIBUDEV_LIBS="$libudev_LIBS"
47         AC_SUBST(LIBUDEV_CFLAGS)
48         AC_SUBST(LIBUDEV_LIBS)
49     ],
50     [AS_IF([test "x$with_libudev" = "xyes"],
51         [AC_MSG_ERROR([libudev requested but not found])
52     ])
53 ])
54
55
56 # Kernel headers path.
57 AC_ARG_WITH(kernel-headers,
58     [AC_HELP_STRING([--with-kernel-headers=DIR],
59         [specify path of Linux kernel headers [/usr/src/kernel-headers]])],
60     [case "${withval}" in
61         yes | no) AC_MSG_ERROR([bad value ${withval} for --with-kernel-headers]) ;;
62         *)   KERNEL_HEADERS_DIR="${withval}" ;;
63      esac],
64     [KERNEL_HEADERS_DIR="/usr/src/kernel-headers"])
65
66 CPPFLAGS="$CPPFLAGS -I$KERNEL_HEADERS_DIR/include"
67
68 # Checks for header files.
69 AC_CHECK_HEADERS([linux/media.h \
70                   linux/types.h \
71                   linux/v4l2-mediabus.h \
72                   linux/v4l2-subdev.h \
73                   linux/videodev2.h],
74                   [],
75                   [echo "ERROR: Kernel header file not found or not usable!"; exit 1])
76
77 AC_CHECK_HEADERS([fcntl.h \
78                   stdlib.h \
79                   string.h \
80                   sys/ioctl.h \
81                   sys/time.h \
82                   unistd.h],
83                   [],
84                   [echo "ERROR: Header file not found or not usable!"; exit 1])
85
86 # Checks for typedefs, structures, and compiler characteristics.
87 AC_C_INLINE
88 AC_TYPE_SIZE_T
89 AC_CHECK_MEMBERS([struct stat.st_rdev])
90
91 # Checks for library functions.
92 AC_HEADER_MAJOR
93 AS_IF([test "x$cross_compiling" != "xyes"],
94     [
95         AC_FUNC_MALLOC
96         AC_FUNC_REALLOC
97     ])
98 AC_CHECK_FUNCS([memset strerror strrchr strtoul])
99
100 AC_CONFIG_FILES([
101  Makefile
102  src/Makefile
103  libmediactl.pc
104  libv4l2subdev.pc
105 ])
106
107 AC_OUTPUT
108