~mozillateam/xulrunner/xulrunner-1.9.dev

1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
1
#!/usr/bin/make -f
2
3
MOZ_CVS_ROOT := :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
4
5
# These are used for cross-compiling and for saving the configure script
6
# from having to guess our platform (since we know it already)
7
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
9
DEB_BUILD_ARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
10
59 by Fabien Tassin
* Ship xpcshell as /usr/bin/xpcshell-1.9 (LP: #151400)
11
DEB_MOZ_VERSION=1.9
12
DEB_MOZ_APPLICATION=xulrunner-$(DEB_MOZ_VERSION)
31 by Fabien Tassin
* Install /usr/bin/xulrunner as an alternative
13
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
14
DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
15
DEBIAN_UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/^\(.*\)-[^-]*$$/\1/')
16
DEBIAN_REV_CODE := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*-\([0-9]*\)[^-]*$$/0\1/ ; s/^.*\(..\)$$/\1/')
17
DEBIAN_DATE ?= $(shell echo $(DEBIAN_VERSION) | sed 's/^.*cvs\([0-9]*\).*$$/\1/')
18
37 by Fabien Tassin
* Don't try to use files before they are built.
19
DEBIAN_XUL_DIR := /usr/lib/xulrunner-$(shell tail -1 mozilla/config/milestone.txt)
31 by Fabien Tassin
* Install /usr/bin/xulrunner as an alternative
20
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
21
DEB_SRCDIR		:= mozilla
22
41.1.2 by Alexander Sack
* debian/rules: use EXTRA_SYSTEM_CONFIGURE_FLAGS to only use system-nss/-nspr
23
EXTRA_SYSTEM_CONFIGURE_FLAGS = $(NULL)
24
88 by Fabien Tassin
* Make cairo detection code use EXTRA_SYSTEM_CONFIGURE_FLAGS
25
USE_SYSTEM_CAIRO := $(shell pkg-config --exists 'cairo >= 1.5.4'; a=$$?; if test $$a != 1; then echo 1; fi)
26
27
# for old cairo versions we cannot use system cairo
89 by Fabien Tassin
* Rewrite detection code for system nss and nspr, to ease backports to gutsy
28
ifeq (1,$(USE_SYSTEM_CAIRO))
88 by Fabien Tassin
* Make cairo detection code use EXTRA_SYSTEM_CONFIGURE_FLAGS
29
   EXTRA_SYSTEM_CONFIGURE_FLAGS += --enable-system-cairo
30
else
31
   EXTRA_SYSTEM_CONFIGURE_FLAGS += --disable-system-cairo
32
endif
33
89 by Fabien Tassin
* Rewrite detection code for system nss and nspr, to ease backports to gutsy
34
# gutsy doesn't have the right system-nss/nspr
35
USE_SYSTEM_NSPR := $(shell pkg-config --exists 'nspr >= 4.7'; a=$$?; if test $$a != 1; then echo 1; fi)
36
ifeq (1,$(USE_SYSTEM_NSPR))
37
   EXTRA_SYSTEM_CONFIGURE_FLAGS += --with-system-nspr
38
endif
48 by Alexander Sack
* unify test for dev-package in var DEV_PACKAGE_INDICATION and determine whether to point
39
89 by Fabien Tassin
* Rewrite detection code for system nss and nspr, to ease backports to gutsy
40
USE_SYSTEM_NSS := $(shell pkg-config --exists 'nspr >= 3.12'; a=$$?; if test $$a != 1; then echo 1; fi)
41
ifeq (1,$(USE_SYSTEM_NSS))
42
   EXTRA_SYSTEM_CONFIGURE_FLAGS += --with-system-nss
41.1.2 by Alexander Sack
* debian/rules: use EXTRA_SYSTEM_CONFIGURE_FLAGS to only use system-nss/-nspr
43
endif
44
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
45
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
46
        OPTFLAGS = -O0
47
else
48
        OPTFLAGS = -O2 -fno-strict-aliasing
49
endif
50
51
OPTFLAGS += -g
52
39 by Fabien Tassin
* Compile with gcc/g++ 4.2 for all archs.
53
CXX=g++-4.2
54
CC=gcc-4.2
55
export CXX CC
56
65.1.23 by Fabien Tassin
* Drop update_configure.patch painful to keep up-to-date, re-enable
57
DEB_AUTO_UPDATE_AUTOCONF=2.13
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
58
59
include /usr/share/cdbs/1/rules/debhelper.mk
60
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
61
include /usr/share/cdbs/1/class/autotools.mk
62
63
DEB_AUTO_UPDATE_DEBIAN_CONTROL=0
64
MOZ_APPLICATION=xulrunner
65
7.1.6 by Fabien Tassin
* Add --enable-extensions to build xml-rpc, venkman, inspector, irc, gnomevfs,
66
# List all extensions we want. This is MOZ_EXTENSIONS_ALL, except:
67
# - remove 'wallet' (fail to build)
68
# - remove 'layout-debug' (build system order issue)
69
# - remove 'help' (not compatible with MOZ_XUL_APP)
70
# - remove 'sroaming' (need xpcom obsolete)
71
# - remove 'typeaheadfind' (build system issue with missing -lgkgfx)
72
# - remove 'datetime' (fail to build)
73
# - remove 'finger' (fail to build)
74
# - remove 'sql' (fail to build)
75
# - remove 'xforms' (fail to build)
76
# - remove 'schema-validation' (fail to build)
77
# - add 'python/xpcom'
78
# - can't add python/dom (fail to link libpyxpcom.a)
79
DEB_MOZ_EXTENSIONS=xml-rpc,venkman,inspector,irc,gnomevfs,cview,tasks,reporter,python/xpcom
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
80
81
DEB_CONFIGURE_USER_FLAGS= \
41.1.2 by Alexander Sack
* debian/rules: use EXTRA_SYSTEM_CONFIGURE_FLAGS to only use system-nss/-nspr
82
	$(EXTRA_SYSTEM_CONFIGURE_FLAGS) \
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
83
	--enable-application=$(MOZ_APPLICATION) \
7.1.6 by Fabien Tassin
* Add --enable-extensions to build xml-rpc, venkman, inspector, irc, gnomevfs,
84
	--enable-extensions=$(DEB_MOZ_EXTENSIONS) \
85
	--enable-webservices \
17 by Fabien Tassin
* Add --enable-safe-browsing to debian/rules as it's good for us
86
	--enable-safe-browsing \
63 by Fabien Tassin
* new upstream snapshot (1.9b1 rc3 from FIREFOX_3_0b1_RC3)
87
        --with-default-mozilla-five-home=$(DEBIAN_XUL_DIR) \
87 by Fabien Tassin
* Add --enable-startup-notification
88
        --enable-startup-notification \
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
89
        --with-user-appdir=.mozilla \
90
        --with-system-jpeg=/usr \
91
        --with-system-zlib=/usr \
81 by Alexander Sack
* switch to system nspr and nss to allow embedders that explicitly need nspr
92
        --with-system-nspr \
93
        --with-system-nss \
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
94
	--disable-javaxpcom \
95
        --disable-crashreporter \
96
        --disable-elf-dynstr-gc \
97
        --disable-installer \
98
        --disable-strip \
99
        --disable-strip-libs \
21 by Fabien Tassin
* Add --disable-install-strip to debian/rules (introduced
100
        --disable-install-strip \
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
101
        --disable-tests \
45 by Fabien Tassin
* Add --disable-mochitest to debian/rules
102
        --disable-mochitest \
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
103
        --disable-updater \
104
        --enable-optimize="-pipe -w $(OPTFLAGS)" \
41.1.2 by Alexander Sack
* debian/rules: use EXTRA_SYSTEM_CONFIGURE_FLAGS to only use system-nss/-nspr
105
        --with-distribution-id=com.ubuntu \
106
	$(NULL)
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
107
89 by Fabien Tassin
* Rewrite detection code for system nss and nspr, to ease backports to gutsy
108
ifeq (1,$(USE_SYSTEM_NSS))
31 by Fabien Tassin
* Install /usr/bin/xulrunner as an alternative
109
binary-install/$(DEB_MOZ_APPLICATION)::
110
	dh_link usr/lib/nss/libnssckbi.so $(DEBIAN_XUL_DIR)/libnssckbi.so
48 by Alexander Sack
* unify test for dev-package in var DEV_PACKAGE_INDICATION and determine whether to point
111
endif
112
113
binary-install/$(DEB_MOZ_APPLICATION)::
68 by Fabien Tassin
* Move extensions dir from /usr/lib/xulrunner-addons to
114
	dh_link usr/lib/xulrunner-addons/extensions  $(DEBIAN_XUL_DIR)/extensions
115
	dh_link usr/lib/xulrunner-addons/plugins  $(DEBIAN_XUL_DIR)/plugins
54 by Fabien Tassin
* Add /usr/bin/xulrunner-1.9 and make the alternative point to it so
116
	dh_link $(DEBIAN_XUL_DIR)/xulrunner /usr/bin/$(DEB_MOZ_APPLICATION)
59 by Fabien Tassin
* Ship xpcshell as /usr/bin/xpcshell-1.9 (LP: #151400)
117
	dh_link $(DEBIAN_XUL_DIR)/xpcshell /usr/bin/xpcshell-$(DEB_MOZ_VERSION)
24 by Fabien Tassin
* Don't hardcode xul version in debian/xulrunner-1.9.links
118
69 by Fabien Tassin
* Add a postrm script to clean up left-overs from python/xpcom
119
post-patches:: debian/$(DEB_MOZ_APPLICATION).postrm
120
121
debian/$(DEB_MOZ_APPLICATION).postrm: debian/$(DEB_MOZ_APPLICATION).postrm.in
122
	sed -e 's,@XULDIR@,$(DEBIAN_XUL_DIR),g' < debian/$(DEB_MOZ_APPLICATION).postrm.in \
123
	> debian/$(DEB_MOZ_APPLICATION).postrm
124
7.1.6 by Fabien Tassin
* Add --enable-extensions to build xml-rpc, venkman, inspector, irc, gnomevfs,
125
# Clean is not totally clean
126
clean::
127
	test -d $(DEB_SRCDIR)/_tests && rm -rf $(DEB_SRCDIR)/_tests ; \
128
	test -d $(DEB_SRCDIR)/staticlib && rm -rf $(DEB_SRCDIR)/staticlib ; \
66 by Fabien Tassin
* Fix shell redirection in clean rule leaving orphaned processes
129
	find $(DEB_SRCDIR) -type f -name \*.pyc -exec rm {} \; > /dev/null 2>&1; \
69 by Fabien Tassin
* Add a postrm script to clean up left-overs from python/xpcom
130
	find $(DEB_SRCDIR) -type l -exec rm {} \; > /dev/null 2>&1 ; \
131
	rm -f debian/$(DEB_MOZ_APPLICATION).postrm
7.1.6 by Fabien Tassin
* Add --enable-extensions to build xml-rpc, venkman, inspector, irc, gnomevfs,
132
1 by Fabien Tassin
* new upstream snapshot (1.9a8pre~cvs20070824)
133
date := $(shell date +%Y%m%d)
134
135
mozilla:
136
ifeq (HEAD, $(DEBIAN_DATE))
137
	set -e; sh -c "cvs -d$(MOZ_CVS_ROOT) co mozilla/client.mk; cd mozilla && make -f client.mk checkout MOZ_CO_PROJECT=$(MOZ_APPLICATION)"
138
else
139
	set -e; sh -c "cvs -d$(MOZ_CVS_ROOT) co mozilla/client.mk; cd mozilla && make -f client.mk checkout MOZ_CO_DATE=$(DEBIAN_DATE) MOZ_CO_PROJECT=$(MOZ_APPLICATION)"
140
endif
141
	rm -f cvsco*
142
143
../$(DEB_MOZ_APPLICATION)_$(DEBIAN_UPSTREAM_VERSION).orig.tar.gz: mozilla
144
	set -e; rm -rf $(DEB_MOZ_APPLICATION)-$(DEBIAN_UPSTREAM_VERSION); \
145
		mkdir $(DEB_MOZ_APPLICATION)-$(DEBIAN_UPSTREAM_VERSION); \
146
		mv mozilla $(DEB_MOZ_APPLICATION)-$(DEBIAN_UPSTREAM_VERSION); \
147
		tar cvzf $@ $(DEB_MOZ_APPLICATION)-$(DEB_UPSTREAM_VERSION)/; \
148
		rm -rf $(DEB_MOZ_APPLICATION)-$(DEBIAN_UPSTREAM_VERSION)
149
150
neworig: ../$(DEB_MOZ_APPLICATION)_$(DEBIAN_UPSTREAM_VERSION).orig.tar.gz
151
152
CFLAGS =
153
CXXFLAGS =