~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/config/config.mk

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
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/
 
6
#
 
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.
 
11
#
 
12
# The Original Code is mozilla.org code.
 
13
#
 
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
 
17
# Rights Reserved.
 
18
#
 
19
# Contributor(s): 
 
20
#
 
21
 
 
22
#
 
23
# config.mk
 
24
#
 
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.
 
28
#
 
29
 
 
30
# Define an include-at-most-once flag
 
31
INCLUDED_CONFIG_MK = 1
 
32
 
 
33
ifndef topsrcdir
 
34
topsrcdir       = $(DEPTH)
 
35
endif
 
36
 
 
37
ifndef INCLUDED_AUTOCONF_MK
 
38
include $(DEPTH)/config/autoconf.mk
 
39
endif
 
40
ifndef INCLUDED_INSURE_MK
 
41
ifdef MOZ_INSURIFYING
 
42
include $(topsrcdir)/config/insure.mk
 
43
endif
 
44
endif
 
45
 
 
46
GRE_DIST        = $(DIST)/gre
 
47
 
 
48
#
 
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.
 
53
#
 
54
VERSION_NUMBER          = 50
 
55
 
 
56
BUILD_TOOLS     = $(topsrcdir)/build/unix
 
57
CONFIG_TOOLS    = $(MOZ_BUILD_ROOT)/config
 
58
AUTOCONF_TOOLS  = $(topsrcdir)/build/autoconf
 
59
 
 
60
#
 
61
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
 
62
#
 
63
ifeq ($(OS_ARCH),AIX)
 
64
OS_RELEASE      := $(shell uname -v).$(shell uname -r)
 
65
endif
 
66
ifeq ($(OS_ARCH),BSD_386)
 
67
OS_ARCH         := BSD_OS
 
68
endif
 
69
ifeq ($(OS_ARCH),dgux)
 
70
OS_ARCH         := DGUX
 
71
endif
 
72
ifeq ($(OS_ARCH),IRIX64)
 
73
OS_ARCH         := IRIX
 
74
endif
 
75
ifeq ($(OS_ARCH),UNIX_SV)
 
76
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
 
77
OS_ARCH         := NCR
 
78
else
 
79
OS_ARCH         := UNIXWARE
 
80
OS_RELEASE      := $(shell uname -v)
 
81
endif
 
82
endif
 
83
ifeq ($(OS_ARCH),ncr)
 
84
OS_ARCH         := NCR
 
85
endif
 
86
# This is the only way to correctly determine the actual OS version on NCR boxes.
 
87
ifeq ($(OS_ARCH),NCR)
 
88
OS_RELEASE      := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
 
89
endif
 
90
ifeq ($(OS_ARCH),UNIX_System_V)
 
91
OS_ARCH         := NEC
 
92
endif
 
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.
 
96
#ifeq ($(OS_SUB),240)
 
97
#OS_RELEASE     := V2.0
 
98
#endif
 
99
ifeq ($(OS_SUB),148)
 
100
OS_RELEASE      := V3.2C
 
101
endif
 
102
ifeq ($(OS_SUB),564)
 
103
OS_RELEASE      := V4.0B
 
104
endif
 
105
ifeq ($(OS_SUB),878)
 
106
OS_RELEASE      := V4.0D
 
107
endif
 
108
endif
 
109
ifneq (,$(findstring OpenVMS,$(OS_ARCH)))
 
110
OS_ARCH         := OpenVMS
 
111
OS_RELEASE      := $(shell uname -v)
 
112
CPU_ARCH        := $(shell uname -p)
 
113
CPU_ARCH_TAG    := _$(CPU_ARCH)
 
114
endif
 
115
ifeq ($(OS_ARCH),QNX)
 
116
ifeq ($(OS_TARGET),NTO)
 
117
LD              := qcc -Vgcc_ntox86 -nostdlib
 
118
else
 
119
OS_RELEASE      := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
 
120
LD              := $(CC)
 
121
endif
 
122
OS_TEST         := x86
 
123
endif
 
124
ifeq ($(OS_ARCH),SCO_SV)
 
