--- a/source/runConfigureICU	2012-11-06 21:17:29.461105000 +0200
+++ b/source/runConfigureICU	2013-09-17 20:58:50.165039000 +0300
@@ -26,6 +26,7 @@
 Options: -h, --help         Print this message and exit
          --enable-debug     Enable support for debugging
          --disable-release  Disable presetting optimization flags
+		 --static-runtime   Use a statically linked C/C++ runtime (Cygwin/MSVC only)
 
 If you want to add custom CFLAGS or CXXFLAGS or similar, provide them _before_
 the runConfigureICU command:
@@ -68,6 +69,7 @@
 platform=
 debug=0
 release=1
+static_runtime=0
 
 while test $# -ne 0
 do
@@ -83,6 +85,9 @@
         release=0
         OPTS="$OPTS --disable-release"
         ;;
+	--static-runtime)
+        static_runtime=1
+        ;;
     *)
         platform="$1"
         shift
@@ -255,14 +260,20 @@
         RELEASE_CXXFLAGS='-O3'
         ;;
     Cygwin/MSVC)
+		if [ "${static_runtime}" = "0" ]; then
+			RUNTIME_LINKER_FLAG='/MD'
+		else
+			RUNTIME_LINKER_FLAG='/MT'
+		fi
+		
         THE_OS="Windows with Cygwin"
         THE_COMP="Microsoft Visual C++"
         CC=cl; export CC
         CXX=cl; export CXX
-        RELEASE_CFLAGS='/Gy /MD'
-        RELEASE_CXXFLAGS='/Gy /MD'
-        DEBUG_CFLAGS='/Zi /MDd'
-        DEBUG_CXXFLAGS='/Zi /MDd'
+        RELEASE_CFLAGS='/Gy '${RUNTIME_LINKER_FLAG}
+        RELEASE_CXXFLAGS='/Gy '${RUNTIME_LINKER_FLAG}
+        DEBUG_CFLAGS='/Zi '${RUNTIME_LINKER_FLAG}d
+        DEBUG_CXXFLAGS='/Zi '${RUNTIME_LINKER_FLAG}d
         DEBUG_LDFLAGS='/DEBUG'
         ;;
     Cygwin/MSVC2005)
@@ -363,7 +374,7 @@
     fi
     if test "$RELEASE_CFLAGS" != ""
     then
-        CFLAGS="$CFLAGS $RELEASE_CFLAGS"
+        CFLAGS="$RELEASE_CFLAGS $CFLAGS"
     fi
     if test "$RELEASE_CXXFLAGS" = ""
     then
@@ -375,11 +386,11 @@
     fi
     if test "$RELEASE_CXXFLAGS" != ""
     then
-        CXXFLAGS="$CXXFLAGS $RELEASE_CXXFLAGS"
+        CXXFLAGS="$RELEASE_CXXFLAGS $CXXFLAGS"
     fi
     if test "$RELEASE_LDFLAGS" != ""
     then
-        LDFLAGS="$LDFLAGS $RELEASE_LDFLAGS"
+        LDFLAGS="$RELEASE_LDFLAGS $LDFLAGS"
     fi
 fi
 
@@ -387,15 +398,15 @@
 then
     if test "$DEBUG_CFLAGS" != ""
     then
-        CFLAGS="$CFLAGS $DEBUG_CFLAGS"
+        CFLAGS="$DEBUG_CFLAGS $CFLAGS"
     fi
     if test "$DEBUG_CXXFLAGS" != ""
     then
-        CXXFLAGS="$CXXFLAGS $DEBUG_CXXFLAGS"
+        CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
     fi
     if test "$DEBUG_LDFLAGS" != ""
     then
-        LDFLAGS="$LDFLAGS $DEBUG_LDFLAGS"
+        LDFLAGS="$DEBUG_LDFLAGS $LDFLAGS"
     fi
 fi
 
