2
# The contents of this file are subject to the Netscape Public
3
# License Version 1.1 (the "License"); you may not use this file
4
# except in compliance with the License. You may obtain a copy of
5
# the License at http://www.mozilla.org/NPL/
7
# Software distributed under the License is distributed on an "AS
8
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
# implied. See the License for the specific language governing
10
# rights and limitations under the License.
12
# The Original Code is mozilla.org code.
14
# The Initial Developer of the Original Code is Netscape
15
# Communications Corporation. Portions created by Netscape are
16
# Copyright (C) 1998 Netscape Communications Corporation. All
25
# Determines the platform and builds the macros needed to load the
26
# appropriate platform-specific .mk file, then defines all (most?)
27
# of the generic macros.
30
# Define an include-at-most-once flag
31
INCLUDED_CONFIG_MK = 1
37
ifndef INCLUDED_AUTOCONF_MK
38
include $(DEPTH)/config/autoconf.mk
40
ifndef INCLUDED_INSURE_MK
42
include $(topsrcdir)/config/insure.mk
46
GRE_DIST = $(DIST)/gre
49
# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
50
# Since the longest of these is 5 characters without the suffix,
51
# be sure to not set VERSION_NUMBER to anything longer than 3
52
# characters for Win16's sake.
56
BUILD_TOOLS = $(topsrcdir)/build/unix
57
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
58
AUTOCONF_TOOLS = $(topsrcdir)/build/autoconf
61
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
64
OS_RELEASE := $(shell uname -v).$(shell uname -r)
66
ifeq ($(OS_ARCH),BSD_386)
69
ifeq ($(OS_ARCH),dgux)
72
ifeq ($(OS_ARCH),IRIX64)
75
ifeq ($(OS_ARCH),UNIX_SV)
76
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
80
OS_RELEASE := $(shell uname -v)
86
# This is the only way to correctly determine the actual OS version on NCR boxes.
88
OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
90
ifeq ($(OS_ARCH),UNIX_System_V)
93
ifeq ($(OS_ARCH),OSF1)
94
OS_SUB := $(shell uname -v)
95
# Until I know the other possibilities, or an easier way to compute them, this is all there's gonna be.
109
ifneq (,$(findstring OpenVMS,$(OS_ARCH)))
111
OS_RELEASE := $(shell uname -v)
112
CPU_ARCH := $(shell uname -p)
113
CPU_ARCH_TAG := _$(CPU_ARCH)
115
ifeq ($(OS_ARCH),QNX)
116
ifeq ($(OS_TARGET),NTO)
117
LD := qcc -Vgcc_ntox86 -nostdlib
119
OS_RELEASE := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
124
ifeq ($(OS_ARCH),SCO_SV)
128
ifneq (,$(filter SINIX-N SINIX-Y SINIX-Z ReliantUNIX-M,$(OS_ARCH)))
130
OS_TEST := $(shell uname -p)
132
ifeq ($(OS_ARCH),UnixWare)
134
OS_RELEASE := $(shell uname -v)
136
ifeq ($(OS_ARCH),OS_2)
138
OS_RELEASE := $(shell uname -v)
140
ifeq ($(OS_ARCH),BeOS)
141
BEOS_ADDON_WORKAROUND = 1
145
# Strip off the excessively long version numbers on these platforms,
146
# but save the version to allow multiple versions of the same base
147
# platform to be built in the same tree.
149
ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
150
OS_RELEASE := $(basename $(OS_RELEASE))
152
# Allow the user to ignore the OS_VERSION, which is usually irrelevant.
153
ifdef WANT_MOZILLA_CONFIG_OS_VERSION
154
OS_VERS := $(suffix $(OS_RELEASE))
155
OS_VERSION := $(shell echo $(OS_VERS) | sed 's/-.*//')
160
OS_CONFIG := $(OS_ARCH)$(OS_RELEASE)
162
FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs
163
FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
164
FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
167
# NSS libs needed for final link in static build
172
$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
179
ifneq (,$(filter OS2 WINNT, $(OS_ARCH)))
182
$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
183
$(DIST)/lib/$(LIB_PREFIX)smime3.$(IMPORT_LIB_SUFFIX) \
184
$(DIST)/lib/$(LIB_PREFIX)ssl3.$(IMPORT_LIB_SUFFIX) \
185
$(DIST)/lib/$(LIB_PREFIX)nss3.$(IMPORT_LIB_SUFFIX) \
186
$(DIST)/lib/$(LIB_PREFIX)softokn3.$(IMPORT_LIB_SUFFIX) \
192
$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
193
$(DIST)/lib/$(DLL_PREFIX)smime3$(DLL_SUFFIX) \
194
$(DIST)/lib/$(DLL_PREFIX)ssl3$(DLL_SUFFIX) \
195
$(DIST)/lib/$(DLL_PREFIX)nss3$(DLL_SUFFIX) \
196
$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX) \
199
MOZ_UNICHARUTIL_LIBS = $(DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
200
MOZ_REGISTRY_LIBS = $(DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
201
MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
203
# determine debug-related options
208
# global debugging is disabled
209
# check if it was explicitly enabled for this module
210
ifneq (, $(findstring $(MODULE), $(MOZ_DEBUG_MODULES)))
214
# global debugging is enabled
215
# check if it was explicitly disabled for this module
216
ifneq (, $(findstring ^$(MODULE), $(MOZ_DEBUG_MODULES)))
222
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
224
_DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
227
# determine if -g should be passed to the compiler, based on
228
# the current module, and the value of MOZ_DBGRINFO_MODULES
231
MOZ_DBGRINFO_MODULES += ALL_MODULES
232
pattern := ALL_MODULES ^ALL_MODULES
234
MOZ_DBGRINFO_MODULES += ^ALL_MODULES
235
pattern := ALL_MODULES ^ALL_MODULES
239
# our current Makefile specifies a module name - add it to our pattern
240
pattern += $(MODULE) ^$(MODULE)
243
# start by finding the first relevant module name
244
# (remember that the order of the module names in MOZ_DBGRINFO_MODULES
245
# is reversed from the order the user specified to configure -
246
# this allows the user to put general names at the beginning
247
# of the list, and to override them with explicit module names later
250
first_match:=$(firstword $(filter $(pattern), $(MOZ_DBGRINFO_MODULES)))
252
ifeq ($(first_match), $(MODULE))
253
# the user specified explicitly that
254
# this module should be compiled with -g
255
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
256
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
258
ifeq ($(first_match), ^$(MODULE))
259
# the user specified explicitly that this module
260
# should not be compiled with -g (nothing to do)
262
ifeq ($(first_match), ALL_MODULES)
263
# the user didn't mention this module explicitly,
264
# but wanted all modules to be compiled with -g
265
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
266
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
268
ifeq ($(first_match), ^ALL_MODULES)
269
# the user didn't mention this module explicitly,
270
# but wanted all modules to be compiled without -g (nothing to do)
278
# (these might have been above when processing MOZ_DBGRINFO_MODULES)
279
OS_CFLAGS += $(_DEBUG_CFLAGS)
280
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
281
OS_LDFLAGS += $(_DEBUG_LDFLAGS)
283
# MOZ_PROFILE & MOZ_COVERAGE equivs for win32
284
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
286
ifneq (,$(MOZ_BROWSE_INFO)$(MOZ_BSCFILE))
291
# if MOZ_DEBUG is not set and MOZ_PROFILE is set, then we generate
292
# an optimized build with debugging symbols. Useful for debugging
293
# compiler optimization bugs, as well as running with Quantify.
294
# MOZ_DEBUG_SYMBOLS works the same way as MOZ_PROFILE, but generates debug
295
# symbols in separate PDB files, rather than embedded into the binary.
296
ifneq (,$(MOZ_PROFILE)$(MOZ_DEBUG_SYMBOLS))
297
MOZ_OPTIMIZE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
298
OS_LDFLAGS = /DEBUG /OPT:REF /OPT:nowin98
300
OS_LDFLAGS += /PDB:NONE
304
# /FIXED:NO is needed for Quantify to work, but it increases the size
305
# of executables, so only use it if building for Quantify.
307
WIN32_EXE_LDFLAGS=/FIXED:NO
310
# if MOZ_COVERAGE is set, we handle pdb files slightly differently
312
MOZ_OPTIMIZE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
313
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
314
_ORDERFILE := $(wildcard $(srcdir)/win32.order)
315
ifneq (,$(_ORDERFILE))
316
OS_LDFLAGS += /ORDER:@$(srcdir)/win32.order
322
# Handle trace-malloc in optimized builds.
323
# No opt to give sane callstacks.
325
ifdef NS_TRACE_MALLOC
326
MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
327
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
332
endif # WINNT && !GNU_CC
336
# -ffunction-sections is needed to reorder functions using a GNU ld
339
ifeq ($(MOZ_REORDER),1)
340
OS_CFLAGS += -ffunction-sections
341
OS_CXXFLAGS += -ffunction-sections
345
# List known meta modules and their dependent libs
347
_ALL_META_COMPONENTS=mail crypto
349
MOZ_META_COMPONENTS_mail = \
353
nsImportServiceModule \
359
nsMsgMailViewModule \
360
nsBayesianFilterModule \
363
MOZ_META_COMPONENTS_mail_comps = \
378
MOZ_META_COMPONENTS_mail_libs = mimecthglue_s
379
ifdef USE_SHORT_LIBNAME
380
MOZ_META_COMPONENTS_mail_libs += msgbsutl
382
MOZ_META_COMPONENTS_mail_libs += msgbaseutil
385
ifeq ($(OS_ARCH),WINNT)
386
MOZ_META_COMPONENTS_mail += \
388
nsEudoraImportModule \
393
MOZ_META_COMPONENTS_mail_comps += \
401
MOZ_META_COMPONENTS_mail += nsMsgBaseModule
402
MOZ_META_COMPONENTS_mail_comps += mailnews
405
MOZ_META_COMPONENTS_mail += \
406
nsMimeEmitterModule \
408
local_mail_services \
409
nsComm4xMailImportModule \
412
ifdef USE_SHORT_LIBNAME
413
MOZ_META_COMPONENTS_mail_comps += emitter msgcompo msglocal
414
ifeq ($(OS_ARCH),WINNT)
415
MOZ_META_COMPONENTS_mail_comps += impComm4xMail
417
MOZ_META_COMPONENTS_mail_comps += imp4Mail
420
MOZ_META_COMPONENTS_mail_comps += mimeemitter msgcompose localmail impComm4xMail
424
MOZ_META_COMPONENTS_mail += nsMsgSMIMEModule
425
MOZ_META_COMPONENTS_mail_comps += msgsmime
427
MOZ_META_COMPONENTS_mail += nsSMIMEModule
428
MOZ_META_COMPONENTS_mail_comps += smimestb
431
MOZ_META_COMPONENTS_crypto = BOOT PKI NSS
432
MOZ_META_COMPONENTS_crypto_comps = pipboot pippki pipnss
434
# If we're applying MOZ_PROFILE_GENERATE to a non-static build, then we
435
# need to create a static build _with_ PIC. This allows us to generate
436
# profile data that will still be valid when the object files are linked into
438
ifdef MOZ_PROFILE_GENERATE
439
ifdef BUILD_SHARED_LIBS
442
MOZ_STATIC_COMPONENT_LIBS=1
448
# Build using PIC by default
449
# Do not use PIC if not building a shared lib (see exceptions below)
451
#ifeq (,$(PROGRAM)$(SIMPLE_PROGRAMS)$(HOST_PROGRAM)$(HOST_SIMPLE_PROGRAMS))
452
ifneq (,$(BUILD_SHARED_LIBS)$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
457
# If module is going to be merged into the nsStaticModule,
458
# make sure that the entry points are translated and
459
# the module is built static.
462
ifneq (,$(MOZ_STATIC_COMPONENT_LIBS)$(findstring $(LIBRARY_NAME), $(MOZ_STATIC_COMPONENTS)))
464
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
470
# Determine if module being compiled is destined
471
# to be merged into a meta module in the future
473
ifneq (, $(findstring $(META_COMPONENT), $(MOZ_META_COMPONENTS)))
476
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
485
# Force PIC if we're generating the mozcomps meta module
488
ifneq (,$(findstring mozcomps, $(MOZ_META_COMPONENTS)))
492
ifdef STATIC_BUILD_PIC
494
# If PIC hasn't been enabled now, object files in this directory will not
495
# ever be linked into a DSO. Turn PIC on and set ENABLE_PROFILE_GENERATE.
496
ENABLE_PROFILE_GENERATE=1
500
# For static builds, always enable profile generation for non-PIC objects.
502
ENABLE_PROFILE_GENERATE=1
507
# Disable PIC if necessary
512
ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
513
DSO_PIC_CFLAGS=-mdynamic-no-pic
521
# Enable profile-based feedback for non-PIC objects
522
ifdef ENABLE_PROFILE_GENERATE
523
ifdef MOZ_PROFILE_GENERATE
524
DSO_PIC_CFLAGS += $(PROFILE_GEN_CFLAGS)
527
# We always use the profile-use flags, even in cases where we didn't use the
528
# profile-generate flags. It's harmless, and it saves us from having to
529
# answer the question "Would these objects have been built using
530
# the profile-generate flags?" which is not trivial.
531
ifdef MOZ_PROFILE_USE
532
DSO_PIC_CFLAGS += $(PROFILE_USE_CFLAGS)
536
# Force _all_ exported methods to be |_declspec(dllexport)| when we're
537
# building them into the executable.
538
ifeq ($(OS_ARCH),WINNT)
539
ifdef MOZ_STATIC_COMPONENT_LIBS
542
-D_IMPL_NS_MSG_BASE \
550
# Personal makefile customizations go in these optional make include files.
552
MY_CONFIG := $(DEPTH)/config/myconfig.mk
553
MY_RULES := $(DEPTH)/config/myrules.mk
556
# Default command macros; can be overridden in <arch>.mk.
559
NFSPWD = $(CONFIG_TOOLS)/nfspwd
560
PURIFY = purify $(PURIFYOPTIONS)
561
QUANTIFY = quantify $(QUANTIFYOPTIONS)
563
XPIDL_COMPILE = $(CYGWIN_WRAPPER) $(DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
564
XPIDL_LINK = $(CYGWIN_WRAPPER) $(DIST)/host/bin/host_xpt_link$(HOST_BIN_SUFFIX)
566
XPIDL_COMPILE = $(CYGWIN_WRAPPER) $(DIST)/bin/xpidl$(BIN_SUFFIX)
567
XPIDL_LINK = $(CYGWIN_WRAPPER) $(DIST)/bin/xpt_link$(BIN_SUFFIX)
570
REQ_INCLUDES = $(foreach d,$(REQUIRES),-I$(DIST)/include/$d)
572
INCLUDES = $(LOCAL_INCLUDES) $(REQ_INCLUDES) -I$(PUBLIC) -I$(DIST)/include $(OS_INCLUDES)
574
CFLAGS = $(OS_CFLAGS)
575
CXXFLAGS = $(OS_CXXFLAGS)
576
LDFLAGS = $(OS_LDFLAGS)
578
# Allow each module to override the *default* optimization settings
579
# by setting MODULE_OPTIMIZE_FLAGS iff the developer has not given
580
# arguments to --enable-optimize
582
ifeq (1,$(MOZ_OPTIMIZE))
583
ifdef MODULE_OPTIMIZE_FLAGS
584
CFLAGS += $(MODULE_OPTIMIZE_FLAGS)
585
CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS)
587
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
588
CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
589
endif # MODULE_OPTIMIZE_FLAGS
591
CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
592
CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
593
endif # MOZ_OPTIMIZE == 1
594
LDFLAGS += $(MOZ_OPTIMIZE_LDFLAGS)
598
HOST_CFLAGS += $(HOST_OPTIMIZE_FLAGS)
601
ifeq (1,$(MOZ_OPTIMIZE))
602
ifdef MODULE_OPTIMIZE_FLAGS
603
HOST_CFLAGS += $(MODULE_OPTIMIZE_FLAGS)
605
HOST_CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
606
endif # MODULE_OPTIMIZE_FLAGS
608
HOST_CFLAGS += $(MOZ_OPTIMIZE_FLAGS)
609
endif # MOZ_OPTIMIZE == 1
611
endif # CROSS_COMPILE
613
ifeq ($(MOZ_OS2_TOOLS),VACPP)
614
ifdef USE_STATIC_LIBS
616
else # !USE_STATIC_LIBS
622
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
623
#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
624
#// DLL version of the RTL is used...
626
#//------------------------------------------------------------------------
627
ifdef USE_STATIC_LIBS
628
RTL_FLAGS=-MT # Statically linked multithreaded RTL
629
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
630
RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL
631
endif # MOZ_DEBUG || NS_TRACE_MALLOC
633
else # !USE_STATIC_LIBS
635
ifdef USE_NON_MT_LIBS
636
RTL_FLAGS=-ML # Statically linked non-multithreaded LIBC RTL
637
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
638
RTL_FLAGS=-MLd # Statically linked non-multithreaded LIBC debug RTL
639
endif # MOZ_DEBUG || NS_TRACE_MALLOC
641
else # ! USE_NON_MT_LIBS
643
RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL
644
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
645
ifndef MOZ_NO_DEBUG_RTL
646
RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL
648
endif # MOZ_DEBUG || NS_TRACE_MALLOC
649
endif # USE_NON_MT_LIBS
650
endif # USE_STATIC_LIBS
651
endif # WINNT && !GNU_CC
654
COMPILE_CFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS)
655
COMPILE_CXXFLAGS = $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS)
658
# Name of the binary code directories
662
# We need to know where to find the libraries we
663
# put on the link line for binaries, and should
664
# we link statically or dynamic? Assuming dynamic for now.
666
ifneq ($(MOZ_OS2_TOOLS),VACPP)
667
ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
668
LIBS_DIR = -L$(DIST)/bin -L$(DIST)/lib
672
# Default location of include files
673
IDL_DIR = $(DIST)/idl
675
PUBLIC = $(DIST)/include/$(MODULE)
677
PUBLIC = $(DIST)/include
680
SDK_PUBLIC = $(DIST)/sdk/include
681
SDK_IDL_DIR = $(DIST)/sdk/idl
682
SDK_LIB_DIR = $(DIST)/sdk/lib
683
SDK_BIN_DIR = $(DIST)/sdk/bin
687
MOZ_COMPONENT_LIBS=$(MOZ_COMPONENT_XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)
689
ifdef GC_LEAK_DETECTOR
690
MOZ_COMPONENT_XPCOM_LIBS += -lboehm
691
XPCOM_LIBS += -lboehm
694
ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES)))
695
DEFINES += -DXPCONNECT_STANDALONE
698
ifeq ($(OS_ARCH),OS2)
705
ifdef USE_ELF_DYNSTR_GC
706
ifdef MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
707
ELF_DYNSTR_GC = $(DIST)/bin/elf-dynstr-gc
712
ifeq ($(OS_ARCH),Darwin)
715
export LD_SEG_ADDR_TABLE=$(shell cd $(topsrcdir); pwd)/config/prebind-address-table
718
export NEXT_ROOT=$(MACOS_SDK_DIR)
720
PBBUILD=NEXT_ROOT= $(PBBUILD_BIN)
723
ifdef MOZ_NATIVE_MAKEDEPEND
725
MKDEPEND = $(CYGWIN_WRAPPER) $(MOZ_NATIVE_MAKEDEPEND)
727
MKDEPEND_DIR = $(CONFIG_TOOLS)/mkdepend
728
MKDEPEND = $(CYGWIN_WRAPPER) $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX)
731
# Set link flags according to whether we want a console.
733
ifeq ($(MOZ_WINCONSOLE),1)
734
ifeq ($(MOZ_OS2_TOOLS),EMX)
735
BIN_FLAGS += -Zlinker /PM:VIO
737
ifeq ($(OS_ARCH),WINNT)
739
WIN32_EXE_LDFLAGS += -mconsole
741
WIN32_EXE_LDFLAGS += /SUBSYSTEM:CONSOLE
744
else # MOZ_WINCONSOLE
745
ifeq ($(MOZ_OS2_TOOLS),VACPP)
748
ifeq ($(MOZ_OS2_TOOLS),EMX)
749
BIN_FLAGS += -Zlinker /PM:PM
751
ifeq ($(OS_ARCH),WINNT)
753
WIN32_EXE_LDFLAGS += -mwindows
755
WIN32_EXE_LDFLAGS += /SUBSYSTEM:WINDOWS
761
# Flags needed to link against the component library
762
ifdef MOZ_COMPONENTLIB
763
MOZ_COMPONENTLIB_EXTRA_DSO_LIBS = mozcomps xpcom_compat
765
# Tell the linker where NSS is, if we're building crypto
766
ifeq ($(OS_ARCH),Darwin)
767
ifeq (,$(findstring crypto,$(MOZ_META_COMPONENTS)))
768
MOZ_COMPONENTLIB_EXTRA_LIBS = $(foreach library, $(patsubst -l%, $(LIB_PREFIX)%$(DLL_SUFFIX), $(filter -l%, $(NSS_LIBS))), -dylib_file @executable_path/$(library):$(DIST)/bin/$(library))
774
# Include any personal overrides the user might think are needed.
776
-include $(MY_CONFIG)
778
######################################################################
779
# Now test variables that might have been set or overridden by $(MY_CONFIG).
781
DEFINES += -DOSTYPE=\"$(OS_CONFIG)\"
782
DEFINES += -DOSARCH=\"$(OS_ARCH)\"
785
ifdef ENABLE_EAZEL_PROFILER
786
ifndef INTERNAL_TOOLS
787
ifneq ($(LIBRARY_NAME), xpt)
788
ifneq (, $(findstring $(shell $(topsrcdir)/build/unix/print-depth-path.sh | awk -F/ '{ print $$2; }'), $(MOZ_PROFILE_MODULES)))
789
PROFILER_CFLAGS = $(EAZEL_PROFILER_CFLAGS) -DENABLE_EAZEL_PROFILER
790
PROFILER_LIBS = $(EAZEL_PROFILER_LIBS)
796
######################################################################
798
GARBAGE += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
800
ifeq ($(OS_ARCH),Darwin)
802
NSDISTMODE=absolute_symlink
807
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
808
ifeq ($(OS_ARCH),WINNT)
809
NSINSTALL = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
811
NSINSTALL = $(MOZ_TOOLS_DIR)/nsinstall
813
INSTALL = $(NSINSTALL)
815
NSINSTALL = $(CONFIG_TOOLS)/nsinstall
817
ifeq ($(NSDISTMODE),copy)
818
# copy files, but preserve source mtime
819
INSTALL = $(NSINSTALL) -t
821
ifeq ($(NSDISTMODE),absolute_symlink)
822
# install using absolute symbolic links
823
ifeq ($(OS_ARCH),Darwin)
824
INSTALL = $(NSINSTALL) -L $(PWD)
826
INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
829
# install using relative symbolic links
830
INSTALL = $(NSINSTALL) -R
835
# Use nsinstall in copy mode to install files on the system
836
SYSINSTALL = $(NSINSTALL) -t
838
ifeq ($(OS_ARCH),WINNT)
839
ifneq (,$(CYGDRIVE_MOUNT))
840
export CYGDRIVE_MOUNT