Bug 1043082: add the --enable-static-rtl configure option for Windows.
authorWan-Teh Chang <wtc@google.com>
Thu, 07 Aug 2014 17:53:09 -0700
changeset 4589 74f34c743ff5b76a2fedfdf4de755f636c3a8ddf
parent 4588 c9f79fae187d33e7bc8c55610545c32f11b66e5e
child 4590 a19171d4cd48da45f2e483b954b4fa6046b26cf2
push id133
push userwtc@google.com
push dateFri, 08 Aug 2014 00:53:18 +0000
bugs1043082
Bug 1043082: add the --enable-static-rtl configure option for Windows. r=ehsan.
configure
configure.in
--- a/configure
+++ b/configure
@@ -790,16 +790,17 @@ with_dist_includedir
 with_dist_libdir
 with_mozilla
 enable_optimize
 enable_debug
 enable_debug_symbols
 enable_win32_target
 enable_symbian_target
 enable_debug_rtl
+enable_static_rtl
 enable_n32
 enable_x32
 enable_64bit
 enable_mdupdate
 enable_cplus
 with_arm_kuser
 with_macos_sdk
 enable_macos_target
@@ -1450,16 +1451,17 @@ Optional Features:
   --enable-debug=DBG    Enable debugging (using compiler flags DBG)
   --enable-debug-symbols=DBG    Enable debugging symbols
                                        (using compiler flags DBG)
   --enable-win32-target=\$t
                           Specify win32 flavor. (WIN95 or WINNT)
   --enable-symbian-target=\$t
                           Specify symbian flavor. (WINSCW or GCCE)
   --enable-debug-rtl      Use the MSVC debug runtime library
+  --enable-static-rtl      Use the MSVC static runtime library
   --enable-n32            Enable n32 ABI support (IRIX only)
   --enable-x32            Enable x32 ABI support (x86_64 only)
   --enable-64bit          Enable 64-bit support (on certain platforms)
   --enable-mdupdate       Enable use of certain compilers' mdupdate feature
   --enable-cplus          Enable some c++ api routines
   --enable-macos-target=VER
                           Set the minimum MacOS version needed at runtime
                           10.2 for ppc, 10.4 for x86
@@ -2905,16 +2907,24 @@ if test "${enable_debug_rtl+set}" = set;
   enableval=$enable_debug_rtl;  if test "$enableval" = "yes"; then
 	    USE_DEBUG_RTL=1
       else
 	    USE_DEBUG_RTL=0
       fi
 fi
 
 
+# Check whether --enable-static-rtl was given.
+if test "${enable_static_rtl+set}" = set; then :
+  enableval=$enable_static_rtl;  if test "$enableval" = "yes"; then
+	    USE_STATIC_RTL=1
+      fi
+fi
+
+
 # Check whether --enable-n32 was given.
 if test "${enable_n32+set}" = set; then :
   enableval=$enable_n32;  if test "$enableval" = "yes"; then
 	USE_N32=1
       else if test "$enableval" = "no"; then
 	USE_N32=
       fi
     fi
@@ -7180,19 +7190,27 @@ tools are selected during the Xcode/Deve
             PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
         fi
 
         if test -z "$MOZ_OPTIMIZE"; then
             CFLAGS="$CFLAGS -Od"
         fi
 
         if test "$USE_DEBUG_RTL" = 1; then
-            CFLAGS="$CFLAGS -MDd"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MTd"
+            else
+                CFLAGS="$CFLAGS -MDd"
+            fi
         else
-            CFLAGS="$CFLAGS -MD"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MT"
+            else
+                CFLAGS="$CFLAGS -MD"
+            fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
             $as_echo "#define _DEBUG 1" >>confdefs.h
 
         else
             DEFINES="$DEFINES -U_DEBUG"
         fi
--- a/configure.in
+++ b/configure.in
@@ -385,16 +385,22 @@ AC_ARG_ENABLE(symbian-target,
 AC_ARG_ENABLE(debug-rtl,
     [  --enable-debug-rtl      Use the MSVC debug runtime library],
     [ if test "$enableval" = "yes"; then
 	    USE_DEBUG_RTL=1
       else
 	    USE_DEBUG_RTL=0
       fi ])
 
+AC_ARG_ENABLE(static-rtl,
+    [  --enable-static-rtl      Use the MSVC static runtime library],
+    [ if test "$enableval" = "yes"; then
+	    USE_STATIC_RTL=1
+      fi ])
+
 AC_ARG_ENABLE(n32,
     [  --enable-n32            Enable n32 ABI support (IRIX only)],
     [ if test "$enableval" = "yes"; then
 	USE_N32=1
       else if test "$enableval" = "no"; then
 	USE_N32=
       fi
     fi ])
@@ -1999,19 +2005,27 @@ tools are selected during the Xcode/Deve
             PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
         fi
 
         if test -z "$MOZ_OPTIMIZE"; then
             CFLAGS="$CFLAGS -Od"
         fi
 
         if test "$USE_DEBUG_RTL" = 1; then
-            CFLAGS="$CFLAGS -MDd"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MTd"
+            else
+                CFLAGS="$CFLAGS -MDd"
+            fi
         else
-            CFLAGS="$CFLAGS -MD"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MT"
+            else
+                CFLAGS="$CFLAGS -MD"
+            fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
             AC_DEFINE(_DEBUG)
         else
             DEFINES="$DEFINES -U_DEBUG"
         fi