125
OS_ARCH         := SCOOS
 
126
OS_RELEASE      := 5.0
 
127
endif
 
128
ifneq (,$(filter SINIX-N SINIX-Y SINIX-Z ReliantUNIX-M,$(OS_ARCH)))
 
129
OS_ARCH         := SINIX
 
130
OS_TEST         := $(shell uname -p)
 
131
endif
 
132
ifeq ($(OS_ARCH),UnixWare)
 
133
OS_ARCH         := UNIXWARE
 
134
OS_RELEASE      := $(shell uname -v)
 
135
endif
 
136
ifeq ($(OS_ARCH),OS_2)
 
137
OS_ARCH         := OS2
 
138
OS_RELEASE      := $(shell uname -v)
 
139
endif
 
140
ifeq ($(OS_ARCH),BeOS)
 
141
BEOS_ADDON_WORKAROUND   = 1
 
142
endif
 
143
 
 
144
#
 
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.
 
148
#
 
149
ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH)))
 
150
OS_RELEASE      := $(basename $(OS_RELEASE))
 
151
 
 
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/-.*//')
 
156
endif
 
157
 
 
158
endif
 
159
 
 
160
OS_CONFIG       := $(OS_ARCH)$(OS_RELEASE)
 
161
 
 
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
 
165
 
 
166
 
167
# NSS libs needed for final link in static build
 
168
 
169
 
 
170
NSS_LIBS        = \
 
171
        $(LIBS_DIR) \
 
172
        $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
 
173
        -lsmime3 \
 
174
        -lssl3 \
 
175
        -lnss3 \
 
176
        -lsoftokn3 \
 
177
        $(NULL)
 
178
 
 
179
ifneq (,$(filter OS2 WINNT, $(OS_ARCH)))
 
180
ifndef GNU_CC
 
181
NSS_LIBS        = \
 
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) \
 
187
        $(NULL)
 
188
endif
 
189
endif
 
190
 
 
191
NSS_DEP_LIBS    = \
 
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) \
 
197
        $(NULL)
 
198
 
 
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)
 
202
 
 
203
# determine debug-related options
 
204
_DEBUG_CFLAGS :=
 
205
_DEBUG_LDFLAGS :=
 
206
 
 
207
ifndef MOZ_DEBUG
 
208
  # global debugging is disabled 
 
209
  # check if it was explicitly enabled for this module
 
210
  ifneq (, $(findstring $(MODULE), $(MOZ_DEBUG_MODULES)))
 
211
    MOZ_DEBUG:=1
 
212
  endif
 
213
else
 
214
  # global debugging is enabled
 
215
  # check if it was explicitly disabled for this module
 
216
  ifneq (, $(findstring ^$(MODULE), $(MOZ_DEBUG_MODULES)))
 
217
    MOZ_DEBUG:=
 
218
  endif
 
219
endif
 
220
 
 
221
ifdef MOZ_DEBUG
 
222
  _DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
 
223
else
 
224
  _DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
 
225
endif
 
226
 
 
227
# determine if -g should be passed to the compiler, based on
 
228
# the current module, and the value of MOZ_DBGRINFO_MODULES
 
229
 
 
230
ifdef MOZ_DEBUG
 
231
  MOZ_DBGRINFO_MODULES += ALL_MODULES
 
232
  pattern := ALL_MODULES ^ALL_MODULES
 
233
else
 
234
  MOZ_DBGRINFO_MODULES += ^ALL_MODULES
 
235
  pattern := ALL_MODULES ^ALL_MODULES
 
236
endif
 
237
 
 
238
ifdef MODULE
 
239
  # our current Makefile specifies a module name - add it to our pattern
 
240
  pattern += $(MODULE) ^$(MODULE)
 
241
endif
 
242
 
 
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 
 
248
# in the list)
 
249
 
 
250
first_match:=$(firstword $(filter $(pattern), $(MOZ_DBGRINFO_MODULES)))
 
251
 
 
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)
 
257
else
 
258
  ifeq ($(first_match), ^$(MODULE))
 
