diff --git a/configure.ac b/configure.ac
index 03a367b..a3f22ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -527,6 +527,48 @@ int main ()
   AC_SUBST(HAVE_DIRECTDRAW)
 ])
 
+dnl DirectShow
+translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSHOW, true)
+AG_GST_CHECK_FEATURE(DIRECTSHOW, [DirectShow plug-in], winks, [
+  HAVE_DIRECTSHOW="no"
+  save_CFLAGS="$CFLAGS"
+  save_LDFLAGS="$LDFLAGS"
+  save_LIBS="$LIBS"
+  CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
+  LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
+  LIBS="$LIBS -lole32 -luuid -lstrmiids"
+  AC_MSG_CHECKING(for DirectShow LDFLAGS)
+  AC_LINK_IFELSE([
+#include <windows.h>
+#include <strmif.h>
+#include <uuids.h>
+
+int main () {
+  IGraphBuilder *pGraph = NULL;
+  HRESULT hr = CoInitialize(NULL);
+  hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, 
+                        &IID_IGraphBuilder, (void **)&pGraph);
+
+  return 0;
+}
+],
+    [HAVE_DIRECTSHOW="yes"],
+    [HAVE_DIRECTSHOW="no"])
+  AC_MSG_RESULT($HAVE_DIRECTSHOW)
+  CFLAGS=$save_CFLAGS
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
+
+  if test "x$HAVE_DIRECTSHOW" = "xyes";  then
+    dnl this is much more than we want
+    DIRECTSHOW_LIBS="-ldxguid -lole32 -luuid -lstrmiids -lksuser -lsetupapi"
+    AC_SUBST(DIRECTX_CFLAGS)
+    AC_SUBST(DIRECTX_LDFLAGS)
+    AC_SUBST(DIRECTSHOW_LIBS)
+  fi
+  AC_SUBST(HAVE_DIRECTSHOW)
+])
+
 dnl *** AppleMedia (OS X and iOS) ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
 HAVE_APPLE_MEDIA="no"
diff --git a/sys/Makefile.am b/sys/Makefile.am
index 5df060c..793e4fa 100644
--- a/sys/Makefile.am
+++ b/sys/Makefile.am
@@ -40,6 +40,12 @@ else
 DIRECTDRAW_DIR=
 endif
 
+if USE_DIRECTSHOW
+DIRECTSHOW_DIR=winks
+else
+DIRECTSHOW_DIR=
+endif
+
 if USE_DIRECTSOUND
 DIRECTSOUND_DIR=directsound
 else
@@ -113,7 +119,7 @@ else
 AVC_DIR=
 endif
 
-SUBDIRS = $(ACM_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(SHM_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR)
+SUBDIRS = $(ACM_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTDRAW_DIR) $(DIRECTSHOW_DIR) $(DIRECTSOUND_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(SHM_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR)
 
 DIST_SUBDIRS = acmenc acmmp3dec applemedia avc d3dvideosink decklink directdraw directsound dvb linsys fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
 		osxvideo qtwrapper shm vcd vdpau wasapi wininet winks winscreencap
diff --git a/sys/winks/Makefile.am b/sys/winks/Makefile.am
index a89eef3..13dbe81 100644
--- a/sys/winks/Makefile.am
+++ b/sys/winks/Makefile.am
@@ -1,9 +1,17 @@
-# This plugin isn't buildable with autotools at this point in time, so just
-# ensure everything's listed in EXTRA_DIST
+plugin_LTLIBRARIES = libgstwinks.la
 
-EXTRA_DIST = \
-	gstksclock.c gstksclock.h \
-	gstksvideodevice.c gstksvideodevice.h \
-	gstksvideosrc.c gstksvideosrc.h \
+libgstwinks_la_SOURCES = gstksclock.c \
+	gstksvideodevice.c \
+	gstksvideosrc.c \
 	kshelpers.c kshelpers.h \
-	ksvideohelpers.c ksvideohelpers.h
+	ksvideohelpers.c 
+libgstwinks_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
+	$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
+libgstwinks_la_LIBADD = $(DIRECTSHOW_LIBS) \
+	$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
+	-lgstinterfaces-$(GST_MAJORMINOR)
+libgstwinks_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS)
+libgstwinks_la_LIBTOOLFLAGS = --tag=disable-static
+
+noinst_HEADERS= gstksclock.h
+
