~mozillateam/firefox/firefox.disco

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Chris Coulson
  • Date: 2011-05-18 22:33:33 UTC
  • mto: This revision was merged to the branch mainline in revision 849.
  • Revision ID: chrisccoulson@ubuntu.com-20110518223333-l586sfqthhcyl1gb
Some cleaning up of variables passed to the preprocessor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
 
3
 
DEBIAN_APP_NAME         := firefox
 
3
MOZ_APP_BASENAME        := firefox
4
4
CHANNEL                 := beta
5
5
MOZ_MOZDIR              :=
6
6
 
7
7
# Various build options
8
8
# 1 = Use bundled libs
9
 
DEB_MIN_SYSDEPS         ?= 1
 
9
MOZ_MIN_SYSDEPS         ?= 1
10
10
# 1 = Enable crashreporter (if supported)
11
 
DEB_ENABLE_BREAKPAD     ?= 1
 
11
MOZ_ENABLE_BREAKPAD     ?= 1
12
12
# 1 = Disable official branding and crash reporter (the crash reporter builds but is not enabled in application.ini)
13
 
DEB_BUILD_UNOFFICIAL    ?= 0
 
13
MOZ_BUILD_UNOFFICIAL    ?= 0
14
14
# 1 = Build without jemalloc suitable for valgrind debugging
15
 
DEB_MOZ_VALGRIND        ?= 0
 
15
MOZ_VALGRIND            ?= 0
16
16
# 1 = Profile guided build
17
 
DEB_BUILD_PGO           ?= 0
 
17
MOZ_BUILD_PGO           ?= 0
18
18
# 1 = Build and run the testsuite
19
 
DEB_WANT_UNIT_TESTS     ?= 1
 
19
MOZ_WANT_UNIT_TESTS     ?= 1
20
20
# 1 = Turn on debugging bits and disable optimizations
21
 
DEB_DEBUG               ?= 0
 
21
MOZ_DEBUG               ?= 0
22
22
# 1 = Disable optimizations
23
 
DEB_NO_OPTIMIZE         ?= 0
 
23
MOZ_NO_OPTIMIZE         ?= 0
24
24
 
25
25
# These are used for cross-compiling and for saving the configure script
26
26
# from having to guess our platform (since we know it already)
30
30
DEB_HOST_GNU_CPU                ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
31
31
# Other things which should be defined before including the CDBS rules
32
32
DEB_TAR_SRCDIR                  := mozilla
33
 
DEB_DH_STRIP_ARGS               = --dbg-package=$(DEBIAN_NAME)-dbg
 
33
DEB_DH_STRIP_ARGS               = --dbg-package=$(MOZ_APP_NAME)-dbg
34
34
# We don't want build-tree/mozilla/README to be shipped as a doc
35
35
DEB_INSTALL_DOCS_ALL            := $(NULL)
36
36
# Needed for mozclient
37
 
MOZCLIENT_PROJECTNAME           := $(DEBIAN_APP_NAME)
 
37
MOZCLIENT_PROJECTNAME           := $(MOZ_APP_BASENAME)
38
38
MOZCLIENT_PROJECTDIR            := $(CURDIR)/debian/mozclient
39
39
 
40
40
ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
41
 
        DEB_WANT_UNIT_TESTS=0
 
41
        MOZ_WANT_UNIT_TESTS=0
42
42
endif
43
43
 
44
44
include /usr/share/cdbs/1/rules/tarball.mk
45
45
include /usr/share/cdbs/1/rules/debhelper.mk
46
46
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
47
47
include /usr/share/cdbs/1/class/makefile.mk
48
 
include $(CURDIR)/debian/mozclient/$(DEBIAN_APP_NAME).mk
 
48
include $(CURDIR)/debian/mozclient/$(MOZ_APP_BASENAME).mk
49
49
 
50
50
MOZ_OBJDIR              := $(DEB_BUILDDIR)$(MOZ_MOZDIR)/objdir-$(DEB_BUILD_GNU_TYPE)
51
51
MOZ_DISTDIR             := $(MOZ_OBJDIR)$(MOZ_MOZDIR)/dist
52
52
 
53
 
ifeq (1,$(DEB_MOZ_VALGRIND))
54
 
        DEB_BUILD_UNOFFICIAL = 1
 
53
ifeq (1,$(MOZ_VALGRIND))
 
54
        MOZ_BUILD_UNOFFICIAL = 1
55
55
endif
56
56
 
57
57
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
58
 
        DEB_BUILD_PGO = 0
59
 
        DEB_NO_OPTIMIZE = 1
 
58
        MOZ_BUILD_PGO = 0
 
59
        MOZ_NO_OPTIMIZE = 1
60
60
endif
61
61
 
62
62
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
63
 
        DEB_NO_OPTIMIZE = 1
64
 
        DEB_DEBUG = 1
65
 
        DEB_BUILD_UNOFFICIAL = 1
 
63
        MOZ_NO_OPTIMIZE = 1
 
64
        MOZ_DEBUG = 1
 
65
        MOZ_BUILD_UNOFFICIAL = 1
66
66
endif
67
67
 
68
 
ifeq (1, $(DEB_BUILD_PGO))
 
68
ifeq (1, $(MOZ_BUILD_PGO))
69
69
        # See https://bugzilla.mozilla.org/show_bug.cgi?id=602245
70
 
        DEB_WANT_UNIT_TESTS = 0
 
70
        MOZ_WANT_UNIT_TESTS = 0
