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_CONTROLLER([MAJMIN], [MINVER], [REQUIRED])
14 dnl AG_GST_CHECK_GST_NET([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_CONTROLLER],
103 AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2],
104 [GStreamer Controller Library], [$3])
107 AC_DEFUN([AG_GST_CHECK_GST_NET],
109 AG_GST_CHECK_MODULES(GST_NET, gstreamer-net-[$1], [$2],
110 [GStreamer Network 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_UNINSTALLED_SETUP([ACTION-IF-UNINSTALLED], [ACTION-IF-NOT])
122 dnl ACTION-IF-UNINSTALLED (optional) extra actions to perform if the setup
123 dnl is an uninstalled setup
124 dnl ACTION-IF-NOT (optional) extra actions to perform if the setup
125 dnl is not an uninstalled setup
126 dnl ===========================================================================
127 AC_DEFUN([AG_GST_CHECK_UNINSTALLED_SETUP],
129 AC_MSG_CHECKING([whether this is an uninstalled GStreamer setup])
130 AC_CACHE_VAL(gst_cv_is_uninstalled_setup,[
131 gst_cv_is_uninstalled_setup=no
132 if (set -u; : $GST_PLUGIN_SYSTEM_PATH) 2>/dev/null ; then
133 if test -z "$GST_PLUGIN_SYSTEM_PATH" \
134 -a -n "$GST_PLUGIN_SCANNER" \
135 -a -n "$GST_PLUGIN_PATH" \
136 -a -n "$GST_REGISTRY" \
137 -a -n "$DYLD_LIBRARY_PATH" \
138 -a -n "$LD_LIBRARY_PATH"; then
139 gst_cv_is_uninstalled_setup=yes;
143 AC_MSG_RESULT($gst_cv_is_uninstalled_setup)
144 if test "x$gst_cv_is_uninstalled_setup" = "xyes"; then
145 ifelse([$1], , :, [$1])
147 ifelse([$2], , :, [$2])
151 dnl ===========================================================================
152 dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-API_VERSION], [MIN-VERSION], [REQUIRED])
154 dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS.
156 dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR)
157 dnl for use in Makefile.am. This is only really needed/useful in uninstalled
158 dnl setups, since in an installed setup all plugins will be found in
159 dnl GST_PLUGINS_DIR anyway.
160 dnl ===========================================================================
161 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE],
163 AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2],
164 [GStreamer Base Plugins], [$3])
166 if test "x$HAVE_GST_PLUGINS_BASE" = "xyes"; then
167 dnl check for where base plugins got installed
168 dnl this is used for unit tests
169 dnl allow setting before calling this macro to override
170 if test -z $GSTPB_PLUGINS_DIR; then
171 GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]`
172 if test -z $GSTPB_PLUGINS_DIR; then
174 [no pluginsdir set in GStreamer Base Plugins pkg-config file])
177 AC_MSG_NOTICE([using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR])
178 GST_PLUGINS_BASE_DIR="$GSTPB_PLUGINS_DIR/gst:$GSTPB_PLUGINS_DIR/sys:$GSTPB_PLUGINS_DIR/ext"
179 AC_SUBST(GST_PLUGINS_BASE_DIR)
180 AC_SUBST(GSTPB_PLUGINS_DIR)
184 dnl ===========================================================================
185 dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-API_VERSION], [MIN-VERSION])
187 dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will
188 dnl only be set in an uninstalled setup, since -good ships no .pc file and in
189 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
190 dnl ===========================================================================
191 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD],
193 AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2],
194 [GStreamer Good Plugins], [no])
196 if test "x$HAVE_GST_PLUGINS_GOOD" = "xyes"; then
197 dnl check for where good plugins got installed
198 dnl this is used for unit tests
199 dnl allow setting before calling this macro to override
200 if test -z $GST_PLUGINS_GOOD_DIR; then
201 GST_PLUGINS_GOOD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-good-[$1]`
202 if test -z $GST_PLUGINS_GOOD_DIR; then
203 AC_MSG_ERROR([no pluginsdir set in GStreamer Good Plugins pkg-config file])
206 AC_MSG_NOTICE([using GStreamer Good Plugins in $GST_PLUGINS_GOOD_DIR])
207 GST_PLUGINS_GOOD_DIR="$GST_PLUGINS_GOOD_DIR/gst:$GST_PLUGINS_GOOD_DIR/sys:$GST_PLUGINS_GOOD_DIR/ext"
208 AC_SUBST(GST_PLUGINS_GOOD_DIR)
212 dnl ===========================================================================
213 dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-API_VERSION], [MIN-VERSION])
215 dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will
216 dnl only be set in an uninstalled setup, since -bad ships no .pc file and in
217 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
218 dnl ===========================================================================
219 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY],
221 AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2],
222 [GStreamer Ugly Plugins], [no])
224 if test "x$HAVE_GST_PLUGINS_UGLY" = "xyes"; then
225 dnl check for where ugly plugins got installed
226 dnl this is used for unit tests
227 dnl allow setting before calling this macro to override
228 if test -z $GST_PLUGINS_UGLY_DIR; then
229 GST_PLUGINS_UGLY_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-ugly-[$1]`
230 if test -z $GST_PLUGINS_UGLY_DIR; then
231 AC_MSG_ERROR([no pluginsdir set in GStreamer Ugly Plugins pkg-config file])
234 AC_MSG_NOTICE([using GStreamer Ugly Plugins in $GST_PLUGINS_UGLY_DIR])
235 GST_PLUGINS_UGLY_DIR="$GST_PLUGINS_UGLY_DIR/gst:$GST_PLUGINS_UGLY_DIR/sys:$GST_PLUGINS_UGLY_DIR/ext"
236 AC_SUBST(GST_PLUGINS_UGLY_DIR)
240 dnl ===========================================================================
241 dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-API_VERSION], [MIN-VERSION])
243 dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will
244 dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in
245 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
246 dnl ===========================================================================
247 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD],
249 AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2],
250 [GStreamer Bad Plugins], [no])
252 if test "x$HAVE_GST_PLUGINS_BAD" = "xyes"; then
253 dnl check for where bad plugins got installed
254 dnl this is used for unit tests
255 dnl allow setting before calling this macro to override
256 if test -z $GST_PLUGINS_BAD_DIR; then
257 GST_PLUGINS_BAD_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-bad-[$1]`
258 if test -z $GST_PLUGINS_BAD_DIR; then
259 AC_MSG_ERROR([no pluginsdir set in GStreamer Bad Plugins pkg-config file])
262 AC_MSG_NOTICE([using GStreamer Bad Plugins in $GST_PLUGINS_BAD_DIR])
263 GST_PLUGINS_BAD_DIR="$GST_PLUGINS_BAD_DIR/gst:$GST_PLUGINS_BAD_DIR/sys:$GST_PLUGINS_BAD_DIR/ext"
264 AC_SUBST(GST_PLUGINS_BAD_DIR)
268 dnl ===========================================================================
269 dnl AG_GST_CHECK_GST_PLUGINS_LIBAV([GST-API_VERSION], [MIN-VERSION])
271 dnl Will set GST_PLUGINS_LIBAV_DIR for use in Makefile.am. Note that this will
272 dnl only be set in an uninstalled setup, since -libav ships no .pc file and in
273 dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway.
274 dnl ===========================================================================
275 AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_LIBAV],
277 AG_GST_CHECK_MODULES(GST_PLUGINS_LIBAV, gstreamer-plugins-libav-[$1], [$2],
278 [GStreamer Libav Plugins], [no])
280 if test "x$HAVE_GST_PLUGINS_LIBAV" = "xyes"; then
281 dnl check for where libav plugins got installed
282 dnl this is used for unit tests
283 dnl allow setting before calling this macro to override
284 if test -z $GST_PLUGINS_LIBAV_DIR; then
285 GST_PLUGINS_LIBAV_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-libav-[$1]`
286 if test -z $GST_PLUGINS_LIBAV_DIR; then
287 AC_MSG_ERROR([no pluginsdir set in GStreamer Libav Plugins pkg-config file])
290 GST_PLUGINS_LIBAV_DIR="$GST_PLUGINS_LIBAV_DIR/ext/libav"
291 AC_MSG_NOTICE([using GStreamer Libav Plugins in $GST_PLUGINS_LIBAV_DIR])
292 AC_SUBST(GST_PLUGINS_LIBAV_DIR)