Bug 1245701 - Port build/win32 install rules to moz.build; r?glandium
MozReview-Commit-ID: 8FY0F6reO1g
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -1,35 +1,14 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/config/rules.mk
-REDIST_FILES =
-
-ifdef WIN32_REDIST_DIR
-REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_C_RUNTIME_DLL)
-REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_CXX_RUNTIME_DLL)
-endif
-
-ifdef WIN_UCRT_REDIST_DIR
-REDIST_FILES += $(wildcard $(WIN_UCRT_REDIST_DIR)/api-ms-win-*.dll)
-REDIST_FILES += '$(WIN_UCRT_REDIST_DIR)'/ucrtbase.dll
-endif
-
-ifdef REDIST_FILES
-libs-preqs = \
- $(call mkdir_deps,$(FINAL_TARGET)) \
- $(NULL)
-
-libs:: $(libs-preqs)
- install --preserve-timestamps $(REDIST_FILES) $(FINAL_TARGET)
-endif
-
# run the binscope tool to make sure the binary and all libraries
# are using all available Windows OS-level security mechanisms
# Don't do this in clang-cl since it doesn't support debug information yet.
ifndef CLANG_CL
check::
$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/crashreporter-symbols/
$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME) $(DIST)/crashreporter-symbols/
$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_PLUGIN_PROCESS_NAME) $(DIST)/crashreporter-symbols/
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -9,8 +9,20 @@ TEST_DIRS += ['crashinjectdll']
if CONFIG['ENABLE_TESTS']:
Program('crashinject')
SOURCES += [
'crashinject.cpp',
]
USE_STATIC_LIBS = True
NO_PGO = True
+
+if CONFIG['WIN32_REDIST_DIR']:
+ for f in ['MSVC_C_RUNTIME_DLL', 'MSVC_CXX_RUNTIME_DLL']:
+ FINAL_TARGET_FILES += [
+ '%%%s/%s' % (CONFIG['WIN32_REDIST_DIR'], CONFIG[f])
+ ]
+
+if CONFIG['WIN_UCRT_REDIST_DIR']:
+ for f in ['api-ms-win-*.dll', 'ucrtbase.dll']:
+ FINAL_TARGET_FILES += [
+ '%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f)
+ ]
--- a/old-configure.in
+++ b/old-configure.in
@@ -408,17 +408,17 @@ case "$target" in
# C4091: 'typedef ': ignored on left of '' when no variable is declared
CFLAGS="$CFLAGS -wd4091"
CXXFLAGS="$CXXFLAGS -wd4091"
if test -n "$WIN_UCRT_REDIST_DIR"; then
if test ! -d "$WIN_UCRT_REDIST_DIR"; then
AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
fi
- WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd`
+ WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W`
fi
else
AC_MSG_ERROR([This version (${_CC_MAJOR_VERSION}.${_CC_MINOR_VERSION}.${_CC_BUILD_VERSION}) of the MSVC compiler is unsupported.
You must install Visual C++ 2013 Update 3, Visual C++ 2015 Update 1, or newer in order to build.
See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
AC_SUBST(MSVS_VERSION)
AC_SUBST(MSVC_HAS_DIA_SDK)
@@ -426,17 +426,17 @@ See https://developer.mozilla.org/en/Win
AC_SUBST(MSVC_CXX_RUNTIME_DLL)
AC_DEFINE(HAVE_SEH_EXCEPTIONS)
if test -n "$WIN32_REDIST_DIR"; then
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`
+ WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd -W`
fi
dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
dnl not something else like "magnetic tape manipulation utility".
MSMT_TOOL=`${MT-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
@@ -7249,16 +7249,17 @@ dnl We need SUBST for build system and D
if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then
MOZ_DATA_REPORTING=1
AC_DEFINE(MOZ_DATA_REPORTING)
AC_SUBST(MOZ_DATA_REPORTING)
fi
dnl win32 options
AC_SUBST(WIN32_REDIST_DIR)
+AC_SUBST(WIN_UCRT_REDIST_DIR)
AC_SUBST(MAKENSISU)
dnl Echo the CFLAGS to remove extra whitespace.
CFLAGS=`echo \
$_WARNINGS_CFLAGS \
$CFLAGS`
CXXFLAGS=`echo \