Additional formats used by BT-656 sensors
[media-ctl.git] / configure.in
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 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_LIBTOOL
13
14 # Checks for libraries.
15
16 AC_ARG_WITH([libudev],
17     AS_HELP_STRING([--with-libudev],
18         [Enable libudev to detect a device name]))
19
20 AS_IF([test "x$with_libudev" = "xyes"],
21     [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)],
22     [have_libudev=no])
23
24 AS_IF([test "x$have_libudev" = "xyes"],
25     [
26         AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
27         LIBUDEV_CFLAGS="$libudev_CFLAGS"
28         LIBUDEV_LIBS="$libudev_LIBS"
29         AC_SUBST(LIBUDEV_CFLAGS)
30         AC_SUBST(LIBUDEV_LIBS)
31     ],
32     [AS_IF([test "x$with_libudev" = "xyes"],
33         [AC_MSG_ERROR([libudev requested but not found])
34     ])
35 ])
36
37
38 # Kernel headers path.
39 AC_ARG_WITH(kernel-headers,
40     [AC_HELP_STRING([--with-kernel-headers=DIR],
41         [specify path of Linux kernel headers [/usr/src/kernel-headers]])],
42     [case "${withval}" in
43         yes | no) AC_MSG_ERROR([bad value ${withval} for --with-kernel-headers]) ;;
44         *)   KERNEL_HEADERS_DIR="${withval}" ;;
45      esac],
46     [KERNEL_HEADERS_DIR="/usr/src/kernel-headers"])
47
48 CPPFLAGS="-I$KERNEL_HEADERS_DIR/include"
49
50 # Checks for header files.
51 AC_CHECK_HEADERS([linux/media.h \
52                   linux/types.h \
53                   linux/v4l2-mediabus.h \
54                   linux/v4l2-subdev.h \
55                   linux/videodev2.h],
56                   [],
57                   [echo "ERROR: Kernel header file not found or not usable!"; exit 1])
58
59 AC_CHECK_HEADERS([fcntl.h \
60                   stdlib.h \
61                   string.h \
62                   sys/ioctl.h \
63                   sys/time.h \
64                   unistd.h],
65                   [],
66                   [echo "ERROR: Header file not found or not usable!"; exit 1])
67
68 # Checks for typedefs, structures, and compiler characteristics.
69 AC_C_INLINE
70 AC_TYPE_SIZE_T
71 AC_CHECK_MEMBERS([struct stat.st_rdev])
72
73 # Checks for library functions.
74 AC_HEADER_MAJOR
75 AS_IF([test "x$cross_compiling" != "xyes"],
76     [
77         AC_FUNC_MALLOC
78         AC_FUNC_REALLOC
79     ])
80 AC_CHECK_FUNCS([memset strerror strrchr strtoul])
81
82 AC_CONFIG_FILES([
83  Makefile
84  src/Makefile
85  libmediactl.pc
86  libv4l2subdev.pc
87 ])
88
89 AC_OUTPUT
90