--- ppl-0.10.2 old/configure.ac	2009-11-30 12:29:04 +0100
+++ ppl-0.10.2/configure.ac	2009-11-30 12:37:36 +0100
@@ -1372,6 +1372,28 @@
 AM_CONDITIONAL(THOROUGH_MAKE_CHECK, test x"$enableval" = xthorough)
 
 # Libtool.
+AC_LIBTOOL_WIN32_DLL
+
+case $host in
+  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+    # By default, build only static.
+    if test -z "$enable_shared"; then
+      enable_shared=no
+    fi
+    # Don't allow both static and DLL.
+    if test "$enable_shared" != no && test "$enable_static" != no; then
+      AC_MSG_ERROR([cannot build both static and DLL, since ppl.h is different for each.
+Use "--disable-static --enable-shared" to build just a DLL.])
+    fi
+
+    # "-no-undefined" is required when building a DLL, see documentation on
+    # AC_LIBTOOL_WIN32_DLL.
+    if test "$enable_shared" = yes; then
+      LDFLAGS="$LDFLAGS -no-undefined"
+    fi
+    ;;
+esac
+
 LT_INIT([dlopen])
 AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes)
 AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes)
