~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to config/config.mk

  • Committer: Chris Coulson
  • Date: 2011-08-05 17:37:02 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110805173702-n11ykbt0tdp5u07q
Refresh build system from FIREFOX_6_0b5_BUILD1

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
DEFINES += -DXPI_NAME=$(XPI_NAME)
100
100
endif
101
101
 
102
 
# MAKE_JARS_TARGET is a staging area for make-jars.pl.  When packaging in
103
 
# the jar format, make-jars leaves behind a directory structure that's not
104
 
# needed in $(FINAL_TARGET).  For both, flat, and symlink, the directory
105
 
# structure contains the chrome, so leave it in $(FINAL_TARGET).
106
 
ifeq (jar,$(MOZ_CHROME_FILE_FORMAT))
107
 
MAKE_JARS_TARGET = $(if $(XPI_NAME),$(FINAL_TARGET).stage,$(DIST)/chrome-stage)
108
 
else
109
 
MAKE_JARS_TARGET = $(FINAL_TARGET)
110
 
endif
111
 
 
112
102
# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
113
103
VERSION_NUMBER          = 50
114
104
 
130
120
LD              := $(CC)
131
121
endif
132
122
endif
133
 
ifeq ($(OS_ARCH),BeOS)
134
 
BEOS_ADDON_WORKAROUND   = 1
135
 
endif
136
123
 
137
124
#
138
125
# Strip off the excessively long version numbers on these platforms,
160
147
MOZ_WIDGET_SUPPORT_LIBS    = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
161
148
 
162
149
ifdef MOZ_MEMORY
163
 
ifneq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
 
150
ifneq ($(OS_ARCH),WINNT)
164
151
JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_MOZLIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL)
165
152
# If we are linking jemalloc into a program, we want the jemalloc symbols
166
153
# to be exported
172
159
 
173
160
CC := $(CC_WRAPPER) $(CC)
174
161
CXX := $(CXX_WRAPPER) $(CXX)
 
162
MKDIR ?= mkdir
 
163
SLEEP ?= sleep
 
164
TOUCH ?= touch
175
165
 
176
166
# determine debug-related options
177
167
_DEBUG_CFLAGS :=
219
209
ifdef MOZ_DEBUG_SYMBOLS
220
210
OS_CXXFLAGS += -Zi -UDEBUG -DNDEBUG
221
211
OS_CFLAGS += -Zi -UDEBUG -DNDEBUG
 
212
ifdef HAVE_64BIT_OS
 
213
OS_LDFLAGS += -DEBUG -OPT:REF,ICF
 
214
else
222
215
OS_LDFLAGS += -DEBUG -OPT:REF
223
216
endif
 
217
endif
224
218
 
225
219
ifdef MOZ_QUANTIFY
226
220
# -FIXED:NO is needed for Quantify to work, but it increases the size
239
233
#
240
234
ifdef NS_TRACE_MALLOC
241
235
MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
 
236
ifdef HAVE_64BIT_OS
 
237
OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF,ICF
 
238
else
242
239
OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF
 
240
endif
243
241
endif # NS_TRACE_MALLOC
244
242
 
245
243
endif # MOZ_DEBUG
247
245
 
248
246
#
249
247
# Build using PIC by default
250
 
# Do not use PIC if not building a shared lib (see exceptions below)
251
248
#
252
 
 
253
 
ifndef BUILD_STATIC_LIBS
254
 
_ENABLE_PIC=1
255
 
endif
256
 
ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
257
 
_ENABLE_PIC=1
258
 
endif
259
 
 
260
 
# In Firefox, all components are linked into either libxul or the static
261
 
# meta-component, and should be compiled with PIC.
262
 
ifdef MOZ_META_COMPONENT
263
 
_ENABLE_PIC=1
264
 
endif
265
 
 
266
 
# If module is going to be merged into the nsStaticModule, 
267
 
# make sure that the entry points are translated and 
268
 
# the module is built static.
269
 
 
270
 
ifdef IS_COMPONENT
271
 
ifdef EXPORT_LIBRARY
272
 
ifneq (,$(BUILD_STATIC_LIBS))
273
 
ifdef MODULE_NAME
274
 
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
275
 
FORCE_STATIC_LIB=1
276
 
endif
277
 
endif
278
 
endif
279
 
endif
 
249
_ENABLE_PIC=1
280
250
 
281
251
# Determine if module being compiled is destined 
282
252
# to be merged into libxul
283
253
 
284
 
ifdef MOZ_ENABLE_LIBXUL
285
254
ifdef LIBXUL_LIBRARY
286
255
ifdef IS_COMPONENT
287
256
ifdef MODULE_NAME
291
260
endif
292
261
endif
293
262
FORCE_STATIC_LIB=1
294
 
_ENABLE_PIC=1
295
263
SHORT_LIBNAME=
296
264
endif
297
 
endif
298
265
 
299
266
# If we are building this component into an extension/xulapp, it cannot be
300
267
# statically linked. In the future we may want to add a xulapp meta-component
301
268
# build option.
302
269
 
303
270
ifdef XPI_NAME
304
 
_ENABLE_PIC=1
305
271
ifdef IS_COMPONENT
306
272
EXPORT_LIBRARY=
307
273
FORCE_STATIC_LIB=
309
275
endif
310
276
endif
311
277
 
312
 
#
313
 
# Disable PIC if necessary
314
 
#
315
 
 
316
 
ifndef _ENABLE_PIC
317
 
DSO_CFLAGS=
318
 
ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
319
 
DSO_PIC_CFLAGS=-mdynamic-no-pic
320
 
else
321
 
DSO_PIC_CFLAGS=
322
 
endif
323
 
endif
324
 
 
325
278
ifndef SHARED_LIBRARY_NAME
326
279
ifdef LIBRARY_NAME
327
280
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
334
287
endif
335
288
endif
336
289
 
337
 
ifeq (WINNT,$(OS_ARCH))
338
 
MOZ_FAKELIBS = 1
339
 
endif
340
 
 
341
 
# This comes from configure
342
 
ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE
343
 
NO_PROFILE_GUIDED_OPTIMIZE = 1
344
 
endif
345
 
 
346
290
# No sense in profiling tools
347
291
ifdef INTERNAL_TOOLS
348
292
NO_PROFILE_GUIDED_OPTIMIZE = 1
354
298
NO_PROFILE_GUIDED_OPTIMIZE = 1
355
299
endif
356
300
 
 
301
# No sense in profiling unit tests
 
302
ifdef CPP_UNIT_TESTS
 
303
NO_PROFILE_GUIDED_OPTIMIZE = 1
 
304
endif
 
305
 
357
306
# Enable profile-based feedback
358
307
ifndef NO_PROFILE_GUIDED_OPTIMIZE
359
308
ifdef MOZ_PROFILE_GENERATE
383
332
 
384
333
# Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
385
334
# building libxul libraries
386
 
ifdef MOZ_ENABLE_LIBXUL
387
335
ifdef LIBXUL_LIBRARY
388
336
DEFINES += \
389
337
                -D_IMPL_NS_COM \
400
348
DEFINES += -DSTATIC_EXPORTABLE_JS_API
401
349
endif
402
350
endif
403
 
endif
404
 
 
405
 
# Force _all_ exported methods to be |_declspec(dllexport)| when we're
406
 
# building them into the executable.
407
 
 
408
 
ifeq (,$(filter-out WINNT WINCE OS2, $(OS_ARCH)))
409
 
ifdef BUILD_STATIC_LIBS
410
 
DEFINES += \
411
 
        -D_IMPL_NS_GFX \
412
 
        -D_IMPL_NS_MSG_BASE \
413
 
        -D_IMPL_NS_WIDGET \
414
 
        $(NULL)
415
 
endif
416
 
endif
417
 
 
418
 
# Flags passed to make-jars.pl
419
 
 
 
