Bug 605701 - Make WIN32_REDIST_DIR support stricter and more explicit; (Av1a) Just do it.
authorSerge Gautherie <sgautherie.bz@free.fr>
Sun, 17 Apr 2011 16:47:19 +0200
changeset 68214 233c1426514ff453feeb52e0721fc9ccd03bd618
parent 68213 5c5d9ed49e5e1a0ae50d5eb5bf349444a2817291
child 68215 6da70394e0d59d0bb56fee8cd36b9ace019fb3b1
push idunknown
push userunknown
push dateunknown
bugs605701
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 605701 - Make WIN32_REDIST_DIR support stricter and more explicit; (Av1a) Just do it. r=benjamin.
build/win32/Makefile.in
configure.in
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -53,20 +53,21 @@ endif
 DIRS += \
   crashinjectdll \
   $(NULL)
 
 PROGRAM = crashinject$(BIN_SUFFIX)
 USE_STATIC_LIBS = 1
 CPPSRCS = crashinject.cpp
 
-endif
+endif # ENABLE_TESTS
 
 include $(topsrcdir)/config/rules.mk
 
+ifndef MOZ_MEMORY
 ifdef WIN32_REDIST_DIR
 
 ifeq (1400,$(_MSC_VER))
 REDIST_FILES = \
 	Microsoft.VC80.CRT.manifest \
 	msvcm80.dll \
 	msvcp80.dll \
 	msvcr80.dll \
@@ -84,16 +85,16 @@ endif
 
 ifeq (1600,$(_MSC_VER))
 REDIST_FILES = \
 	msvcp100.dll \
 	msvcr100.dll \
 	$(NULL)
 endif
 
-endif
-
 ifdef REDIST_FILES
 libs::
 	mkdir -p $(FINAL_TARGET)
 	install --preserve-timestamps $(foreach f,$(REDIST_FILES),"$(WIN32_REDIST_DIR)"/$(f)) $(FINAL_TARGET)
 endif
 
+endif # WIN32_REDIST_DIR
+endif # ! MOZ_MEMORY
--- a/configure.in
+++ b/configure.in
@@ -676,17 +676,20 @@ case "$target" in
 
         _MOZ_RTTI_FLAGS_ON='-GR'
         _MOZ_RTTI_FLAGS_OFF='-GR-'
         _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
         _MOZ_EXCEPTIONS_FLAGS_OFF=''
         AC_DEFINE(HAVE_SEH_EXCEPTIONS)
 
         if test -n "$WIN32_REDIST_DIR"; then
-            WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
+          if test ! -d "$WIN32_REDIST_DIR"; then
+            AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
+          fi
+          WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
         fi
 
         dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
         dnl not something else like "magnetic tape manipulation utility".
         MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
         if test -z "$MSMT_TOOL"; then
           AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
         fi
@@ -7429,18 +7432,25 @@ MOZ_ARG_ENABLE_BOOL(jemalloc,
 [  --enable-jemalloc       Replace memory allocator with jemalloc],
     MOZ_MEMORY=1,
     MOZ_MEMORY=)
 
 if test "$NS_TRACE_MALLOC"; then
     MOZ_MEMORY=
 fi
 
-if test "$MOZ_MEMORY"; then
-
+if test -z "$MOZ_MEMORY"; then
+  case "${target}" in
+    *-mingw*)
+      if test -z "$WIN32_REDIST_DIR"; then
+        AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.])
+      fi
+      ;;
+  esac
+else
   dnl Don't try to run compiler tests on Windows  
   if test "$OS_ARCH" = "WINNT"; then
     if test -z "$HAVE_64BIT_OS"; then
       AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
     else
       AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
     fi
   else
@@ -7544,17 +7554,17 @@ if test "$MOZ_MEMORY"; then
   esac
 
   if test "$OS_ARCH" != "Darwin"; then
     dnl NB: this must be kept in sync with jemalloc.h
     AC_DEFINE(HAVE_JEMALLOC_VALLOC)
     AC_DEFINE(HAVE_JEMALLOC_POSIX_MEMALIGN)
     AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
   fi
-fi
+fi # MOZ_MEMORY
 AC_SUBST(MOZ_MEMORY)
 AC_SUBST(MOZ_MEMORY_LDFLAGS)
 AC_SUBST(WIN32_CRT_SRC_DIR)
 dnl Need to set this for make because NSS doesn't have configure
 AC_SUBST(DLLFLAGS)
 
 dnl ========================================================
 dnl = Use malloc wrapper lib