--- a/m4/decoders.m4
+++ b/m4/decoders.m4
@@ -534,6 +534,20 @@
     fi
     AM_CONDITIONAL([ENABLE_WAVPACK], [test x"$have_wavpack" = x"yes"])
 
+    dnl libvpx decoder plugin
+    AC_ARG_ENABLE([vpx],
+                  [AS_HELP_STRING([--enable-vpx], [Enable libvpx VP8/VP9 decoder support (default: enabled)])],
+                  [test x"$enableval" != x"no" && enable_vpx="yes"])
+    if test x"$enable_vpx" != x"no"; then
+        PKG_CHECK_MODULES([VPX], [vpx] , [have_vpx=yes], [have_vpx=no])
+        if test x"$enable_vpx" = x"yes" && test x"$have_vpx" != x"yes"; then
+            AC_MSG_ERROR([VP8/VP9 support requested, but libvpx not found])
+        fi
+        AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
+                AC_DEFINE([HAVE_VPX_VP9_DECODER], 1, [Define this if you have VP9 support in libvpx])
+            ], [], [${VPX_LIBS}])
+    fi
+    AM_CONDITIONAL([ENABLE_VPX], [test x"$have_vpx" = x"yes"])
 
     dnl Only enable building dmx image if either gdk_pixbuf or ImageMagick are enabled
     AM_CONDITIONAL([BUILD_DMX_IMAGE], [test x"$have_imagemagick" = x"yes" -o x"$have_gdkpixbuf" = x"yes"])