71
71
        # We don't really want the crash reporter on for PGO builds yet
72
 
        DEB_ENABLE_BREAKPAD = 0
73
 
        DEB_BUILD_UNOFFICIAL = 1
 
72
        MOZ_ENABLE_BREAKPAD = 0
 
73
        MOZ_BUILD_UNOFFICIAL = 1
74
74
endif
75
75
 
76
76
include $(CURDIR)/debian/testsuite.mk
77
77
 
78
78
# Define other variables used throughout the build
79
 
DEBIAN_NAME             := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')
80
 
DEBIAN_APP_NAME_VER     := $(shell echo $(DEBIAN_NAME) | sed -e 's/$(DEBIAN_APP_NAME)-*//g' )
81
 
ifeq ($(DEBIAN_NAME),$(DEBIAN_APP_NAME_VER))
 
79
MOZ_APP_NAME            := $(shell dpkg-parsechangelog | sed -n 's/^Source: *\(.*\)$$/\1/ p')
 
80
DEBIAN_APP_NAME_VER     := $(shell echo $(MOZ_APP_NAME) | sed -e 's/$(MOZ_APP_BASENAME)-*//g' )
 
81
ifeq ($(MOZ_APP_NAME),$(DEBIAN_APP_NAME_VER))
82
82
        DEBIAN_APP_NAME_VER     :=
83
83
endif
84
84
 
89
89
 
90
90
# These normally come from autotools.mk, which we no longer include (because we
91
91
# don't want to run configure)
92
 
ifeq (1, $(DEB_BUILD_PGO))
 
92
ifeq (1, $(MOZ_BUILD_PGO))
93
93
        DEB_MAKE_BUILD_TARGET   := profiledbuild
94
94
endif
95
95
DEB_MAKE_INSTALL_TARGET         := install DESTDIR=$(CURDIR)/debian/tmp
96
96
DEB_MAKE_CLEAN_TARGET           := distclean
97
 
DEB_CONFIGURE_LOCALSTATEDIR     := /var
98
97
 
99
98
DEBIAN_VERSION                  := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
100
 
FF_VERSION                      = $(shell cat $(DEB_BUILDDIR)/browser/config/version.txt)
101
 
FF_PREFIX                       := /usr
102
 
FF_LIBDIR                       = $(FF_PREFIX)/lib/$(DEBIAN_NAME)-$(FF_VERSION)
103
 
FF_INCDIR                       = $(FF_PREFIX)/include/$(DEBIAN_NAME)-$(FF_VERSION)
104
 
FF_IDLDIR                       = $(FF_PREFIX)/share/idl/$(DEBIAN_NAME)-$(FF_VERSION)
105
 
FF_SDKDIR                       = $(FF_PREFIX)/lib/$(DEBIAN_NAME)-devel-$(FF_VERSION)
106
 
FF_VERSION_DEVMILESTONE         = $(shell echo $(FF_VERSION) | grep [ab] | sed -e 's/pre//; s/.*[ab]//')
107
 
FF_VERSION_SERIES               = $(shell echo $(FF_VERSION) | sed -e 's/pre//; s/[ab].*//' | cut -d '.' -f 1,2)
 
99
MOZ_VERSION                     = $(shell cat $(DEB_BUILDDIR)/browser/config/version.txt)
 
100
MOZ_PREFIX                      := /usr
 
