Add support for auto focus range.
[adaptation/intel_mfld/gst-plugins-atomisp.git] / configure.ac
1 AC_INIT
2
3 dnl versions of gstreamer and plugins-base
4 GST_MAJORMINOR=0.10
5 GST_REQUIRED=0.10.0
6 GSTPB_REQUIRED=0.10.0
7 LIBMFLD_REQUIRED=0.10.0
8
9 dnl fill in your package name and version here
10 dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
11 dnl and 2... for a prerelease
12
13 dnl when going to/from release please set the nano correctly !
14 dnl releases only do Wall, cvs and prerelease does Werror too
15 AS_VERSION(gst-plugins-camera, GST_PLUGIN_VERSION, 0, 10, 0, 0,
16     GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes")
17
18 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
19 AM_MAINTAINER_MODE
20
21 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
22 AM_SILENT_RULES
23
24 dnl make aclocal work in maintainer mode
25 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
26 AC_CONFIG_MACRO_DIR(m4)
27
28 AM_CONFIG_HEADER(config.h)
29
30 dnl check for tools
31 AC_PROG_CC
32 AC_PROG_LIBTOOL
33
34 # check for gtk-doc
35 # GTK_DOC_CHECK(1.6)
36
37 dnl decide on error flags
38 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
39                                                                                 
40 if test "x$GST_WALL" = "xyes"; then
41    GST_ERROR="$GST_ERROR -Wall"
42                                                                                 
43    if test "x$GST_PLUGIN_CVS" = "xyes"; then
44      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
45    fi
46 fi
47
48 dnl Check for pkgconfig first
49 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
50
51 dnl Give error and exit if we don't have pkgconfig
52 if test "x$HAVE_PKGCONFIG" = "xno"; then
53   AC_MSG_ERROR(you need to have pkgconfig installed !)
54 fi
55
56 dnl Now we're ready to ask for gstreamer libs and cflags
57 dnl And we can also ask for the right version of gstreamer
58
59
60 PKG_CHECK_MODULES(GST, \
61   gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
62   HAVE_GST=yes,HAVE_GST=no)
63
64 dnl Give error and exit if we don't have gstreamer
65 if test "x$HAVE_GST" = "xno"; then
66   AC_MSG_ERROR(you need gstreamer development packages installed !)
67 fi
68
69 dnl append GST_ERROR cflags to GST_CFLAGS
70 GST_CFLAGS="$GST_CFLAGS $GST_ERROR"
71
72 dnl make GST_CFLAGS and GST_LIBS available
73 AC_SUBST(GST_CFLAGS)
74 AC_SUBST(GST_LIBS)
75
76 dnl make GST_MAJORMINOR available in Makefile.am
77 AC_SUBST(GST_MAJORMINOR)
78
79 AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [compile with DEBUG]),,enable_debug=no)
80
81 DEBUG_FLAGS=
82 dnl Check for debug build
83 if test "x$enable_debug" = "xyes"; then
84   DEBUG_FLAGS="-DDEBUG"
85 fi
86
87 dnl If we need them, we can also use the base class libraries
88 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED,
89                   HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
90
91 dnl Give a warning if we don't have gstreamer libs
92 dnl you can turn this into an error if you need them
93 if test "x$HAVE_GST_BASE" = "xno"; then
94   AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR))
95 fi
96
97 dnl make _CFLAGS and _LIBS available
98 AC_SUBST(GST_BASE_CFLAGS)
99 AC_SUBST(GST_BASE_LIBS)
100
101 dnl If we need them, we can also use the base class libraries
102 PKG_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-$GST_MAJORMINOR >= $GST_REQUIRED,
103                   HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
104
105 dnl Give a warning if we don't have gstreamer libs
106 dnl you can turn this into an error if you need them
107 if test "x$HAVE_GST_BASE" = "xno"; then
108   AC_MSG_NOTICE(no GStreamer controllerlibraries found (gstreamer-controller-$GST_MAJORMINOR))
109 fi
110
111 dnl make _CFLAGS and _LIBS available
112 AC_SUBST(GST_CONTROLLER_CFLAGS)
113 AC_SUBST(GST_CONTROLLER_LIBS)
114
115 dnl Check gst-plugins-bad
116 PKG_CHECK_MODULES(GST_BAD, gstreamer-plugins-bad-$GST_MAJORMINOR,
117                   HAVE_GST_BAD=yes, HAVE_GST_BAD=no)
118
119 if test "x$HAVE_GST_BAD" = "xno"; then
120   AC_MSG_NOTICE(no gstreamer-plugins-bad libraries found (gstreamer-plugins-bad-$GST_MAJORMINOR))
121 fi
122
123 dnl make _CFLAGS and _LIBS available
124 AC_SUBST(GST_BAD_CFLAGS)
125 AC_SUBST(GST_BAD_LIBS)
126
127 dnl set the plugindir where plugins should be installed
128 if test "x${prefix}" = "x$HOME"; then
129   plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins"
130 else
131   plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
132 fi
133 AC_SUBST(plugindir)
134
135 dnl set proper LDFLAGS for plugins
136 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
137 AC_SUBST(GST_PLUGIN_LDFLAGS)
138
139 dnl LDFLAGS really should only contain flags, not libs - they get added before
140 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
141 GST_ALL_LDFLAGS="-no-undefined"
142 AC_SUBST(GST_ALL_LDFLAGS)
143
144 dnl GST_LIB_LDFLAGS
145 dnl linker flags shared by all libraries
146 dnl LDFLAGS modifier defining exported symbols from built libraries
147 dnl (export _gst_foo but not __gst_foo)
148 GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*"
149 AC_SUBST(GST_LIB_LDFLAGS)
150
151 dnl check gst check support
152 HAVE_GST_CHECK=no
153 PKG_CHECK_MODULES(GST_CHECK, gstreamer-check-$GST_MAJORMINOR, HAVE_GST_CHECK=yes, HAVE_GST_CHECK=no)
154 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
155 AC_SUBST(GST_CHECK_CFLAGS)
156 AC_SUBST(GST_CHECK_LIBS)
157
158 dnl check gst check 3a support
159 dnl LIBMFLDADVCI_CFLAGS
160 dnl LIBMFLDADVCI_LIBS
161 HAVE_LIBMFLDADVCI=yes
162 PKG_CHECK_MODULES(LIBMFLDADVCI, libmfldadvci >= $LIBMFLD_REQUIRED, HAVE_LIBMFLDADVCI=yes, HAVE_LIBMFLDADVCI=no)
163 AM_CONDITIONAL(HAVE_LIBMFLDADVCI, test ! "x$LIBMFLDADVCI" = "xyes")
164 if test "x$HAVE_LIBMFLDADVCI" = "xyes"; then
165 LIBMFLDADVCI_CFLAGS=""
166 LIBMFLDADVCI_LIBS=""
167 AC_SUBST(LIBMFLDADVCI_CFLAGS)
168 AC_SUBST(LIBMFLDADVCI_LIBS)
169 fi
170 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
171 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
172
173 GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-$GST_MAJORMINOR`
174 AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR])
175 AC_SUBST(GST_PLUGINS_DIR)
176
177 GENERAL_CFLAGS="-D___LINUX___ -D___GNUC___ -DOSAL_ROVER $DEBUG_FLAGS"
178 AC_SUBST(GENERAL_CFLAGS)
179
180 AC_OUTPUT(Makefile \
181   m4/Makefile \
182   gst-libs/Makefile \
183     gst-libs/atomisphal/Makefile \
184     gst-libs/gst/Makefile \
185       gst-libs/gst/camera/Makefile \
186   gst/Makefile \
187     gst/mfldv4l2cam/Makefile \
188   docs/Makefile \
189     docs/reference/Makefile \
190       docs/reference/gst-mfld-videosrc/Makefile
191   pkgconfig/Makefile
192   pkgconfig/gstreamer-atomisphal.pc
193   pkgconfig/gstreamer-mfld-videosrc.pc)