use standard BUILD_SHARED_LIB option. Install dll to <prefix>/bin (mingw)