101
MOZ_LIBDIR                      = $(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-$(MOZ_VERSION)
 
102
MOZ_INCDIR                      = $(MOZ_PREFIX)/include/$(MOZ_APP_NAME)-$(MOZ_VERSION)
 
103
MOZ_IDLDIR                      = $(MOZ_PREFIX)/share/idl/$(MOZ_APP_NAME)-$(MOZ_VERSION)
 
104
MOZ_SDKDIR                      = $(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-devel-$(MOZ_VERSION)
 
105
MOZ_SERIES                      = $(shell echo $(MOZ_VERSION) | sed -e 's/pre//; s/[ab].*//' | cut -d '.' -f 1,2)
108
106
 
109
107
NSPR_DEPENDS    := $(NULL)
110
108
NSS_DEPENDS     := $(NULL)
112
110
DEB_DH_GENCONTROL_ARGS  = -- -Vnspr:Depends=$(NSPR_DEPENDS) -Vnss:Depends=$(NSS_DEPENDS) -Vcairo:Depends=$(CAIRO_DEPENDS)
113
111
DEB_AUTO_UPDATE_DEBIAN_CONTROL  = no
114
112
 
115
 
PYTHON                  := $(shell which python)
 
113
MOZ_PYTHON              := $(shell which python)
116
114
DISTRIB                 := $(shell lsb_release -i -s)
117
115
 
118
116
ifneq (,$(filter $(DISTRIB),Ubuntu))
120
118
        DISTRIB_VERSION_MINOR := $(shell lsb_release -s -r | cut -d '.' -f 2)
121
119
endif
122
120
 
123
 
ifneq ($(DEBIAN_NAME),$(DEBIAN_APP_NAME))
 
121
ifneq ($(MOZ_APP_NAME),$(MOZ_APP_BASENAME))
124
122
        # We don't want to make builds which change MOZ_APP_NAME official
125
 
        DEB_BUILD_UNOFFICIAL = 1
 
123
        MOZ_BUILD_UNOFFICIAL = 1
126
124
endif
127
125
 
128
126
# enable the crash reporter only on i386, amd64 and armel
129
 
ifeq (,$(findstring i386,$(DEB_BUILD_ARCH)))
130
 
ifeq (,$(findstring amd64,$(DEB_BUILD_ARCH)))
131
 
ifeq (,$(findstring armel,$(DEB_BUILD_ARCH)))
132
 
        DEB_ENABLE_BREAKPAD     = 0
133
 
endif
134
 
endif
 
127
ifeq (,$(filter i386 amd64 armel,$(DEB_BUILD_ARCH)))
 
128
        MOZ_ENABLE_BREAKPAD = 0
135
129
endif
136
130
 
137
131
VENDORPREF_DIST = $(CURDIR)/$(MOZ_DISTDIR)/bin/defaults/pref/distrib.js
140
134
ifneq (,$(filter default beta, $(BRANDING)))
141
135
        BRANDING = official
142
136
endif
143
 
ifeq (1,$(DEB_BUILD_UNOFFICIAL))
 
137
ifeq (1,$(MOZ_BUILD_UNOFFICIAL))
144
138
ifneq (,$(filter official aurora, $(BRANDING)))
145
139
        BRANDING = unofficial
146
140
endif
147
141
endif
148
142
ifeq (official,$(BRANDING))
149
143
        BRANDING_DIR = other-licenses/branding/firefox
150
 
        BRANDING_OPTION = --enable-official-branding
 
144
        MOZ_BRANDING_OPTION     = --enable-official-branding
151
145
else
152
146
        BRANDING_DIR    = browser/branding/$(BRANDING)
153
 
        BRANDING_OPTION = --with-branding=$(BRANDING_DIR)
 
147
        MOZ_BRANDING_OPTION = --with-branding=$(BRANDING_DIR)
154
148
endif
155
 
DISPLAY_NAME    = $(shell cat $(DEB_BUILDDIR)/$(BRANDING_DIR)/locales/en-US/brand.properties \
156
 
                    | grep brandShortName | sed -e 's/brandShortName\=//')
 
149
MOZ_DISPLAY_NAME        = $(shell cat $(DEB_BUILDDIR)/$(BRANDING_DIR)/locales/en-US/brand.properties \
 
150
                            | grep brandShortName | sed -e 's/brandShortName\=//')
157
151
 
158
152
ifeq (nightly,$(CHANNEL))
159
153
ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -lt "1104" && echo "1"))
160
154
        # Disable crashreporter on nightly builds older than Natty
161
 
        DEB_ENABLE_BREAKPAD = 0
 
155
        MOZ_ENABLE_BREAKPAD = 0
162
156
endif
163
157
endif
164
158
 
169
163
export LDFLAGS
170
164
export DEB_BUILD_HARDENING=1
171
165
ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1104" && echo "1"))
172
 
        ENABLE_GLOBALMENU := 1
 
166
        MOZ_ENABLE_GLOBALMENU := 1
173
167
endif
174
168
ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1010" && echo "1"))
175
 
        SYSTEM_DICTDIR = /usr/share/hunspell
 
169
        MOZ_SYSTEM_DICTDIR = /usr/share/hunspell
176
170
else
177
 
        SYSTEM_DICTDIR = /usr/share/myspell/dicts
 
171
        MOZ_SYSTEM_DICTDIR = /usr/share/myspell/dicts
178
172
endif
179
173
export MOZCONFIG=$(CURDIR)/debian/mozconfig
180
 
ifneq (1,$(DEB_BUILD_UNOFFICIAL))
 
174
ifneq (1,$(MOZ_BUILD_UNOFFICIAL))
181
175
        export BUILD_OFFICIAL=1
182
176
endif
183
 
ifeq (1,$(DEB_ENABLE_BREAKPAD))
 
177
ifeq (1,$(MOZ_ENABLE_BREAKPAD))
184
178
        # Needed to enable crashreported in application.ini
185
179
        export MOZILLA_OFFICIAL=1
186
180
endif
187
 
ifeq (1,$(DEB_BUILD_PGO))
 
181
ifeq (1,$(MOZ_BUILD_PGO))
188
182
        CC      = $(shell which gcc-4.5)
189
183
        CXX     = $(shell which g++-4.5)
190
184
        export CC
191
185
        export CXX
192
186
endif
193
187
 
194
 
ifneq (1, $(DEB_MIN_SYSDEPS))
195
 
ifneq (1, $(DEB_DEBUG))
196
 
        USE_SYSTEM_NSPR := $(shell pkg-config --exists 'nspr >= 4.8.7'; a=$$?; if test $$a != 1; then echo 1; fi)
197
 
        USE_SYSTEM_CAIRO := $(shell pkg-config --exists 'cairo >= 1.8.8'; a=$$?; if test $$a != 1; then echo 1; fi)
198
 
        USE_SYSTEM_SQLITE :=  $(shell pkg-config --exists 'sqlite3 >= 3.7.1'; a=$$?; if test $$a != 1; then echo 1; fi)
199
 
        USE_SYSTEM_NSS := $(shell pkg-config --exists 'nss >= 3.12.9'; a=$$?; if test $$a != 1; then echo 1; fi)
200
 
        USE_SYSTEM_HUNSPELL := $(shell pkg-config --exists 'hunspell >= 1.2' && echo 1)
201
 
ifeq (1, $(USE_SYSTEM_CAIRO))
202
 
        USE_SYSTEM_CAIRO := $(shell printf "\#include <cairo-tee.h>\nint main(int argc, char *argv[]) { return 0; }" > test.c && \
 
188
ifneq (1, $(MOZ_MIN_SYSDEPS))
 
189
ifneq (1, $(MOZ_DEBUG))
 
190
        MOZ_USE_SYSTEM_NSPR := $(shell pkg-config --exists 'nspr >= 4.8.7'; a=$$?; if test $$a != 1; then echo 1; fi)
 
191
        MOZ_USE_SYSTEM_CAIRO := $(shell pkg-config --exists 'cairo >= 1.8.8'; a=$$?; if test $$a != 1; then echo 1; fi)
 
192
        MOZ_USE_SYSTEM_SQLITE :=  $(shell pkg-config --exists 'sqlite3 >= 3.7.1'; a=$$?; if test $$a != 1; then echo 1; fi)
 
193
        MOZ_USE_SYSTEM_NSS := $(shell pkg-config --exists 'nss >= 3.12.9'; a=$$?; if test $$a != 1; then echo 1; fi)
 
194
        MOZ_USE_SYSTEM_HUNSPELL := $(shell pkg-config --exists 'hunspell >= 1.2' && echo 1)
 
195
ifeq (1, $(MOZ_USE_SYSTEM_CAIRO))
 
196
        MOZ_USE_SYSTEM_CAIRO := $(shell printf "\#include <cairo-tee.h>\nint main(int argc, char *argv[]) { return 0; }" > test.c && \
203
197
                              gcc `pkg-config --cflags --libs cairo` -lc -o test test.c > /dev/null 2>&1 && echo "1"; rm -f test test.c)
204
198
endif
205
199
endif
206
200
endif
207
201
 
208
202
# Defines used for the Mozilla text preprocessor
209
 
DEB_DEFINES =   -DLIBDIR="$(FF_LIBDIR)" -DAPPNAME="$(DEBIAN_NAME)" -DSERIES="$(FF_VERSION_SERIES)" -DAPPBASENAME="$(DEBIAN_APP_NAME)"\
210
 
                -DINCDIR="$(FF_INCDIR)" -DIDLDIR="$(FF_IDLDIR)" -DFF_VERSION="$(FF_VERSION)" -DDEB_BUILD_ARCH="$(DEB_BUILD_ARCH)" \
211
 
                -DDISPLAY_NAME="$(DISPLAY_NAME)" -DFF_VERSION_DEVMILESTONE="$(FF_VERSION_DEVMILESTONE)" \
212
 
                -DDEBIAN_XUL_DEV="$(DEBIAN_XUL_DEV)" -DBRANDING_OPTION="$(BRANDING_OPTION)" -DTOPSRCDIR="$(CURDIR)" -DDEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
213
 
                -DFF_PREFIX="$(FF_PREFIX)" -DDEB_CONFIGURE_LOCALSTATEDIR="$(DEB_CONFIGURE_LOCALSTATEDIR)" -DSDKDIR="$(FF_SDKDIR)" -DMOZ_DISTDIR="$(MOZ_DISTDIR)" \
214
 
                -DMOZ_OBJDIR="$(MOZ_OBJDIR)" -DDEB_BUILDDIR="$(DEB_BUILDDIR)" -DPYTHON="$(PYTHON)" -DMOZ_PROFILE_FOLDER=".mozilla/$(DEBIAN_NAME)" -DSYSTEM_DICTDIR="$(SYSTEM_DICTDIR)"
215
 
ifeq (1, $(DEB_MIN_SYSDEPS))
216
 
        DEB_DEFINES += -DDEB_MIN_SYSDEPS
217
 
endif
218
 
ifeq (1, $(DEB_ENABLE_BREAKPAD))
219
 
        DEB_DEFINES += -DDEB_ENABLE_BREAKPAD
220
 
endif
221
 
ifeq (1, $(DEB_MOZ_VALGRIND))
222
 
        DEB_DEFINES += -DDEB_MOZ_VALGRIND
223
 
endif
224
 
ifeq (1,$(DEB_NO_OPTIMIZE))
225
 
        DEB_DEFINES += -DDEB_NO_OPTIMIZE
226
 
endif
227
 
ifeq (1, $(USE_SYSTEM_NSPR))
228
 
        DEB_DEFINES += -DUSE_SYSTEM_NSPR
 
203
DEB_DEFINES =   -DMOZ_LIBDIR="$(MOZ_LIBDIR)" -DMOZ_APP_NAME="$(MOZ_APP_NAME)" -DMOZ_SERIES="$(MOZ_SERIES)" -DMOZ_APP_BASENAME="$(MOZ_APP_BASENAME)"\
 
204
                -DMOZ_INCDIR="$(MOZ_INCDIR)" -DMOZ_IDLDIR="$(MOZ_IDLDIR)" -DMOZ_VERSION="$(MOZ_VERSION)" -DDEB_BUILD_ARCH="$(DEB_BUILD_ARCH)" \
 
205
                -DMOZ_DISPLAY_NAME="$(MOZ_DISPLAY_NAME)" -DMOZ_SYSTEM_DICTDIR="$(MOZ_SYSTEM_DICTDIR)" \
 
206
                -DMOZ_BRANDING_OPTION="$(MOZ_BRANDING_OPTION)" -DTOPSRCDIR="$(CURDIR)" -DDEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
 
207
                -DMOZ_PREFIX="$(MOZ_PREFIX)" -DMOZ_SDKDIR="$(MOZ_SDKDIR)" -DMOZ_DISTDIR="$(MOZ_DISTDIR)" \
 
208
                -DMOZ_OBJDIR="$(MOZ_OBJDIR)" -DDEB_BUILDDIR="$(DEB_BUILDDIR)" -DMOZ_PYTHON="$(MOZ_PYTHON)" -DMOZ_PROFILE_FOLDER=".mozilla/$(MOZ_APP_NAME)"
 
209
ifeq (1, $(MOZ_MIN_SYSDEPS))
 
210
        DEB_DEFINES += -DMOZ_MIN_SYSDEPS
 
211
endif
 
212
ifeq (1, $(MOZ_ENABLE_BREAKPAD))
 
213
        DEB_DEFINES += -DMOZ_ENABLE_BREAKPAD
 
214
endif
 
215
ifeq (1, $(MOZ_VALGRIND))
 
216
        DEB_DEFINES += -DMOZ_VALGRIND
 
217
endif
 
218
ifeq (1,$(MOZ_NO_OPTIMIZE))
 
219
        DEB_DEFINES += -DMOZ_NO_OPTIMIZE
 
220
endif
 
221
ifeq (1, $(MOZ_USE_SYSTEM_NSPR))
 
222
        DEB_DEFINES += -DMOZ_USE_SYSTEM_NSPR
229
223
        NSPR_DEPENDS = libnspr4-dev
230
224
endif
231
 
ifeq (1, $(USE_SYSTEM_CAIRO))
232
 
        DEB_DEFINES += -DUSE_SYSTEM_CAIRO
 
225
ifeq (1, $(MOZ_USE_SYSTEM_CAIRO))
 
226
        DEB_DEFINES += -DMOZ_USE_SYSTEM_CAIRO
233
227
        CAIRO_DEPENDS = libcairo2-dev
234
228
endif
235
 
ifeq (1, $(USE_SYSTEM_SQLITE))
236
 
        DEB_DEFINES += -DUSE_SYSTEM_SQLITE
 
229
ifeq (1, $(MOZ_USE_SYSTEM_SQLITE))
 
230
        DEB_DEFINES += -DMOZ_USE_SYSTEM_SQLITE
237
231
endif
238
 
ifeq (1, $(USE_SYSTEM_NSS))
239
 
        DEB_DEFINES += -DUSE_SYSTEM_NSS
 
232
ifeq (1, $(MOZ_USE_SYSTEM_NSS))
 
233
        DEB_DEFINES += -DMOZ_USE_SYSTEM_NSS
240
234
        NSS_DEPENDS = libnss3-dev
241
235
endif
242
 
ifeq (1,$(USE_SYSTEM_HUNSPELL))
243
 
        DEB_DEFINES += -DUSE_SYSTEM_HUNSPELL
 
236
ifeq (1,$(MOZ_USE_SYSTEM_HUNSPELL))
 
237
        DEB_DEFINES += -DMOZ_USE_SYSTEM_HUNSPELL
244
238
endif
245
 
ifeq (1,$(DEB_WANT_UNIT_TESTS))
246
 
        DEB_DEFINES += -DDEB_WANT_UNIT_TESTS
 
239
ifeq (1,$(MOZ_WANT_UNIT_TESTS))
 
240
        DEB_DEFINES += -DMOZ_WANT_UNIT_TESTS
247
241
endif
248
242
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
249
243
        DEB_DEFINES += -DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)"
