diff --git a/configure b/configure
index 26227ff2370c8f93bcafe0e582112d5260cff697..c9bbdc858e27f59b89a5c0eb0c5ca7bd359b1b2b 100755
--- a/configure
+++ b/configure
@@ -1181,7 +1181,7 @@ EOF
     SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
     SLIB_INSTALL_EXTRA_CMD="-install -m 644 \$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib) \"\$(shlibdir)/\$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib)\""
     SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc"
-    add_extralibs -lws2_32
+    enabled network && add_extralibs -lws2_32
     ;;
   cygwin*)
     targetos=cygwin