Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / common / m4 / gst-check.m4
1 dnl pkg-config-based checks for GStreamer modules and dependency modules
2
3 dnl generic:
4 dnl AG_GST_PKG_CHECK_MODULES([PREFIX], [WHICH], [REQUIRED])
5 dnl sets HAVE_[$PREFIX], [$PREFIX]_*
6 dnl AG_GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED])
7 dnl sets HAVE_[$PREFIX], [$PREFIX]_*
8
9 dnl specific:
10 dnl AG_GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED])
11 dnl   also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR
12 dnl AG_GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED])
13 dnl AG_GST_CHECK_GST_GDP([MAJMIN], [MINVER], [REQUIRED])
14 dnl AG_GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED])
15 dnl AG_GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED])
16 dnl AG_GST_CHECK_GST_PLUGINS_BASE([MAJMIN], [MINVER], [REQUIRED])
17 dnl   also sets/ACSUBSTs GSTPB_PLUGINS_DIR
18
19 AC_DEFUN([AG_GST_PKG_CHECK_MODULES],
20 [
21   which="[$2]"
22   dnl not required by default, since we use this mostly for plugin deps
23   required=ifelse([$3], , "no", [$3])
24
25   PKG_CHECK_MODULES([$1], $which,
26     [
27       HAVE_[$1]="yes"
28     ],
29     [
30       HAVE_[$1]="no"
31       if test "x$required" = "xyes"; then
32         AC_MSG_ERROR($[$1]_PKG_ERRORS)
33       else
34         AC_MSG_NOTICE($[$1]_PKG_ERRORS)
35       fi
36     ])
37
38   dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7
39   dnl It gets done automatically in automake >= 1.7, which we now require
40 ]))
41
42 AC_DEFUN([AG_GST_CHECK_MODULES],
43 [
44   module=[$2]
45   minver=[$3]
46   name="[$4]"
47   required=ifelse([$5], , "yes", [$5]) dnl required by default
48
49   PKG_CHECK_MODULES([$1], $module >= $minver,
50     [
51       HAVE_[$1]="yes"
52     ],
53     [
54       HAVE_[$1]="no"
55       AC_MSG_NOTICE($[$1]_PKG_ERRORS)
56       if test "x$required" = "xyes"; then
57         AC_MSG_ERROR([no $module >= $minver ($name) found])
58       else
59         AC_MSG_NOTICE([no $module >= $minver ($name) found])
60       fi
61     ])
62
63   dnl AC_SUBST of CFLAGS and LIBS was not done before automake 1.7
64   dnl It gets done automatically in automake >= 1.7, which we now require
65 ]))
66
67 AC_DEFUN([AG_GST_CHECK_GST],
68 [
69   AG_GST_CHECK_MODULES(GST, gstreamer-[$1], [$2], [GStreamer], [$3])
70   dnl allow setting before calling this macro to override
71   if test -z $GST_TOOLS_DIR; then
72     GST_TOOLS_DIR=`$PKG_CONFIG --variable=toolsdir gstreamer-[$1]`
73     if test -z $GST_TOOLS_DIR; then
74       AC_MSG_ERROR(
75         [no tools dir set in GStreamer pkg-config file, core upgrade needed.])
76     fi
77   fi
78   AC_MSG_NOTICE([using GStreamer tools in $GST_TOOLS_DIR])
79   AC_SUBST(GST_TOOLS_DIR)
80
81   dnl check for where core plug-ins got installed
82   dnl this is used for unit tests
83   dnl allow setting before calling this macro to override
84   if test -z $GST_PLUGINS_DIR; then
85     GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-[$1]`
86     if test -z $GST_PLUGINS_DIR; then
87       AC_MSG_ERROR(
88         [no pluginsdir set in GStreamer pkg-config file, core upgrade needed.])
89     fi
90   fi
91   AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR])
92   AC_SUBST(GST_PLUGINS_DIR)
93 ])
94
95 AC_DEFUN([AG_GST_CHECK_GST_BASE],
96 [
97   AG_GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2],
98     [GStreamer Base Libraries], [$3])
99 ])
100
101 AC_DEFUN([AG_GST_CHECK_GST_GDP],
102 [
103   AG_GST_CHECK_MODULES(GST_GDP, gstreamer-dataprotocol-[$1], [$2],
104     [GStreamer Data Protocol Library], [$3])
105 ])
106
107 AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER],
108 [
109   AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2],
110     [GStreamer Controller Library], [$3])
111 ])
112
113 AC_DEFUN([AG_GST_CHECK_GST_CHECK],
114 [
115   AG_GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2],
116     [GStreamer Check unittest Library], [$3])
117 ])
118
119 dnl ===========================================================================
120 dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
121 dnl
122 dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS.
123 dnl
124 dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR)
125 dnl for use in Makefile.am. This is only really needed/useful in uninstalled
126 dnl setups, since in an installed setup all plugins will be found in
127 dnl GST_PLUGINS_DIR anyway.
128 dnl ===========================================================================
129 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE],
130 [
131   AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2],
132     [GStreamer Base Plugins], [$3])
133
134   if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then
135     dnl check for where base plugins got installed
136     dnl this is used for unit tests
137     dnl allow setting before calling this macro to override
138     if test -z $GSTPB_PLUGINS_DIR; then
139       GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]`
140       if test -z $GSTPB_PLUGINS_DIR; then
141         AC_MSG_ERROR(
142           [no pluginsdir set in GStreamer Base Plugins pkg-config file])
143       fi
144     fi
145     AC_MSG_NOTICE([using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR])
146     GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext"
147     AC_SUBST(GST_PLUGINS_BASE_DIR)
148     AC_SUBST(GSTPB_PLUGINS_DIR)
149   fi
150 ])
151
152 dnl ===========================================================================
153 dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-MAJORMINOR], [MIN-VERSION])
154 dnl
155 dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will
156 dnl only be set in an uninstalled setup, since -good ships no .pc file and in
157 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
158 dnl ===========================================================================
159 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD],
160 [
161   AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2],
162     [GStreamer Good Plugins], [no])
163
164   if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then
165     dnl check for where good plugins got installed
166     dnl this is used for unit tests
167     dnl allow setting before calling this macro to override
168     if test -z $GST_PLUGINS_GOOD_DIR; then
169       GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-[$1]`
170       if test -z $GST_PLUGINS_GOOD_DIR; then
171         AC_MSG_ERROR([no pluginsdir set in GStreamer Good Plugins pkg-config file])
172       fi
173     fi
174     AC_MSG_NOTICE([using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR])
175     GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext"
176     AC_SUBST(GST_PLUGINS_GOOD_DIR)
177   fi
178 ])
179
180 dnl ===========================================================================
181 dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-MAJORMINOR], [MIN-VERSION])
182 dnl
183 dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will
184 dnl only be set in an uninstalled setup, since -bad ships no .pc file and in
185 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
186 dnl ===========================================================================
187 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY],
188 [
189   AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2],
190     [GStreamer Ugly Plugins], [no])
191
192   if test "x$HAVE_GST_PLUGINS_UGLY" = "xyes"; then
193     dnl check for where ugly plugins got installed
194     dnl this is used for unit tests
195     dnl allow setting before calling this macro to override
196     if test -z $GST_PLUGINS_UGLY_DIR; then
197       GST_PLUGINS_UGLY_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ugly-[$1]`
198       if test -z $GST_PLUGINS_UGLY_DIR; then
199         AC_MSG_ERROR([no pluginsdir set in GStreamer Ugly Plugins pkg-config file])
200       fi
201     fi
202     AC_MSG_NOTICE([using GStreamer Ugly Plugins in $GST_PLUGINS_UGLY_DIR])
203     GST_PLUGINS_UGLY_DIR="$GST_PLUGINS_UGLY_DIR/gst:$GST_PLUGINS_UGLY_DIR/sys:$GST_PLUGINS_UGLY_DIR/ext"
204     AC_SUBST(GST_PLUGINS_UGLY_DIR)
205   fi
206 ])
207
208 dnl ===========================================================================
209 dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-MAJORMINOR], [MIN-VERSION])
210 dnl
211 dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will
212 dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in
213 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
214 dnl ===========================================================================
215 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD],
216 [
217   AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2],
218     [GStreamer Bad Plugins], [no])
219
220   if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then
221     dnl check for where bad plugins got installed
222     dnl this is used for unit tests
223     dnl allow setting before calling this macro to override
224     if test -z $GST_PLUGINS_BAD_DIR; then
225       GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-[$1]`
226       if test -z $GST_PLUGINS_BAD_DIR; then
227         AC_MSG_ERROR([no pluginsdir set in GStreamer Bad Plugins pkg-config file])
228       fi
229     fi
230     AC_MSG_NOTICE([using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR])
231     GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext"
232     AC_SUBST(GST_PLUGINS_BAD_DIR)
233   fi
234 ])
235
236 dnl ===========================================================================
237 dnl AG_GST_CHECK_GST_PLUGINS_FFMPEG([GST-MAJORMINOR], [MIN-VERSION])
238 dnl
239 dnl Will set GST_PLUGINS_FFMPEG_DIR for use in Makefile.am. Note that this will
240 dnl only be set in an uninstalled setup, since -ffmpeg ships no .pc file and in
241 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
242 dnl ===========================================================================
243 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_FFMPEG],
244 [
245   AG_GST_CHECK_MODULES(GST_PLUGINS_FFMPEG, gstreamer-plugins-ffmpeg-[$1], [$2],
246     [GStreamer FFmpeg Plugins], [no])
247
248   if test "x$HAVE_GST_PLUGINS_FFMPEG" = "xyes"; then
249     dnl check for where ffmpeg plugins got installed
250     dnl this is used for unit tests
251     dnl allow setting before calling this macro to override
252     if test -z $GST_PLUGINS_FFMPEG_DIR; then
253       GST_PLUGINS_FFMPEG_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ffmpeg-[$1]`
254       if test -z $GST_PLUGINS_FFMPEG_DIR; then
255         AC_MSG_ERROR([no pluginsdir set in GStreamer FFmpeg Plugins pkg-config file])
256       fi
257     fi
258     GST_PLUGINS_FFMPEG_DIR="$GST_PLUGINS_FFMPEG_DIR/ext/ffmpeg"
259     AC_MSG_NOTICE([using GStreamer FFmpeg Plugins in $GST_PLUGINS_FFMPEG_DIR])
260     AC_SUBST(GST_PLUGINS_FFMPEG_DIR)
261   fi
262 ])