250
244
endif
251
 
ifeq (1,$(DEB_BUILD_PGO))
252
 
        DEB_DEFINES += -DDEB_BUILD_PGO
 
245
ifeq (1,$(MOZ_BUILD_PGO))
 
246
        DEB_DEFINES += -DMOZ_BUILD_PGO
253
247
endif
254
248
ifeq (1,$(shell test "$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)" -ge "1104" && echo "1"))
255
 
        DEB_DEFINES += -DDISABLE_GNOMEVFS
256
 
        DEB_DEFINES += -DDISABLE_CONTROL_CENTER
 
249
        DEB_DEFINES += -DMOZ_DISABLE_GNOMEVFS
 
250
        DEB_DEFINES += -DMOZ_DISABLE_CONTROL_CENTER
257
251
endif
258
252
ifneq (default,$(CHANNEL))
259
253
        DEB_DEFINES += -DMOZ_UPDATE_CHANNEL="$(CHANNEL)"
260
254
endif
261
 
ifeq (1,$(DEB_DEBUG))
262
 
        DEB_DEFINES += -DDEBUG
 
255
ifeq (1,$(MOZ_DEBUG))
 
256
        DEB_DEFINES += -DMOZ_DEBUG
263
257
endif
264
258
ifneq (,$(findstring armel,$(DEB_BUILD_ARCH)))
265
259
        DEB_DEFINES += -DDEB_ENABLE_THUMB2
266
260
endif
267
 
ifeq (,$(findstring i386,$(DEB_BUILD_ARCH)))
268
 
ifeq (,$(findstring amd64,$(DEB_BUILD_ARCH)))
269
 
ifeq (,$(findstring armel,$(DEB_BUILD_ARCH)))
270
 
        DEB_DEFINES += -DDISABLE_ELF_HACK
271
 
endif
272
 
endif
273
 
endif
274
 
ifeq (1,$(ENABLE_GLOBALMENU))
275
 
        DEB_DEFINES += -DENABLE_GLOBALMENU
 
261
ifeq (,$(filter i386 amd64 armel,$(DEB_BUILD_ARCH)))
 
262
        DEB_DEFINES += -DMOZ_DISABLE_ELF_HACK
 
263
endif
 
264
ifeq (1,$(MOZ_ENABLE_GLOBALMENU))
 