259
    # the user specified explicitly that this module 
 
260
    # should not be compiled with -g (nothing to do)
 
261
  else
 
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)      
 
267
    else
 
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)
 
271
      endif
 
272
    endif
 
273
  endif
 
274
endif
 
275
 
 
276
 
 
277
# append debug flags 
 
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)
 
282
 
 
283
# MOZ_PROFILE & MOZ_COVERAGE equivs for win32
 
284
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 
285
ifdef MOZ_DEBUG
 
286
ifneq (,$(MOZ_BROWSE_INFO)$(MOZ_BSCFILE))
 
287
OS_CFLAGS += /FR
 
288
OS_CXXFLAGS += /FR
 
289
endif
 
290
else
 
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
 
299
ifdef MOZ_PROFILE
 
300
OS_LDFLAGS += /PDB:NONE
 
301
endif
 
302
endif
 
303
 
 
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.
 
306
ifdef MOZ_QUANTIFY
 
307
WIN32_EXE_LDFLAGS=/FIXED:NO
 
308
endif
 
309
 
 
310
# if MOZ_COVERAGE is set, we handle pdb files slightly differently
 
311
ifdef MOZ_COVERAGE
 
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
 
317
endif
 
318
endif
 
319
# MOZ_COVERAGE
 
320
 
 
321
#
 
322
# Handle trace-malloc in optimized builds.
 
323
# No opt to give sane callstacks.
 
324
#
 
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
 
328
endif
 
329
# NS_TRACE_MALLOC
 
330
 
 
331
endif # MOZ_DEBUG
 
332
endif # WINNT && !GNU_CC
 
333
 
 
334
 
 
335
#
 
336
# -ffunction-sections is needed to reorder functions using a GNU ld
 
337
# script.
 
338
#
 
339
ifeq ($(MOZ_REORDER),1)
 
340
  OS_CFLAGS += -ffunction-sections
 
341
  OS_CXXFLAGS += -ffunction-sections
 
342
endif
 
343
 
 
344
#
 
345
# List known meta modules and their dependent libs
 
346
#
 
347
_ALL_META_COMPONENTS=mail crypto
 
348
 
 
349
MOZ_META_COMPONENTS_mail = \
 
350
        IMAP_factory \
 
351
        mime_services \
 
352
        nsMsgNewsModule  \
 
353
        nsImportServiceModule \
 
354
        nsAbModule \
 
355
        nsTextImportModule \
 
356
        nsVCardModule \
 
357
        nsMsgDBModule \
 
358
        nsMsgMdnModule \
 
359
        nsMsgMailViewModule \
 
360
        nsBayesianFilterModule \
 
361
        $(NULL)
 
362
 
 
363
MOZ_META_COMPONENTS_mail_comps = \
 
364
        msgimap \
 
365
        mime \
 
366
        msgnews \
 
367
        import \
 
368
        addrbook \
 
369
        impText \
 
370
        vcard \
 
371
        msgdb \
 
372
        msgmdn \
 
373
        mailview \
 
374
  offline-startup \
 
375
        bayesflt \
 
376
        $(NULL)
 
377
 
 
378
MOZ_META_COMPONENTS_mail_libs = mimecthglue_s
 
379
ifdef USE_SHORT_LIBNAME
 
380
MOZ_META_COMPONENTS_mail_libs += msgbsutl
 
381
else
 
382
MOZ_META_COMPONENTS_mail_libs += msgbaseutil
 
383
endif
 
384
 
 
385
ifeq ($(OS_ARCH),WINNT)
 
386
MOZ_META_COMPONENTS_mail += \
 
387
        nsMsgBaseModule \
 
388
        nsEudoraImportModule \
 
389
        nsOEImport \
 
390
        nsOutlookImport \
 
391
        msgMapiModule \
 
392
        $(NULL)
 
393
MOZ_META_COMPONENTS_mail_comps += \
 
394
        msgbase \
 
395
        impEudra \
 
396
        importOE \
 
397
        impOutlk \
 
398
        msgMapi \
 
399
        $(NULL)
 
400
else
 