351
 
 
352
# Flags passed to JarMaker.py
420
353
MAKE_JARS_FLAGS = \
421
354
        -t $(topsrcdir) \
422
355
        -f $(MOZ_CHROME_FILE_FORMAT) \
450
383
# Default command macros; can be overridden in <arch>.mk.
451
384
#
452
385
HAVE_FIREFOX_6  = $(shell test "$(MOZILLA_BRANCH_MAJOR_VERSION)" -ge "6" && echo "1")
453
 
CCC             = $(CXX)
454
 
NFSPWD          = $(CONFIG_TOOLS)/nfspwd
455
 
PURIFY          = purify $(PURIFYOPTIONS)
456
 
QUANTIFY        = quantify $(QUANTIFYOPTIONS)
 
386
CCC = $(CXX)
 
387
NFSPWD = $(CONFIG_TOOLS)/nfspwd
 
388
PURIFY = purify $(PURIFYOPTIONS)
 
389
QUANTIFY = quantify $(QUANTIFYOPTIONS)
457
390
ifdef CROSS_COMPILE
458
 
XPIDL_COMPILE   = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
 
391
XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
459
392
ifneq (1,$(HAVE_FIREFOX_6))
460
393
XPIDL_LINK      = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/host/bin/host_xpt_link$(HOST_BIN_SUFFIX)
461
394
endif
462
395
else
463
 
XPIDL_COMPILE   = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX)
 
396
XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX)
464
397
ifneq (1,$(HAVE_FIREFOX_6))
465
398
XPIDL_LINK      = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/bin/xpt_link$(BIN_SUFFIX)
466
399
endif
467
400
endif
468
401
ifeq (1,$(HAVE_FIREFOX_6))
469
 
XPIDL_LINK      = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
 
402
XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
470
403
endif
471
404
 
472
405
# Java macros
498
431
CFLAGS          += $(MODULE_OPTIMIZE_FLAGS)
499
432
CXXFLAGS        += $(MODULE_OPTIMIZE_FLAGS)
500
433
else
 
434
ifneq (,$(if $(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE),$(MOZ_PGO_OPTIMIZE_FLAGS)))
 
435
CFLAGS          += $(MOZ_PGO_OPTIMIZE_FLAGS)
 
436
CXXFLAGS        += $(MOZ_PGO_OPTIMIZE_FLAGS)
 
437
else
501
438
CFLAGS          += $(MOZ_OPTIMIZE_FLAGS)
502
439
CXXFLAGS        += $(MOZ_OPTIMIZE_FLAGS)
 
440
endif # neq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
503
441
endif # MODULE_OPTIMIZE_FLAGS
504
442
else
505
443
CFLAGS          += $(MOZ_OPTIMIZE_FLAGS)
606
544
# we link statically or dynamic?  Assuming dynamic for now.
607
545
 
608
546
ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
609
 
ifneq (,$(filter-out WINCE,$(OS_ARCH)))
610
547
LIBS_DIR        = -L$(DIST)/bin -L$(DIST)/lib
611
548
ifdef LIBXUL_SDK
612
549
LIBS_DIR        += -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
613
550
endif
614
551
endif
615
 
endif
616
552
 
617
553
# Default location of include files
618
554
IDL_DIR         = $(DIST)/idl
629
565
 
630
566
MOZ_COMPONENT_LIBS=$(XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)
631
567
 
632
 
ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES)))
633
 
DEFINES +=  -DXPCONNECT_STANDALONE
634
 
endif
635
 
 
636
568
ifeq ($(OS_ARCH),OS2)
637
569
ELF_DYNSTR_GC   = echo
638
570
else
683
615
 
684
616
 
685
617
ifdef MOZ_NATIVE_MAKEDEPEND
686
 
MKDEPEND_DIR    =
687
 
MKDEPEND        = $(CYGWIN_WRAPPER) $(MOZ_NATIVE_MAKEDEPEND)
 
618
MKDEPEND_DIR =
 
619
MKDEPEND = $(MOZ_NATIVE_MAKEDEPEND)
688
620
else
689
 