265
        DEB_DEFINES += -DMOZ_ENABLE_GLOBALMENU
276
266
endif
277
267
ifeq (official, $(BRANDING))
278
 
        DEB_DEFINES += -DOFFICIAL_BRANDING
 
268
        DEB_DEFINES += -DMOZ_OFFICIAL_BRANDING
279
269
endif
280
270
 
281
271
DEBIAN_EXECUTABLES = \
282
 
        $(DEBIAN_NAME)$(FF_LIBDIR)/firefox.sh \
283
 
        $(DEBIAN_NAME)$(FF_LIBDIR)/xulapp-profilemigrator \
 
272
        $(MOZ_APP_NAME)$(MOZ_LIBDIR)/firefox.sh \
 
273
        $(MOZ_APP_NAME)$(MOZ_LIBDIR)/xulapp-profilemigrator \
284
274
        $(NULL)
285
275
 
286
276
subst_files = \
287
 
        debian/usr.bin.$(DEBIAN_NAME) \
 
277
        debian/usr.bin.$(MOZ_APP_NAME) \
288
278
        debian/README.Debian \
289
279
        debian/firefox.sh \
290
 
        debian/apport/$(DEBIAN_NAME) \
291
 
        debian/apport/$(DEBIAN_NAME).py \
292
 
        debian/$(DEBIAN_NAME).desktop \
293
 
        debian/$(DEBIAN_NAME).xml \
294
 
        debian/$(DEBIAN_NAME)-gnome-support.install \
295
 
        debian/$(DEBIAN_NAME).dirs \
296
 
        debian/$(DEBIAN_NAME).install \
297
 
        debian/$(DEBIAN_NAME).links \
298
 
        debian/$(DEBIAN_NAME).manpages \
299
 
        debian/$(DEBIAN_NAME).menu \
300
 
        debian/$(DEBIAN_NAME).postinst \
301
 
        debian/$(DEBIAN_NAME).postrm \
302
 
        debian/$(DEBIAN_NAME).preinst \
303
 
        debian/$(DEBIAN_NAME).prerm \
304
 
        debian/$(DEBIAN_NAME).1 \
305
 
        debian/$(DEBIAN_NAME)-mozsymbols.install \
306
 
        debian/$(DEBIAN_NAME)-dev.install \
307
 
        debian/$(DEBIAN_NAME)-dev.links \
308
 
        debian/$(DEBIAN_NAME).lintian-overrides \
309
 
        debian/$(DEBIAN_NAME)-globalmenu.dirs \
 
280
        debian/apport/$(MOZ_APP_NAME) \
 
281
        debian/apport/$(MOZ_APP_NAME).py \
 
282
        debian/$(MOZ_APP_NAME).desktop \
 
283
        debian/$(MOZ_APP_NAME).xml \
 
284
        debian/$(MOZ_APP_NAME)-gnome-support.install \
 
285
        debian/$(MOZ_APP_NAME).dirs \
 
286
        debian/$(MOZ_APP_NAME).install \
 
287
        debian/$(MOZ_APP_NAME).links \
 
288
        debian/$(MOZ_APP_NAME).manpages \
 
289
        debian/$(MOZ_APP_NAME).menu \
 
290
        debian/$(MOZ_APP_NAME).postinst \
 
291
        debian/$(MOZ_APP_NAME).postrm \
 
292
        debian/$(MOZ_APP_NAME).preinst \
 
293
        debian/$(MOZ_APP_NAME).prerm \
 
294
        debian/$(MOZ_APP_NAME).1 \
 
295
        debian/$(MOZ_APP_NAME)-mozsymbols.install \
 
296
        debian/$(MOZ_APP_NAME)-dev.install \
 
297
        debian/$(MOZ_APP_NAME)-dev.links \
 
298
        debian/$(MOZ_APP_NAME).lintian-overrides \
 
299
        debian/$(MOZ_APP_NAME)-globalmenu.dirs \
310
300
        debian/pkgconfig/mozilla-plugin.pc \
311
301
        debian/pkgconfig/libxul.pc \
312
302
        debian/pkgconfig/mozilla-nspr.pc \
313
303
        debian/mozconfig \
314
304
        $(NULL)
315
305
 
316
 
ifneq (1, $(DEB_MIN_SYSDEPS))
 
306
ifneq (1, $(MOZ_MIN_SYSDEPS))
317
307
EXTRA_BD = \n\tlibnspr4-dev,\n\tlibnss3-dev,\n\tlibcairo2-dev,\n\tlibsqlite3-dev,\n\tlibpixman-1-dev,\n\tlibjpeg62-dev,\n\tlibpng12-dev,\n\tzlib1g-dev,\n\tlibhunspell-dev,
318
308
else
319
309
EXTRA_BD = $(NULL)
322
312
debian/control:: debian/control.in debian/control.langpacks debian/locales.shipped
323
313
        mv debian/control debian/control.old
324
314
        sed -e 's/@EXTRA_BD@/$(EXTRA_BD)/g' \
325
 
            -e 's/@APPNAME@/$(DEBIAN_NAME)/g' < debian/control.in > debian/control
 
315
            -e 's/@MOZ_APP_NAME@/$(MOZ_APP_NAME)/g' < debian/control.in > debian/control
326
316
 
327
317
        while read line ; \
328
318
        do \
337
327
                        then \
338
328
                                sed -e "s/@LANGCODE@/$$language/g" \
339
329
                                    -e "s/@LANG@/$$desc/g" \