401
MOZ_META_COMPONENTS_mail += nsMsgBaseModule
 
402
MOZ_META_COMPONENTS_mail_comps += mailnews
 
403
endif
 
404
 
 
405
MOZ_META_COMPONENTS_mail += \
 
406
        nsMimeEmitterModule \
 
407
        nsMsgComposeModule \
 
408
        local_mail_services \
 
409
        nsComm4xMailImportModule \
 
410
        $(NULL)
 
411
 
 
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
 
416
else
 
417
MOZ_META_COMPONENTS_mail_comps += imp4Mail
 
418
endif
 
419
else
 
420
MOZ_META_COMPONENTS_mail_comps += mimeemitter msgcompose localmail impComm4xMail
 
421
endif
 
422
 
 
423
ifdef MOZ_PSM
 
424
MOZ_META_COMPONENTS_mail += nsMsgSMIMEModule
 
425
MOZ_META_COMPONENTS_mail_comps += msgsmime
 
426
else
 
427
MOZ_META_COMPONENTS_mail +=  nsSMIMEModule
 
428
MOZ_META_COMPONENTS_mail_comps += smimestb
 
429
endif
 
430
 
 
431
MOZ_META_COMPONENTS_crypto = BOOT PKI NSS
 
432
MOZ_META_COMPONENTS_crypto_comps = pipboot pippki pipnss
 
433
 
 
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
 
437
# shared libraries.
 
438
ifdef MOZ_PROFILE_GENERATE
 
439
ifdef BUILD_SHARED_LIBS
 
440
BUILD_SHARED_LIBS=
 
441
BUILD_STATIC_LIBS=1
 
442
MOZ_STATIC_COMPONENT_LIBS=1
 
443
STATIC_BUILD_PIC=1
 
444
endif
 
445
endif
 
446
 
 
447
#
 
448
# Build using PIC by default
 
449
# Do not use PIC if not building a shared lib (see exceptions below)
 
450
#
 
451
#ifeq (,$(PROGRAM)$(SIMPLE_PROGRAMS)$(HOST_PROGRAM)$(HOST_SIMPLE_PROGRAMS))
 
452
ifneq (,$(BUILD_SHARED_LIBS)$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
 
453
_ENABLE_PIC=1
 
454
endif
 
455
#endif
 
456
 
 
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.
 
460
 
 
461
ifdef IS_COMPONENT
 
462
ifneq (,$(MOZ_STATIC_COMPONENT_LIBS)$(findstring $(LIBRARY_NAME), $(MOZ_STATIC_COMPONENTS)))
 
463
ifdef MODULE_NAME
 
464
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
 
465
FORCE_STATIC_LIB=1
 
466
endif
 
467
endif
 
468
endif
 
469
 
 
470
# Determine if module being compiled is destined 
 
471
# to be merged into a meta module in the future
 
472
 
 
473
ifneq (, $(findstring $(META_COMPONENT), $(MOZ_META_COMPONENTS)))
 
474
ifdef IS_COMPONENT
 
475
ifdef MODULE_NAME
 
476
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
 
477
endif
 
478
endif
 
479
EXPORT_LIBRARY=
 
480
FORCE_STATIC_LIB=1
 
481
_ENABLE_PIC=1
 
482
endif
 
483
 
 
484
#
 
485
# Force PIC if we're generating the mozcomps meta module
 
486
#
 
487
 
 
488
ifneq (,$(findstring mozcomps, $(MOZ_META_COMPONENTS)))
 
489
_ENABLE_PIC=1
 
490
endif
 
491
 
 
492
ifdef STATIC_BUILD_PIC
 
493
ifndef _ENABLE_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
 
497
_ENABLE_PIC=1
 
498
endif
 
499
else
 
500
# For static builds, always enable profile generation for non-PIC objects.
 
501
ifndef _ENABLE_PIC
 
502
ENABLE_PROFILE_GENERATE=1
 
503
endif
 
504
endif
 
505
 
 
506
#
 
507
# Disable PIC if necessary
 
508
#
 
509
 
 
510
ifndef _ENABLE_PIC
 
511
DSO_CFLAGS=
 
512
ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
 
513
DSO_PIC_CFLAGS=-mdynamic-no-pic
 
514
else
 
515
DSO_PIC_CFLAGS=
 
516
endif
 
517
 
 
518
MKSHLIB=
 
519
endif
 
520
 
 
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)
 
