--- a/qtimageformats/src/imageformats/configure.json
+++ b/qtimageformats/src/imageformats/configure.json
@@ -84,8 +84,9 @@
                 ]
             },
             "sources": [
-                { "type": "pkgConfig", "args": "libtiff-4" },
-                { "libs": "-ltiff" }
+                { "type": "pkgConfig", "args": "libtiff-4", "condition": "features.shared" },
+                { "type": "pkgConfig", "args": "--static --libs libtiff-4", "condition": "!features.shared" },
+                { "libs": "-ltiff", "condition": "features.shared" }
             ]
         },
         "webp": {
@@ -115,8 +116,9 @@
                 ]
             },
             "sources": [
-                { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux" },
-                { "libs": "-lwebp -lwebpdemux -lwebpmux" }
+                { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux", "condition": "features.shared" },
+                { "libs": "-lwebp -lwebpdemux -lwebpmux", "condition": "features.shared" },
+                { "libs": "-lwebpdemux -lwebpmux -lwebp -lsharpyuv", "condition": "!features.shared" }
             ]
         }
     },
