diff options
author | Todor Tomov <ttomov@mm-sol.com> | 2011-02-03 10:50:48 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-02-07 16:32:44 +0100 |
commit | d4968694e251f603e7c2b91608746cf4c382723a (patch) | |
tree | 6a46bfc59051f7469824108a8819dd08dd75f59e /configure.in | |
parent | 14ddd592a6fcba2ceb751c0d4b0a3b5d46f2a59f (diff) |
Use autotools
Use autoconf and automake for building.
Quick instructions are added in INSTALL.
Application source files are moved to src subdirectory.
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..1b627bc --- /dev/null +++ b/configure.in @@ -0,0 +1,61 @@ +AC_PREREQ([2.65]) +AC_INIT([media-ctl], [0.0.1], [laurent.pinchart@ideasonboard.com]) +AC_CONFIG_SRCDIR([src/main.c]) +AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_HEADERS([config.h]) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Kernel headers path. +AC_ARG_WITH(kernel-headers, + [AC_HELP_STRING([--with-kernel-headers=DIR], + [specify path of Linux kernel headers [/usr/src/kernel-headers]])], + [case "${withval}" in + yes | no) AC_MSG_ERROR([bad value ${withval} for --with-kernel-headers]) ;; + *) KERNEL_HEADERS_DIR="${withval}" ;; + esac], + [KERNEL_HEADERS_DIR="/usr/src/kernel-headers"]) + +CPPFLAGS="-I$KERNEL_HEADERS_DIR/include" + +# Checks for header files. +AC_CHECK_HEADERS([linux/media.h \ + linux/types.h \ + linux/v4l2-mediabus.h \ + linux/v4l2-subdev.h \ + linux/videodev2.h], + [], + [echo "ERROR: Kernel header file not found or not usable!"; exit 1]) + +AC_CHECK_HEADERS([fcntl.h \ + stdlib.h \ + string.h \ + sys/ioctl.h \ + sys/time.h \ + unistd.h], + [], + [echo "ERROR: Header file not found or not usable!"; exit 1]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_SIZE_T +AC_CHECK_MEMBERS([struct stat.st_rdev]) + +# Checks for library functions. +AC_HEADER_MAJOR +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([memset strerror strrchr strtoul]) + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) + +AC_OUTPUT + |