]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/omapdrmtest.git/blob - configure.ac
viddec3test: new option --no-process
[glsdk/omapdrmtest.git] / configure.ac
1 #  
2 #  Copyright (C) 2011 Texas Instruments
3 #  Author: Rob Clark <rob.clark@linaro.org>
4 #  
5 #  This program is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU General Public License version 2 as published by
7 #  the Free Software Foundation.
8 #  
9 #  This program is distributed in the hope that it will be useful, but WITHOUT
10 #  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 #  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12 #  more details.
13 #  
14 #  You should have received a copy of the GNU General Public License along with
15 #  this program.  If not, see <http://www.gnu.org/licenses/>.
16 #  
18 # Initialize Autoconf
19 AC_PREREQ([2.60])
20 AC_INIT([omapdrmtest], [1.0.0], [https://www.ti.com], [omapdrmtest])
21 AC_CONFIG_SRCDIR([Makefile.am])
22 AC_CONFIG_HEADERS([config.h])
24 # Initialize Automake
25 AM_INIT_AUTOMAKE([foreign dist-bzip2])
26 AM_MAINTAINER_MODE
28 # Enable quiet compiles on automake 1.11.
29 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31 # Initialize libtool
32 AC_PROG_LIBTOOL
34 # Obtain compiler/linker options for depedencies
35 PKG_CHECK_MODULES(DRM, libdrm libdrm_omap)
37 # Check for kernel headers
38 kversion=`uname -r`
39 AC_ARG_WITH([kernel-source],
40             [AS_HELP_STRING([--with-kernel-source],
41               [specify path to linux kernel source])],
42             [kernel_source="$with_kernel_source"],
43             [kernel_source="/usr/src/linux-headers-$kversion"])
45 if test -r "$kernel_source/include/linux/videodev2.h"; then
46     headers_cflags="$headers_cflags -I$kernel_source/include"
48     AC_SUBST(LIN_CFLAGS, [$headers_cflags])
49     AC_MSG_NOTICE([$kversion provides videodev2.h])
50 else
51     AC_MSG_NOTICE([Could not find $kernel_source/include/linux/videodev2.h])
52 fi
54 # Check for v4l2 dmabuf support:
55 AC_CHECK_MEMBER([struct v4l2_buffer.m.fd],
56         [HAVE_V4L2_DMABUF=yes],
57         [HAVE_V4L2_DMABUF=no],
58         [[#include <linux/videodev2.h>]])
59 if test "x$HAVE_V4L2_DMABUF" = "xyes"; then
60         AC_DEFINE(HAVE_V4L2_DMABUF, 1, [Have V4L2 DMABUF support])
61         AC_MSG_NOTICE([V4L2 DMABUF support detected])
62 else
63         AC_MSG_WARN([No V4L2 DMABUF support detected, disabling V4L2 DMABUF tests])
64 fi
65 AM_CONDITIONAL(ENABLE_V4L2_DMABUF, [test "x$HAVE_V4L2_DMABUF" = xyes])
67 # Check optional X11:
68 AC_ARG_ENABLE([x11], AS_HELP_STRING([--disable-x11], [disable x11/dri2video support]))
69 AS_IF([test "x$enable_x11" != "xno"], [PKG_CHECK_MODULES(X11, x11 dri2, [HAVE_X11=yes])])
70 if test "x$HAVE_X11" = "xyes"; then
71         AC_DEFINE(HAVE_X11, 1, [Have X11 support])
72 else
73         AC_MSG_WARN([No X11 support detected, disabling X11 support])
74 fi
75 AM_CONDITIONAL(ENABLE_X11, [test "x$HAVE_X11" = xyes])
77 # Check for libdce and libav..
78 PKG_CHECK_MODULES(DCE, libdce libavformat libavutil, [HAVE_DCE=yes], [HAVE_DCE=no])
79 if test "x$HAVE_DCE" = "xyes"; then
80         AC_DEFINE(HAVE_DCE, 1, [Have DCE support])
81         AC_MSG_NOTICE([Detected libdce and libavformat, building video codec tests])
82 else
83         AC_MSG_WARN([No libdce and/or libavformat support detected, disabling video codec tests])
84 fi
85 AM_CONDITIONAL(ENABLE_DCE, [test "x$HAVE_DCE" = xyes])
87 dnl ===========================================================================
88 dnl check compiler flags
89 AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
90   AC_MSG_CHECKING([whether $CC supports $1])
92   libdrm_save_CFLAGS="$CFLAGS"
93   CFLAGS="$CFLAGS $1"
95   AC_COMPILE_IFELSE([ ], [libdrm_cc_flag=yes], [libdrm_cc_flag=no])
96   CFLAGS="$libdrm_save_CFLAGS"
98   if test "x$libdrm_cc_flag" = "xyes"; then
99     ifelse([$2], , :, [$2])
100   else
101     ifelse([$3], , :, [$3])
102   fi
103   AC_MSG_RESULT([$libdrm_cc_flag])
104 ])
106 MAYBE_WARN="-Wall -Wextra \
107 -Wsign-compare -Werror-implicit-function-declaration \
108 -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
109 -Wnested-externs \
110 -Wpacked -Wswitch-enum -Wmissing-format-attribute \
111 -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
112 -Wdeclaration-after-statement -Wold-style-definition \
113 -Wno-missing-field-initializers -Wno-unused-parameter \
114 -Wno-attributes -Wno-long-long -Winline"
116 # invalidate cached value if MAYBE_WARN has changed
117 if test "x$libdrm_cv_warn_maybe" != "x$MAYBE_WARN"; then
118         unset libdrm_cv_warn_cflags
119 fi
120 AC_CACHE_CHECK([for supported warning flags], libdrm_cv_warn_cflags, [
121         echo
122         WARN_CFLAGS=""
124         # Some warning options are not supported by all versions of
125         # gcc, so test all desired options against the current
126         # compiler.
127         #
128         # Note that there are some order dependencies
129         # here. Specifically, an option that disables a warning will
130         # have no net effect if a later option then enables that
131         # warnings, (perhaps implicitly). So we put some grouped
132         # options (-Wall and -Wextra) up front and the -Wno options
133         # last.
135         for W in $MAYBE_WARN; do
136                 LIBDRM_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
137         done
139         libdrm_cv_warn_cflags=$WARN_CFLAGS
140         libdrm_cv_warn_maybe=$MAYBE_WARN
142         AC_MSG_CHECKING([which warning flags were supported])])
143 WARN_CFLAGS="$libdrm_cv_warn_cflags"
144 AC_SUBST(WARN_CFLAGS)
147 AC_CONFIG_FILES([Makefile util/Makefile])
148 AC_OUTPUT