1 dnl pkg-config-based checks for GStreamer modules and dependency modules
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]_*
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
19 AC_DEFUN([AG_GST_PKG_CHECK_MODULES],
22 dnl not required by default, since we use this mostly for plugin deps
23 required=ifelse([$3], , "no", [$3])
25 PKG_CHECK_MODULES([$1], $which,
31 if test "x$required" = "xyes"; then
32 AC_MSG_ERROR($[$1]_PKG_ERRORS)
34 AC_MSG_NOTICE($[$1]_PKG_ERRORS)
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
42 AC_DEFUN([AG_GST_CHECK_MODULES],
47 required=ifelse([$5], , "yes", [$5]) dnl required by default
49 PKG_CHECK_MODULES([$1], $module >= $minver,
55 AC_MSG_NOTICE($[$1]_PKG_ERRORS)
56 if test "x$required" = "xyes"; then
57 AC_MSG_ERROR([no $module >= $minver ($name) found])
59 AC_MSG_NOTICE([no $module >= $minver ($name) found])
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
67 AC_DEFUN([AG_GST_CHECK_GST],
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
75 [no tools dir set in GStreamer pkg-config file, core upgrade needed.])
78 AC_MSG_NOTICE([using GStreamer tools in $GST_TOOLS_DIR])
79 AC_SUBST(GST_TOOLS_DIR)
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
88 [no pluginsdir set in GStreamer pkg-config file, core upgrade needed.])
91 AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR])
92 AC_SUBST(GST_PLUGINS_DIR)
95 AC_DEFUN([AG_GST_CHECK_GST_BASE],
97 AG_GST_CHECK_MODULES(GST_BASE, gstreamer-base-[$1], [$2],
98 [GStreamer Base Libraries], [$3])
101 AC_DEFUN([AG_GST_CHECK_GST_GDP],
103 AG_GST_CHECK_MODULES(GST_GDP, gstreamer-dataprotocol-[$1], [$2],
104 [GStreamer Data Protocol Library], [$3])
107 AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER],
109 AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2],
110 [GStreamer Controller Library], [$3])
113 AC_DEFUN([AG_GST_CHECK_GST_CHECK],
115 AG_GST_CHECK_MODULES(GST_CHECK, gstreamer-check-[$1], [$2],
116 [GStreamer Check unittest Library], [$3])
119 dnl ===========================================================================
120 dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
122 dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS.
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],
131 AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2],
132 [GStreamer Base Plugins], [$3])
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
142 [no pluginsdir set in GStreamer Base Plugins pkg-config file])
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)
152 dnl ===========================================================================
153 dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
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],
161 AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2],
162 [GStreamer Good Plugins], [$3])
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])
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)
180 dnl ===========================================================================
181 dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
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],
189 AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2],
190 [GStreamer Ugly Plugins], [$3])
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])
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)
208 dnl ===========================================================================
209 dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
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],
217 AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2],
218 [GStreamer Bad Plugins], [$3])
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])
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)
236 dnl ===========================================================================
237 dnl AG_GST_CHECK_GST_PLUGINS_FFMPEG([GST-MAJORMINOR], [MIN-VERSION], [REQUIRED])
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],
245 AG_GST_CHECK_MODULES(GST_PLUGINS_FFMPEG, gstreamer-plugins-ffmpeg-[$1], [$2],
246 [GStreamer FFmpeg Plugins], [$3])
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])
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)