bug 1223530 - Move MOZ_WINCONSOLE to configure. r=glandium

This patch moves the logic for selecting MOZ_WINCONSOLE out of individual
Makefile.in files and into configure. It also changes config.mk to only
pass -SUBSYSTEM:CONSOLE if MOZ_WINCONSOLE=1. The MSDN docs state that
in the absence of -SUBSYSTEM, the linker will select the proper subsystem
based on whether the program contains [w]main or [w]WinMain, so let it
do that.

One program (windbgdlg) needed a tweak to add a wmain for when MOZ_WINCONSOLE
is defined.

This patch leaves one instance in security/sandbox/win/wow_helper/Makefile.in,
that Makefile has its own separate bug.
This commit is contained in:
Ted Mielczarek 2015-11-11 06:24:39 -05:00
parent 18ad489675
commit 7038d7d62a
15 changed files with 15 additions and 94 deletions

View File

@ -15,16 +15,6 @@ DEFINES += \
-DPBMODE_ICO='"$(DIST)/branding/pbmode.ico"' \
$(NULL)
# Build a binary bootstrapping with XRE_main
ifndef MOZ_WINCONSOLE
ifneq (,$(MOZ_DEBUG)$(MOZ_ASAN))
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
NSDISTMODE = copy

View File

@ -448,14 +448,8 @@ endif
# Set link flags according to whether we want a console.
ifeq ($(OS_ARCH),WINNT)
ifdef MOZ_WINCONSOLE
ifeq ($(MOZ_WINCONSOLE),1)
WIN32_EXE_LDFLAGS += $(WIN32_CONSOLE_EXE_LDFLAGS)
else # MOZ_WINCONSOLE
WIN32_EXE_LDFLAGS += $(WIN32_GUI_EXE_LDFLAGS)
endif
else
# For setting subsystem version
# If not specified, let the linker choose the right subsystem.
WIN32_EXE_LDFLAGS += $(WIN32_CONSOLE_EXE_LDFLAGS)
endif
endif # WINNT

View File

@ -413,10 +413,6 @@ else
fi
fi
if test -n "$MOZ_WINCONSOLE"; then
AC_DEFINE(MOZ_WINCONSOLE)
fi
MOZ_TOOL_VARIABLES
MOZ_CHECK_COMPILER_WRAPPER
@ -2555,6 +2551,15 @@ else
MOZ_COMPILER_OPTS
fi # COMPILE_ENVIRONMENT
if test -n "$MOZ_DEBUG" -o -n "$MOZ_ASAN"; then
MOZ_WINCONSOLE=1
fi
if test -n "$MOZ_WINCONSOLE"; then
AC_DEFINE(MOZ_WINCONSOLE)
fi
AC_SUBST(MOZ_WINCONSOLE)
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ========================================================

View File

@ -2,14 +2,6 @@
# 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/.
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
NSDISTMODE = copy

View File

@ -2,12 +2,4 @@
# 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/.
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
include $(topsrcdir)/config/rules.mk

View File

@ -3,10 +3,6 @@
# 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/.
ifeq ($(OS_ARCH),WINNT)
MOZ_WINCONSOLE = 0
endif
ifdef MOZ_WIDGET_GTK
OS_CXXFLAGS += $(TK_CFLAGS) $(MOZ_GTHREAD_CFLAGS)
endif

View File

@ -43,8 +43,6 @@ INI_TEST_FILES = \
TestAUSReadStrings3.ini \
$(NULL)
MOZ_WINCONSOLE = 1
include $(topsrcdir)/config/rules.mk
# TestAUSReadStrings runs during check in the following directory with a Unicode

View File

@ -5,14 +5,6 @@
# For changes here, also consider ./updater-xpcshell/Makefile.in
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
include $(topsrcdir)/config/rules.mk
ifneq (,$(filter beta release esr,$(MOZ_UPDATE_CHANNEL)))

View File

@ -10,14 +10,6 @@ MOCHITESTROOT = $(abspath $(DEPTH))/_tests/testing/mochitest/chrome/toolkit/moza
include $(topsrcdir)/config/rules.mk
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
libs::
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
# Copy for xpcshell tests

View File

@ -2,8 +2,6 @@
# 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/.
MOZ_WINCONSOLE = 1
include $(topsrcdir)/config/rules.mk
libs:: TestXREMakeCommandLineWin.ini

View File

@ -2,14 +2,6 @@
# 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/.
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
# Installer stuff
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk

View File

@ -1,6 +0,0 @@
#
# 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/.
MOZ_WINCONSOLE = 0

View File

@ -119,3 +119,8 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
MB_ICONSTOP | MB_SYSTEMMODAL |
MB_ABORTRETRYIGNORE | MB_DEFBUTTON3);
}
int wmain(int argc, wchar_t** argv) {
return wWinMain(nullptr, nullptr,
GetCommandLineW(), 0);
}

View File

@ -9,14 +9,6 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
NSDISTMODE = copy

View File

@ -1,11 +0,0 @@
# 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/.
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif