1b627bc8c4b4c2fd62ef1a5c68daac16b00c982b
[media-ctl.git] / configure.in
1 AC_PREREQ([2.65])
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
7 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
8
9 # Checks for programs.
10 AC_PROG_CC
11
12 # Checks for libraries.
13
14 # Kernel headers path.
15 AC_ARG_WITH(kernel-headers,
16     [AC_HELP_STRING([--with-kernel-headers=DIR],
17         [specify path of Linux kernel headers [/usr/src/kernel-headers]])],
18     [case "${withval}" in
19         yes | no) AC_MSG_ERROR([bad value ${withval} for --with-kernel-headers]) ;;
20         *)   KERNEL_HEADERS_DIR="${withval}" ;;
21      esac],
22     [KERNEL_HEADERS_DIR="/usr/src/kernel-headers"])
23
24 CPPFLAGS="-I$KERNEL_HEADERS_DIR/include"
25
26 # Checks for header files.
27 AC_CHECK_HEADERS([linux/media.h \
28                   linux/types.h \
29                   linux/v4l2-mediabus.h \
30                   linux/v4l2-subdev.h \
31                   linux/videodev2.h],
32                   [],
33                   [echo "ERROR: Kernel header file not found or not usable!"; exit 1])
34
35 AC_CHECK_HEADERS([fcntl.h \
36                   stdlib.h \
37                   string.h \
38                   sys/ioctl.h \
39                   sys/time.h \
40                   unistd.h],
41                   [],
42                   [echo "ERROR: Header file not found or not usable!"; exit 1])
43
44 # Checks for typedefs, structures, and compiler characteristics.
45 AC_C_INLINE
46 AC_TYPE_SIZE_T
47 AC_CHECK_MEMBERS([struct stat.st_rdev])
48
49 # Checks for library functions.
50 AC_HEADER_MAJOR
51 AC_FUNC_MALLOC
52 AC_FUNC_REALLOC
53 AC_CHECK_FUNCS([memset strerror strrchr strtoul])
54
55 AC_CONFIG_FILES([
56  Makefile
57  src/Makefile
58 ])
59
60 AC_OUTPUT
61