Bug 975740 - Port WIN32_EXE_LDFLAGS to moz.build; r=mshal

This commit is contained in:
Ehsan Akhgari 2014-02-24 08:30:25 -05:00
parent e1b60f2947
commit 39fc9361f6
32 changed files with 64 additions and 67 deletions

View File

@ -47,12 +47,6 @@ endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,version)
endif
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
endif #LIBXUL_SDK
UA_UPDATE_FILE = ua-update.json

View File

@ -12,6 +12,10 @@ if not CONFIG['LIBXUL_SDK']:
SOURCES += [
'nsBrowserApp.cpp',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
if CONFIG['ENABLE_MARIONETTE']:
DEFINES['ENABLE_MARIONETTE'] = 1

View File

@ -54,12 +54,6 @@ NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifeq ($(OS_ARCH),WINNT)
RCINCLUDE = splash.rc
# Rebuild firefox.exe if the manifest changes - it's included by splash.rc.

View File

@ -32,3 +32,8 @@ LOCAL_INCLUDES += [
'/xpcom/base',
'/xpcom/build',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -13,7 +13,3 @@ STL_FLAGS = \
MOZ_GLUE_LDFLAGS =
include $(topsrcdir)/config/rules.mk
ifdef GNU_CC
WIN32_EXE_LDFLAGS = -municode
endif

View File

@ -15,3 +15,6 @@ UNIFIED_SOURCES += [
include('/ipc/chromium/chromium-config.mozbuild')
DEFINES['NS_NO_XPCOM'] = True
if CONFIG['GNU_CC']:
WIN32_EXE_LDFLAGS += ['-municode']

View File

@ -36,12 +36,6 @@ NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
include $(topsrcdir)/config/rules.mk
LDFLAGS += $(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)

View File

@ -29,3 +29,8 @@ if CONFIG['MOZ_CONTENT_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
'/security/sandbox',
'/security/sandbox/chromium',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -12,8 +12,4 @@ LIBS = \
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
include $(topsrcdir)/config/rules.mk

View File

@ -16,3 +16,5 @@ LOCAL_INCLUDES += [
'/xpcom/base',
]
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -21,12 +21,6 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifdef MOZ_VTUNE
CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib

View File

@ -32,3 +32,7 @@ LOCAL_INCLUDES += [
'/toolkit/xre',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -245,6 +245,7 @@ class TreeMetadataEmitter(LoggingMixin):
'CFLAGS',
'CXXFLAGS',
'LDFLAGS',
'WIN32_EXE_LDFLAGS',
]
for v in varlist:
if v in sandbox and sandbox[v]:

View File

@ -710,6 +710,17 @@ VARIABLES = {
added to the linker's command line in the same order as they
appear in the moz.build file.
""", 'libs'),
'WIN32_EXE_LDFLAGS': (list, list,
"""Flags passed to the linker when linking a Windows .exe executable
declared in this directory.
Note that the ordering of flags matter here, these flags will be
added to the linker's command line in the same order as they
appear in the moz.build file.
This variable only has an effect on Windows.
""", 'libs'),
}
# The set of functions exposed to the sandbox.

View File

@ -45,3 +45,4 @@ USE_STATIC_LIBS = True
CFLAGS += ['-fno-exceptions', '-w']
CXXFLAGS += ['-fcxx-exceptions', '-include foo.h']
LDFLAGS += ['-framework Foo', '-x']
WIN32_EXE_LDFLAGS += ['-subsystem:console']

View File

@ -351,7 +351,10 @@ class TestRecursiveMakeBackend(BackendTester):
'LDFLAGS': [
'LDFLAGS += -framework Foo',
'LDFLAGS += -x',
]
],
'WIN32_EXE_LDFLAGS': [
'WIN32_EXE_LDFLAGS += -subsystem:console',
],
}
for var, val in expected.items():

View File

@ -51,3 +51,4 @@ USE_STATIC_LIBS = True
CFLAGS += ['-fno-exceptions', '-w']
CXXFLAGS += ['-fcxx-exceptions', '-include foo.h']
LDFLAGS += ['-framework Foo', '-x']
WIN32_EXE_LDFLAGS += ['-subsystem:console']

View File

@ -179,6 +179,7 @@ class TestEmitterBasic(unittest.TestCase):
CFLAGS=['-fno-exceptions', '-w'],
CXXFLAGS=['-fcxx-exceptions', '-include foo.h'],
LDFLAGS=['-framework Foo', '-x'],
WIN32_EXE_LDFLAGS=['-subsystem:console'],
)
variables = objs[0].variables

View File

@ -16,8 +16,4 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
OS_LIBS += $(call EXPAND_LIBNAME,gdiplus)
MOZ_GLUE_PROGRAM_LDFLAGS =
ifdef GNU_CC
WIN32_EXE_LDFLAGS = -municode
endif
endif # windows

View File

@ -15,3 +15,5 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'win32-screenshot.cpp',
]
USE_STATIC_LIBS = True
if CONFIG['GNU_CC']:
WIN32_EXE_FLAGS += ['-municode']

View File

@ -34,7 +34,3 @@ endif
endif
include $(topsrcdir)/config/rules.mk
ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif

View File

@ -28,5 +28,7 @@ LOCAL_INCLUDES += [
'/toolkit/xre',
]
USE_STATIC_LIBS = True
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -56,10 +56,6 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifdef MOZ_WIDGET_GTK
libs:: updater.png
$(NSINSTALL) -D $(DIST)/bin/icons

View File

@ -64,9 +64,11 @@ LOCAL_INCLUDES += [
'/xpcom/glue',
]
DELAYLOAD_DLLS += [
'crypt32.dll',
'userenv.dll',
'wsock32.dll',
]
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -28,12 +28,6 @@ SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
APP_VERSION := $(shell cat $(topsrcdir)/browser/config/version.txt)
DEFINES += -DAPP_VERSION=$(APP_VERSION)
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
OS_LIBS += $(call EXPAND_LIBNAME,shell32)
RCINCLUDE = webapprt.rc

View File

@ -21,3 +21,8 @@ LOCAL_INCLUDES += [
'/xpcom/base',
'/xpcom/build',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -32,12 +32,6 @@ NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
RCINCLUDE = splash.rc

View File

@ -25,3 +25,7 @@ LOCAL_INCLUDES += [
'/xpcom/build',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -37,10 +37,6 @@ endif
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),WINNT)

View File

@ -30,3 +30,6 @@ USE_STATIC_LIBS = True
if CONFIG['OS_ARCH'] == 'WINNT':
LOCAL_INCLUDES += ['/toolkit/xre']
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

View File

@ -12,8 +12,4 @@ LIBS = \
$(XPCOM_STANDALONE_GLUE_LDOPTS) \
$(NULL)
ifdef GNU_CC
WIN32_EXE_LDFLAGS = -municode
endif
endif

View File

@ -11,3 +11,5 @@ if CONFIG['OS_ARCH'] == 'WINNT':
]
for var in ('WIN32_LEAN_AND_MEAN', 'UNICODE', '_UNICODE', 'XPCOM_GLUE'):
DEFINES[var] = True
if CONFIG['GNU_CC']:
WIN32_EXE_LDFLAGS += ['-municode']