+dnl
+dnl Abort configure script if not found and not explicitly disabled
+dnl
+m4_if([$8],[disable-explicitly],[
+if test "x${[try_][$1]}" != "xno" && test "x${[have_][$1]}" = "xno"; then
+ AC_MSG_ERROR([
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
+[$1][_LIBS]=${[$1][_LIBS]}
+[$1][_CFLAGS]=${[$1][_CFLAGS]}
+
+* Fatal: ${PACKAGE_NAME} by default requires $2 to build.
+* You must explicitly disable $2 to build ${PACKAGE_TARNAME} without it.
+*
+* Possible solutions:
+* - call configure with --with-$2=no or --without-$2
+* - set PKG_CONFIG_PATH to adequate value
+* - call configure with [$1][_LIBS]=.. and [$1][_CFLAGS]=..
+* - call configure with one of the --with-$2 parameters
+]m4_ifval([$9],[dnl
+* - get $2 and install it
+],[dnl
+* - get $2 and install it:
+ $9]))
+fi
+])dnl