525
endif
 
526
endif
 
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)
 
533
endif
 
534
 
 
535
 
 
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
 
540
DEFINES += \
 
541
        -D_IMPL_NS_GFX \
 
542
        -D_IMPL_NS_MSG_BASE \
 
543
        -D_IMPL_NS_WIDGET \
 
544
        $(NULL)
 
545
endif
 
546
endif
 
547
 
 
548
 
 
549
#
 
550
# Personal makefile customizations go in these optional make include files.
 
551
#
 
552
MY_CONFIG       := $(DEPTH)/config/myconfig.mk
 
553
MY_RULES        := $(DEPTH)/config/myrules.mk
 
554
 
 
555
#
 
556
# Default command macros; can be overridden in <arch>.mk.
 
557
#
 
558
CCC             = $(CXX)
 
559
NFSPWD          = $(CONFIG_TOOLS)/nfspwd
 
560
PURIFY          = purify $(PURIFYOPTIONS)
 
561
QUANTIFY        = quantify $(QUANTIFYOPTIONS)
 
562
ifdef CROSS_COMPILE
 
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)
 
565
else
 
566
XPIDL_COMPILE   = $(CYGWIN_WRAPPER) $(DIST)/bin/xpidl$(BIN_SUFFIX)
 
567
XPIDL_LINK      = $(CYGWIN_WRAPPER) $(DIST)/bin/xpt_link$(BIN_SUFFIX)
 
568
endif
 
569
 
 
570
REQ_INCLUDES    = $(foreach d,$(REQUIRES),-I$(DIST)/include/$d)
 
571
 
 
572
INCLUDES        = $(LOCAL_INCLUDES) $(REQ_INCLUDES) -I$(PUBLIC) -I$(DIST)/include $(OS_INCLUDES)
 
573
 
 
574
CFLAGS          = $(OS_CFLAGS)
 
575
CXXFLAGS        = $(OS_CXXFLAGS)
 
576
LDFLAGS         = $(OS_LDFLAGS)
 
577
 
 
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
 
581
ifdef MOZ_OPTIMIZE
 
582
ifeq (1,$(MOZ_OPTIMIZE))
 
583
ifdef MODULE_OPTIMIZE_FLAGS
 
584
CFLAGS          += $(MODULE_OPTIMIZE_FLAGS)
 
585
CXXFLAGS        += $(MODULE_OPTIMIZE_FLAGS)
 
586
else
 
587
CFLAGS          += $(MOZ_OPTIMIZE_FLAGS)
 
588
CXXFLAGS        += $(MOZ_OPTIMIZE_FLAGS)
 
589
endif # MODULE_OPTIMIZE_FLAGS
 
590
else
 
591
CFLAGS          += $(MOZ_OPTIMIZE_FLAGS)
 
592
CXXFLAGS        += $(MOZ_OPTIMIZE_FLAGS)
 
593
endif # MOZ_OPTIMIZE == 1
 
594
LDFLAGS         += $(MOZ_OPTIMIZE_LDFLAGS)
 
595
endif # MOZ_OPTIMIZE
 
596
 
 
597
ifdef CROSS_COMPILE
 
598
HOST_CFLAGS     += $(HOST_OPTIMIZE_FLAGS)
 
599
else
 
600
ifdef MOZ_OPTIMIZE
 
601
ifeq (1,$(MOZ_OPTIMIZE))
 
602
ifdef MODULE_OPTIMIZE_FLAGS
 
603
HOST_CFLAGS     += $(MODULE_OPTIMIZE_FLAGS)
 
604
else
 
605
HOST_CFLAGS     += $(MOZ_OPTIMIZE_FLAGS)
 
606
endif # MODULE_OPTIMIZE_FLAGS
 
607
else
 
