1dnl pkg-config-based checks for GStreamer modules and dependency modules 2 3dnl generic: 4dnl AG_GST_PKG_CHECK_MODULES([PREFIX], [WHICH], [REQUIRED]) 5dnl sets HAVE_[$PREFIX], [$PREFIX]_* 6dnl AG_GST_CHECK_MODULES([PREFIX], [MODULE], [MINVER], [NAME], [REQUIRED]) 7dnl sets HAVE_[$PREFIX], [$PREFIX]_* 8 9dnl specific: 10dnl AG_GST_CHECK_GST([MAJMIN], [MINVER], [REQUIRED]) 11dnl also sets/ACSUBSTs GST_TOOLS_DIR and GST_PLUGINS_DIR 12dnl AG_GST_CHECK_GST_BASE([MAJMIN], [MINVER], [REQUIRED]) 13dnl AG_GST_CHECK_GST_CONTROLLER([MAJMIN], [MINVER], [REQUIRED]) 14dnl AG_GST_CHECK_GST_NET([MAJMIN], [MINVER], [REQUIRED]) 15dnl AG_GST_CHECK_GST_CHECK([MAJMIN], [MINVER], [REQUIRED]) 16dnl AG_GST_CHECK_GST_PLUGINS_BASE([MAJMIN], [MINVER], [REQUIRED]) 17dnl also sets/ACSUBSTs GSTPB_PLUGINS_DIR 18 19AC_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 42AC_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 67AC_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 95AC_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 101AC_DEFUN([AG_GST_CHECK_GST_CONTROLLER], 102[ 103 AG_GST_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-[$1], [$2], 104 [GStreamer Controller Library], [$3]) 105]) 106 107AC_DEFUN([AG_GST_CHECK_GST_NET], 108[ 109 AG_GST_CHECK_MODULES(GST_NET, gstreamer-net-[$1], [$2], 110 [GStreamer Network Library], [$3]) 111]) 112 113AC_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 119dnl =========================================================================== 120dnl AG_GST_CHECK_UNINSTALLED_SETUP([ACTION-IF-UNINSTALLED], [ACTION-IF-NOT]) 121dnl 122dnl ACTION-IF-UNINSTALLED (optional) extra actions to perform if the setup 123dnl is an uninstalled setup 124dnl ACTION-IF-NOT (optional) extra actions to perform if the setup 125dnl is not an uninstalled setup 126dnl =========================================================================== 127AC_DEFUN([AG_GST_CHECK_UNINSTALLED_SETUP], 128[ 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; 140 fi 141 fi 142 ]) 143 AC_MSG_RESULT($gst_cv_is_uninstalled_setup) 144 if test "x$gst_cv_is_uninstalled_setup" = "xyes"; then 145 ifelse([$1], , :, [$1]) 146 else 147 ifelse([$2], , :, [$2]) 148 fi 149]) 150 151dnl =========================================================================== 152dnl AG_GST_CHECK_GST_PLUGINS_BASE([GST-API_VERSION], [MIN-VERSION], [REQUIRED]) 153dnl 154dnl Sets GST_PLUGINS_BASE_CFLAGS and GST_PLUGINS_BASE_LIBS. 155dnl 156dnl Also sets GSTPB_PLUGINS_DIR (and for consistency also GST_PLUGINS_BASE_DIR) 157dnl for use in Makefile.am. This is only really needed/useful in uninstalled 158dnl setups, since in an installed setup all plugins will be found in 159dnl GST_PLUGINS_DIR anyway. 160dnl =========================================================================== 161AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BASE], 162[ 163 AG_GST_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-[$1], [$2], 164 [GStreamer Base Plugins], [$3]) 165 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 173 AC_MSG_ERROR( 174 [no pluginsdir set in GStreamer Base Plugins pkg-config file]) 175 fi 176 fi 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) 181 fi 182]) 183 184dnl =========================================================================== 185dnl AG_GST_CHECK_GST_PLUGINS_GOOD([GST-API_VERSION], [MIN-VERSION]) 186dnl 187dnl Will set GST_PLUGINS_GOOD_DIR for use in Makefile.am. Note that this will 188dnl only be set in an uninstalled setup, since -good ships no .pc file and in 189dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. 190dnl =========================================================================== 191AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_GOOD], 192[ 193 AG_GST_CHECK_MODULES(GST_PLUGINS_GOOD, gstreamer-plugins-good-[$1], [$2], 194 [GStreamer Good Plugins], [no]) 195 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]) 204 fi 205 fi 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) 209 fi 210]) 211 212dnl =========================================================================== 213dnl AG_GST_CHECK_GST_PLUGINS_UGLY([GST-API_VERSION], [MIN-VERSION]) 214dnl 215dnl Will set GST_PLUGINS_UGLY_DIR for use in Makefile.am. Note that this will 216dnl only be set in an uninstalled setup, since -bad ships no .pc file and in 217dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. 218dnl =========================================================================== 219AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_UGLY], 220[ 221 AG_GST_CHECK_MODULES(GST_PLUGINS_UGLY, gstreamer-plugins-ugly-[$1], [$2], 222 [GStreamer Ugly Plugins], [no]) 223 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]) 232 fi 233 fi 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) 237 fi 238]) 239 240dnl =========================================================================== 241dnl AG_GST_CHECK_GST_PLUGINS_BAD([GST-API_VERSION], [MIN-VERSION]) 242dnl 243dnl Will set GST_PLUGINS_BAD_DIR for use in Makefile.am. Note that this will 244dnl only be set in an uninstalled setup, since -ugly ships no .pc file and in 245dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. 246dnl =========================================================================== 247AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_BAD], 248[ 249 AG_GST_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-[$1], [$2], 250 [GStreamer Bad Plugins], [no]) 251 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]) 260 fi 261 fi 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) 265 fi 266]) 267 268dnl =========================================================================== 269dnl AG_GST_CHECK_GST_PLUGINS_LIBAV([GST-API_VERSION], [MIN-VERSION]) 270dnl 271dnl Will set GST_PLUGINS_LIBAV_DIR for use in Makefile.am. Note that this will 272dnl only be set in an uninstalled setup, since -libav ships no .pc file and in 273dnl an installed setup all plugins will be found in GST_PLUGINS_DIR anyway. 274dnl =========================================================================== 275AC_DEFUN([AG_GST_CHECK_GST_PLUGINS_LIBAV], 276[ 277 AG_GST_CHECK_MODULES(GST_PLUGINS_LIBAV, gstreamer-plugins-libav-[$1], [$2], 278 [GStreamer Libav Plugins], [no]) 279 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]) 288 fi 289 fi 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) 293 fi 294]) 295