340
 
                                    -e 's/@APPNAME@/$(DEBIAN_NAME)/g' < debian/control.langpacks >> debian/control ; \
 
330
                                    -e 's/@MOZ_APP_NAME@/$(MOZ_APP_NAME)/g' < debian/control.langpacks >> debian/control ; \
341
331
                                eval $$tmp=1 ; \
342
332
                        fi \
343
333
                fi \
348
338
                while read line ; \
349
339
                do \
350
340
                        sed -e "s/@LANGCODE@/$$line/g" \
351
 
                            -e 's/@APPNAME@/$(DEBIAN_NAME)/g' < debian/control.langpacks.unavail >> debian/control ; \
 
341
                            -e 's/@MOZ_APP_NAME@/$(MOZ_APP_NAME)/g' < debian/control.langpacks.unavail >> debian/control ; \
352
342
                done < debian/locales.unavailable ; \
353
343
        fi
354
344
 
365
355
        BRANCH = -$(DEBIAN_APP_NAME_VER)
366
356
endif
367
357
$(subst_files): $(foreach file, $(subst_files), $(subst $(BRANCH),,$(file).in))
368
 
        $(PYTHON) $(DEB_BUILDDIR)/config/Preprocessor.py -Fsubstitution --marker="%%" $(DEB_DEFINES) $(CURDIR)/$(subst $(BRANCH),,$@.in) > $(CURDIR)/$@
 
358
        $(MOZ_PYTHON) $(DEB_BUILDDIR)/config/Preprocessor.py -Fsubstitution --marker="%%" $(DEB_DEFINES) $(CURDIR)/$(subst $(BRANCH),,$@.in) > $(CURDIR)/$@
369
359
 
370
360
debian/usr.bin.firefox.in:
371
361
        if [ '$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)' -ge '1104' ]; then \
379
369
        fi
380
370
 
381
371
debian/stamp-buildsymbols: debian/stamp-makefile-build
382
 
ifeq (1, $(DEB_ENABLE_BREAKPAD))
 
372
ifeq (1, $(MOZ_ENABLE_BREAKPAD))
383
373
        # create build symbols
384
374
        cd $(MOZ_OBJDIR); \
385
375
                $(MAKE) buildsymbols MOZ_SYMBOLS_EXTRA_BUILDID=$(shell date -d "`dpkg-parsechangelog | grep Date: | sed -e 's/^Date: //'`" +%y%m%d%H%M%S)-$(DEB_HOST_GNU_CPU)
427
417
                then \
428
418
                        language=`echo $$line | sed 's/\([^:]*\):*\([^:]*\):*\([^:]*\)/\1/'` ; \
429
419
                        pkgname=`echo $$line | sed 's/\([^:]*\):*\([^:]*\):*\([^:]*\)/\2/'` ; \
430
 
                        id=`python $(CURDIR)/debian/get-xpi-id.py $(CURDIR)/$(MOZ_OBJDIR)/dist/install/$(DEBIAN_NAME)-$(FF_VERSION).$${language}.langpack.xpi` ; \
431
 
                        dh_installdirs -p$(DEBIAN_NAME)-locale-$${pkgname} usr/lib/$(DEBIAN_NAME)-addons/extensions ; \
432
 
                        cp $(CURDIR)/$(MOZ_OBJDIR)/dist/install/$(DEBIAN_NAME)-$(FF_VERSION).$${language}.langpack.xpi \
433
 
                          $(CURDIR)/debian/$(DEBIAN_NAME)-locale-$${pkgname}/usr/lib/$(DEBIAN_NAME)-addons/extensions/$${id}.xpi ; \
434
 
                        dh_installdirs -p$(DEBIAN_NAME)-locale-$${pkgname} usr/lib/$(DEBIAN_NAME)-addons/searchplugins/$${language} ; \
 
420
                        id=`python $(CURDIR)/debian/get-xpi-id.py $(CURDIR)/$(MOZ_OBJDIR)/dist/install/$(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi` ; \
 
421
                        dh_installdirs -p$(MOZ_APP_NAME)-locale-$${pkgname} usr/lib/$(MOZ_APP_NAME)-addons/extensions ; \
 
422
                        cp $(CURDIR)/$(MOZ_OBJDIR)/dist/install/$(MOZ_APP_NAME)-$(MOZ_VERSION).$${language}.langpack.xpi \
 
423
                          $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}/usr/lib/$(MOZ_APP_NAME)-addons/extensions/$${id}.xpi ; \
 
424
                        dh_installdirs -p$(MOZ_APP_NAME)-locale-$${pkgname} usr/lib/$(MOZ_APP_NAME)-addons/searchplugins/$${language} ; \