608
HOST_CFLAGS     += $(MOZ_OPTIMIZE_FLAGS)
 
609
endif # MOZ_OPTIMIZE == 1
 
610
endif # MOZ_OPTIMIZE
 
611
endif # CROSS_COMPILE
 
612
 
 
613
ifeq ($(MOZ_OS2_TOOLS),VACPP)
 
614
ifdef USE_STATIC_LIBS
 
615
RTL_FLAGS += /Gd-
 
616
else # !USE_STATIC_LIBS
 
617
RTL_FLAGS += /Gd+
 
618
endif
 
619
endif
 
620
 
 
621
 
 
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...
 
625
#//
 
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
 
632
 
 
633
else # !USE_STATIC_LIBS
 
634
 
 
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
 
640
 
 
641
else # ! USE_NON_MT_LIBS
 
642
 
 
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
 
647
endif 
 
648
endif # MOZ_DEBUG || NS_TRACE_MALLOC
 
649
endif # USE_NON_MT_LIBS
 
650
endif # USE_STATIC_LIBS
 
651
endif # WINNT && !GNU_CC
 
652
 
 
653
 
 
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)
 
656
 
 
657
#
 
658
# Name of the binary code directories
 
659
#
 
660
# Override defaults
 
661
 
 
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.
 
665
 
 
666
ifneq ($(MOZ_OS2_TOOLS),VACPP)
 
667
ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
 
668
LIBS_DIR        = -L$(DIST)/bin -L$(DIST)/lib
 
669
endif
 
670
endif
 
671
 
 
672
# Default location of include files
 
673
IDL_DIR         = $(DIST)/idl
 
674
ifdef MODULE
 
675
PUBLIC          = $(DIST)/include/$(MODULE)
 
676
else
 
677
PUBLIC          = $(DIST)/include
 
678
endif
 
679
 
 
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
 
684
 
 
685
DEPENDENCIES    = .md
 
686
 
 
687
MOZ_COMPONENT_LIBS=$(MOZ_COMPONENT_XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)
 
688
 
 
689
ifdef GC_LEAK_DETECTOR
 
690
MOZ_COMPONENT_XPCOM_LIBS += -lboehm
 
691
XPCOM_LIBS += -lboehm
 
692
endif
 
693
 
 
694
ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES)))
 
695
DEFINES +=  -DXPCONNECT_STANDALONE
 
696
endif
 
697
 
 
698
ifeq ($(OS_ARCH),OS2)
 
699
ELF_DYNSTR_GC   = echo
 
700
else
 
701
ELF_DYNSTR_GC   = :
 
702
endif
 
703
 
 
704
ifndef CROSS_COMPILE
 
705
ifdef USE_ELF_DYNSTR_GC
 
706
ifdef MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
 
707
ELF_DYNSTR_GC   = $(DIST)/bin/elf-dynstr-gc
 
708
endif
 
709
endif
 
710
endif
 
711
 
 
712
ifeq ($(OS_ARCH),Darwin)
 
713
ifdef USE_PREBINDING
 
714
export LD_PREBIND=1
 
715
export LD_SEG_ADDR_TABLE=$(shell cd $(topsrcdir); pwd)/config/prebind-address-table
 
716
endif
 
717
ifdef MACOS_SDK_DIR
 
718
export NEXT_ROOT=$(MACOS_SDK_DIR)
 
719
endif
 
720
PBBUILD=NEXT_ROOT= $(PBBUILD_BIN)
 
721
endif
 
722
 
 
723
ifdef MOZ_NATIVE_MAKEDEPEND
 
724
MKDEPEND_DIR    =
 
725
MKDEPEND        = $(CYGWIN_WRAPPER) $(MOZ_NATIVE_MAKEDEPEND)
 
726
else
 
727
MKDEPEND_DIR    = $(CONFIG_TOOLS)/mkdepend
 
728
MKDEPEND        = $(CYGWIN_WRAPPER) $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX)
 
729
endif
 
730
 
 
731
# Set link flags according to whether we want a console.
 
732
ifdef MOZ_WINCONSOLE
 