MKDEPEND_DIR    = $(CONFIG_TOOLS)/mkdepend
690
 
MKDEPEND        = $(CYGWIN_WRAPPER) $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX)
 
621
MKDEPEND_DIR = $(CONFIG_TOOLS)/mkdepend
 
622
MKDEPEND = $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX)
691
623
endif
692
624
 
693
625
# Set link flags according to whether we want a console.
741
673
 
742
674
######################################################################
743
675
 
744
 
GARBAGE         += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB $(FAKE_LIBRARY)
 
676
GARBAGE         += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
745
677
 
746
678
ifeq ($(OS_ARCH),Darwin)
747
679
ifndef NSDISTMODE
751
683
endif
752
684
 
753
685
ifdef NSINSTALL_BIN
754
 
NSINSTALL       = $(CYGWIN_WRAPPER) $(NSINSTALL_BIN)
 
686
NSINSTALL = $(NSINSTALL_BIN)
755
687
else
756
688
ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH))
757
 
NSINSTALL       = $(MOZ_TOOLS_DIR)/nsinstall
 
689
NSINSTALL = $(MOZ_TOOLS_DIR)/nsinstall
758
690
else
759
 
NSINSTALL       = $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)
 
691
NSINSTALL = $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)
760
692
endif # OS2
761
693
endif # NSINSTALL_BIN
762
694
 
785
717
# Use nsinstall in copy mode to install files on the system
786
718
SYSINSTALL      = $(NSINSTALL) -t
787
719
 
788
 
ifeq ($(OS_ARCH),WINNT)
789
 
ifneq (,$(CYGDRIVE_MOUNT))
790
 
export CYGDRIVE_MOUNT
791
 
endif
792
 
endif
793
 
 
794
720
#
795
721
# Localization build automation
796
722
#
822
748
endif
823
749
endif
824
750
 
825
 
ifdef WINCE
826
 
RUN_TEST_PROGRAM = $(PYTHON) $(topsrcdir)/build/mobile/devicemanager-run-test.py
 
751
ifdef LOCALE_MERGEDIR
 
752
MERGE_FILE = $(firstword \
 
753
  $(wildcard $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))/$(1)) \
 
754
  $(wildcard $(LOCALE_SRCDIR)/$(1)) \
 
755
  $(srcdir)/en-US/$(1) )
827
756
else
 
757
MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
 
758
endif
 
759
MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
 
760
 
828
761
ifeq (OS2,$(OS_ARCH))
829
762
RUN_TEST_PROGRAM = $(topsrcdir)/build/os2/test_os2.cmd "$(DIST)"
830
763
else
832
765
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
833
766
endif # ! WINNT
834
767
endif # ! OS2
835
 
endif # ! WINCE
836
768
 
837
769
#
838
770
# Java macros
851
783
endif
852
784
 
853
785
OPTIMIZE_JARS_CMD = $(PYTHON) $(call core_abspath,$(topsrcdir)/config/optimizejars.py)
 
786
 
 
787
CREATE_PRECOMPLETE_CMD = $(PYTHON) $(call core_abspath,$(topsrcdir)/config/createprecomplete.py)
 
788
 
 
789
EXPAND_LIBS = $(PYTHON) -I$(DEPTH)/config $(topsrcdir)/config/expandlibs.py
 
790
EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/pythonpath.py -I$(DEPTH)/config $(topsrcdir)/config/expandlibs_exec.py
 
791
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/pythonpath.py -I$(DEPTH)/config $(topsrcdir)/config/expandlibs_gen.py
 
792
EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
 
793
EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
 
794
EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)
 
795
EXPAND_LD = $(EXPAND_LIBS_EXEC) --uselist -- $(LD)
 
796
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) --uselist -- $(MKSHLIB)
 
797
 
 
798
ifdef STDCXX_COMPAT
 
799
CHECK_STDCXX = objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo "TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:" && objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && exit 1 || exit 0
 
800
endif