435
425
                        cp -r $(CURDIR)/$(MOZ_OBJDIR)/dist/xpi-stage/locale-$${language}/searchplugins/*.xml \
436
 
                          $(CURDIR)/debian/$(DEBIAN_NAME)-locale-$${pkgname}/usr/lib/$(DEBIAN_NAME)-addons/searchplugins/$${language}/. ; \
 
426
                          $(CURDIR)/debian/$(MOZ_APP_NAME)-locale-$${pkgname}/usr/lib/$(MOZ_APP_NAME)-addons/searchplugins/$${language}/. ; \
437
427
                fi \
438
428
        done < $(CURDIR)/debian/locales.shipped
439
429
 
440
 
binary-install/$(DEBIAN_NAME)::
441
 
        convert -resize 32x32 debian/$(DEBIAN_NAME)/usr/share/pixmaps/$(DEBIAN_NAME).png debian/$(DEBIAN_NAME)/usr/share/pixmaps/$(DEBIAN_NAME).xpm
 
430
binary-install/$(MOZ_APP_NAME)::
 
431
        convert -resize 32x32 debian/$(MOZ_APP_NAME)/usr/share/pixmaps/$(MOZ_APP_NAME).png debian/$(MOZ_APP_NAME)/usr/share/pixmaps/$(MOZ_APP_NAME).xpm
442
432
 
443
 
ifeq (1, $(ENABLE_GLOBALMENU))
444
 
binary-install/$(DEBIAN_NAME)-globalmenu::
445
 
        unzip -o -d debian/$(DEBIAN_NAME)-globalmenu$(FF_PREFIX)/lib/$(DEBIAN_NAME)-addons/extensions/globalmenu@ubuntu.com/ $(MOZ_DISTDIR)/xpi-stage/globalmenu.xpi
446
 
        find debian/$(DEBIAN_NAME)-globalmenu$(FF_PREFIX)/lib/$(DEBIAN_NAME)-addons/extensions/globalmenu@ubuntu.com/ -type f -executable | xargs chmod -x
 
433
ifeq (1, $(MOZ_ENABLE_GLOBALMENU))
 
434
binary-install/$(MOZ_APP_NAME)-globalmenu::
 
435
        unzip -o -d debian/$(MOZ_APP_NAME)-globalmenu$(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-addons/extensions/globalmenu@ubuntu.com/ $(MOZ_DISTDIR)/xpi-stage/globalmenu.xpi
 
436
        find debian/$(MOZ_APP_NAME)-globalmenu$(MOZ_PREFIX)/lib/$(MOZ_APP_NAME)-addons/extensions/globalmenu@ubuntu.com/ -type f -executable | xargs chmod -x
447
437
endif
448
438
 
449
439
GNOME_SUPPORT_FILES = libmozgnome.so libnkgnomevfs.so
450
440
 
451
 
binary-post-install/$(DEBIAN_NAME):: compare
452
 
        $(foreach file,$(GNOME_SUPPORT_FILES),rm -fv debian/$(DEBIAN_NAME)/usr/lib/firefox-*/components/$(file);) true
 
441
binary-post-install/$(MOZ_APP_NAME):: compare
 
442
        $(foreach file,$(GNOME_SUPPORT_FILES),rm -fv debian/$(MOZ_APP_NAME)/usr/lib/firefox-*/components/$(file);) true
453
443
 
454
 
ifneq (1, $(USE_SYSTEM_NSPR))
455
 
binary-post-install/$(DEBIAN_NAME)-dev::
456
 
        rm -f debian/$(DEBIAN_NAME)-dev$(FF_INCDIR)/nspr/md/_linux.cfg
457
 
        dh_link -p$(DEBIAN_NAME)-dev $(FF_INCDIR)/nspr/prcpucfg.h $(FF_INCDIR)/nspr/md/_linux.cfg
 
444
ifneq (1, $(MOZ_USE_SYSTEM_NSPR))
 
445
binary-post-install/$(MOZ_APP_NAME)-dev::
 
446
        rm -f debian/$(MOZ_APP_NAME)-dev$(MOZ_INCDIR)/nspr/md/_linux.cfg
 
447
        dh_link -p$(MOZ_APP_NAME)-dev $(MOZ_INCDIR)/nspr/prcpucfg.h $(MOZ_INCDIR)/nspr/md/_linux.cfg
458
448
endif
459
449
 
460
450
common-binary-predeb-arch::
461
451
        $(foreach file,$(DEBIAN_EXECUTABLES),chmod a+x debian/$(file);)
462
452
        # we want the gnome dependencies not to be in the main package at shlibdeps runtime, hence we dont
463
453
        # install them at binary-install/* stage, but copy them over _after_ the shlibdeps had been generated
464
 
        $(foreach file,$(GNOME_SUPPORT_FILES),mv debian/$(DEBIAN_NAME)-gnome-support$(FF_LIBDIR)/components/$(file) debian/$(DEBIAN_NAME)$(FF_LIBDIR)/components/;) true
 
454
        $(foreach file,$(GNOME_SUPPORT_FILES),mv debian/$(MOZ_APP_NAME)-gnome-support$(MOZ_LIBDIR)/components/$(file) debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR)/components/;) true
465
455
        touch $@
466
456
 
467
 
ifneq (1, $(USE_SYSTEM_NSS))
468
 
binary-predeb/$(DEBIAN_NAME)::
 
457
ifneq (1, $(MOZ_USE_SYSTEM_NSS))
 
458
binary-predeb/$(MOZ_APP_NAME)::
469
459
        $(foreach lib,libsoftokn3.so libfreebl3.so libnssdbm3.so, \
470
 
                LD_LIBRARY_PATH=debian/$(DEBIAN_NAME)$(FF_LIBDIR):$$LD_LIBRARY_PATH \
471
 
                $(MOZ_DISTDIR)/bin/shlibsign -v -i debian/$(DEBIAN_NAME)$(FF_LIBDIR)/$(lib);)
 
460
                LD_LIBRARY_PATH=debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR):$$LD_LIBRARY_PATH \
 
461
                $(MOZ_DISTDIR)/bin/shlibsign -v -i debian/$(MOZ_APP_NAME)$(MOZ_LIBDIR)/$(lib);)
472
462
endif
473
463
 
474
464
pre-build:: $(subst_files)