733
ifeq ($(MOZ_WINCONSOLE),1)
 
734
ifeq ($(MOZ_OS2_TOOLS),EMX)
 
735
BIN_FLAGS       += -Zlinker /PM:VIO
 
736
endif
 
737
ifeq ($(OS_ARCH),WINNT)
 
738
ifdef GNU_CC
 
739
WIN32_EXE_LDFLAGS       += -mconsole
 
740
else
 
741
WIN32_EXE_LDFLAGS       += /SUBSYSTEM:CONSOLE
 
742
endif
 
743
endif
 
744
else # MOZ_WINCONSOLE
 
745
ifeq ($(MOZ_OS2_TOOLS),VACPP)
 
746
LDFLAGS += /PM:PM
 
747
endif
 
748
ifeq ($(MOZ_OS2_TOOLS),EMX)
 
749
BIN_FLAGS       += -Zlinker /PM:PM
 
750
endif
 
751
ifeq ($(OS_ARCH),WINNT)
 
752
ifdef GNU_CC
 
753
WIN32_EXE_LDFLAGS       += -mwindows
 
754
else
 
755
WIN32_EXE_LDFLAGS       += /SUBSYSTEM:WINDOWS
 
756
endif
 
757
endif
 
758
endif
 
759
endif
 
760
 
 
761
# Flags needed to link against the component library
 
762
ifdef MOZ_COMPONENTLIB
 
763
MOZ_COMPONENTLIB_EXTRA_DSO_LIBS = mozcomps xpcom_compat
 
764
 
 
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))
 
769
endif
 
770
endif
 
771
endif
 
772
 
 
773
#
 
774
# Include any personal overrides the user might think are needed.
 
775
#
 
776
-include $(MY_CONFIG)
 
777
 
 
778
######################################################################
 
779
# Now test variables that might have been set or overridden by $(MY_CONFIG).
 
780
 
 
781
DEFINES         += -DOSTYPE=\"$(OS_CONFIG)\"
 
782
DEFINES         += -DOSARCH=\"$(OS_ARCH)\"
 
783
 
 
784
# For profiling
 
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)
 
791
endif
 
792
endif
 
793
endif
 
794
endif
 
795
 
 
796
######################################################################
 
797
 
 
798
GARBAGE         += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
 
799
 
 
800
ifeq ($(OS_ARCH),Darwin)
 
801
ifndef NSDISTMODE
 
802
NSDISTMODE=absolute_symlink
 
803
endif
 
804
PWD := $(shell pwd)
 
805
endif
 
806
 
 
807
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
 
808
ifeq ($(OS_ARCH),WINNT)
 
809
NSINSTALL       = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
 
810
else
 
811
NSINSTALL       = $(MOZ_TOOLS_DIR)/nsinstall
 
812
endif
 
813
INSTALL         = $(NSINSTALL)
 
814
else
 
815
NSINSTALL       = $(CONFIG_TOOLS)/nsinstall
 
816
 
 
817
ifeq ($(NSDISTMODE),copy)
 
818
# copy files, but preserve source mtime
 
819
INSTALL         = $(NSINSTALL) -t
 
820
else
 
821
ifeq ($(NSDISTMODE),absolute_symlink)
 
822
# install using absolute symbolic links
 
823
ifeq ($(OS_ARCH),Darwin)
 
824
INSTALL         = $(NSINSTALL) -L $(PWD)
 
825
else
 
826
INSTALL         = $(NSINSTALL) -L `$(NFSPWD)`
 
827
endif
 
828
else
 
829
# install using relative symbolic links
 
830
INSTALL         = $(NSINSTALL) -R
 
831
endif
 
832
endif
 
833
endif # WINNT
 
834
 
 
835
# Use nsinstall in copy mode to install files on the system
 
836
SYSINSTALL      = $(NSINSTALL) -t
 
837
 
 
838
ifeq ($(OS_ARCH),WINNT)
 
839
ifneq (,$(CYGDRIVE_MOUNT))
 
840
export CYGDRIVE_MOUNT
 
841
endif
 
842
endif