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