25
25
PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
26
26
PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
28
hotspot_archs = amd64 i386 lpia sparc
29
shark_archs = amd64 i386 lpia
31
no_bootstrap_archs = alpha armel
36
jdirname = java-$(shortver)-$(origin)
38
basename = openjdk-$(shortver)
39
ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
42
else ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
44
vm_name = Hotspot Shark
47
vm_name = Hotspot Zero
52
jdiralias = java-$(shortver)-$(origin)
53
basedir = usr/lib/jvm/$(jdiralias)
54
jreimg = openjdk/build/linux-$(jvmarch)/j2re-image
55
sdkimg = openjdk/build/linux-$(jvmarch)/j2sdk-image
56
security = etc/$(jdiralias)/security
28
58
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
60
SPACE = $(EMPTY) $(EMPTY)
30
61
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
31
62
NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
32
63
HOTSPOT_BUILD_JOBS = $(NJOBS)
42
73
with_check = $(if $(findstring nocheck, $(DEB_BUILD_OPTIONS)),,yes)
43
74
with_docs = $(if $(findstring nodocs, $(DEB_BUILD_OPTIONS)),,yes)
44
ifneq (,$(findstring cacao, $(PKGSOURCE)))
45
with_docs = disabled for cacao
75
ifneq (,$(findstring cacao shark, $(PKGSOURCE)))
76
with_docs = disabled for cacao and shark
48
# even if not building the package, we configure for a specific plugin
49
# with_plugin_pkg: yes or empty, plugin_name: IcedTeaPlugin.so
50
79
with_plugin_pkg = yes
51
80
plugin_name = IcedTeaPlugin.so
53
82
distribution := $(shell lsb_release --id --short)
54
83
distrel := $(shell lsb_release --codename --short)
56
with_wgy_zenhai = $(if $(filter $(distrel),hardy intrepid jaunty),yes)
85
with_wgy_zenhai = $(if $(filter $(distrel),hardy intrepid jaunty karmic squeeze sid),yes)
58
arch_map := alpha=alpha arm=arm armel=arm amd64=amd64 i386=i586 lpia=i586 m68k=m68k mips=mips mipsel=mipsel powerpc=ppc sparc=sparc s390=s390 ia64=ia64
59
archdir_map := alpha=alpha arm=arm armel=arm amd64=amd64 i386=i386 lpia=i386 m68k=m68k mips=mips mipsel=mipsel powerpc=ppc sparc=sparc s390=s390 ia64=ia64
87
arch_map := alpha=alpha arm=arm armel=arm amd64=amd64 hppa=parisc i386=i586 lpia=i586 m68k=m68k mips=mips mipsel=mipsel powerpc=ppc sparc=sparc s390=s390 ia64=ia64
88
archdir_map := alpha=alpha arm=arm armel=arm amd64=amd64 hppa=parisc i386=i386 lpia=i386 m68k=m68k mips=mips mipsel=mipsel powerpc=ppc sparc=sparc s390=s390 ia64=ia64
61
90
jvmarch := $(strip $(patsubst $(DEB_HOST_ARCH)=%, %, \
62
91
$(filter $(DEB_HOST_ARCH)=%, $(arch_map))))
63
92
archdir := $(strip $(patsubst $(DEB_HOST_ARCH)=%, %, \
64
93
$(filter $(DEB_HOST_ARCH)=%, $(archdir_map))))
66
hotspot_archs = amd64 i386 lpia sparc
67
hotspot_archs = amd64 lpia sparc
69
no_bootstrap_archs = alpha hppa
95
default_vm = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),hotspot,zero)
72
stage1_openjdk_archs = alpha amd64 armel i386 ia64 lpia powerpc m68k mips mipsel sparc s390
97
#stage1_openjdk_archs = alpha amd64 armel i386 ia64 lpia powerpc m68k mips mipsel sparc s390
98
#stage1_gcj_archs = amd64 hppa i386 ia64 lpia powerpc m68k mips mipsel sparc s390
99
stage1_gcj_archs = hppa ia64 powerpc m68k mips mipsel sparc s390
100
stage1_openjdk_archs = alpha amd64 armel i386 lpia
73
101
stage1_cacao_archs =
75
ifneq (,$(findstring cacao, $(PKGSOURCE)))
76
stage1_gcj_archs = armel ia64 m68k mips mipsel s390
77
stage1_openjdk_archs = amd64 i386 lpia sparc
78
stage1_cacao_archs = alpha powerpc
103
cacao_archs = alpha amd64 armel i386 lpia powerpc m68k mips mipsel s390
104
altzero_archs = $(filter-out sparc, $(hotspot_archs))
107
ifneq (,$(filter $(DEB_HOST_ARCH), $(cacao_archs)))
108
alternate_vms += cacao
110
ifneq (,$(filter $(DEB_HOST_ARCH), $(altzero_archs)))
111
ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
112
alternate_vms += shark
114
alternate_vms += zero
81
118
ifneq (,$(filter $(DEB_HOST_ARCH), $(stage1_gcj_archs)))
108
145
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 powerpc sparc))
109
146
export GCC_SUFFIX = -4.2
148
else ifneq (,$(filter $(distrel),lenny intrepid jaunty squeeze sid))
112
149
export GCC_SUFFIX = -4.3
113
150
export GCJ_SUFFIX = -4.3
116
ifneq (,$(findstring cacao, $(PKGSOURCE)))
117
ifneq (,$(filter $(DEB_HOST_ARCH), ia64 sparc))
118
$(error cacao-is not ported for ia64-linux and sparc-linux)
152
export GCC_SUFFIX = -4.4
153
export GCJ_SUFFIX = -4.4
154
ifneq (,$(filter $(DEB_HOST_ARCH), sparc))
155
export GCC_SUFFIX = -4.3
156
export GCJ_SUFFIX = -4.3
122
ifneq (,$(filter $(distrel),jaunty))
160
ifneq (,$(filter $(distrel),jaunty karmic unstable experimental sid))
126
DISTRIBUTION_PATCHES = \
127
$(if $(filter $(distribution),Ubuntu),debian/patches/gcc-no-stack-protector.diff) \
164
ifneq (,$(filter $(distrel),karmic sid squeeze))
165
with_jni_bridge = yes
168
#ifneq (,$(filter $(distrel),karmic unstable experimental sid))
169
# with_systemtap = yes
173
ifneq (,$(filter $(distrel),gutsy feisty edgy dapper hardy intrepid))
174
with_hotspot = original
177
ifeq ($(with_hotspot),original)
178
# $(if $(filter $(distribution),Ubuntu),debian/patches/gcc-no-stack-protector-original.diff) \
180
DISTRIBUTION_PATCHES = \
181
debian/patches/ld-symbolic-functions-original.diff \
182
debian/patches/set-exec-name-original.diff
184
# FIXME: doesn't seem to be enough, the gcc-*-no-stack-protector patches below are needed.
185
# $(if $(filter $(distribution),Ubuntu),debian/patches/gcc-no-stack-protector.diff) \
187
DISTRIBUTION_PATCHES = \
128
188
debian/patches/ld-symbolic-functions.diff \
129
189
debian/patches/set-exec-name.diff \
190
debian/patches/hotspot-warn-no-errformat.diff
193
DISTRIBUTION_PATCHES += \
130
194
debian/patches/shebang.diff \
131
195
debian/patches/jexec.diff \
132
debian/patches/fontconfig-$(if $(with_wgy_zenhai),wqy-zenhei,arphic-uming).diff \
196
$(if $(with_wgy_zenhai),,debian/patches/fontconfig-arphic-uming.diff) \
133
197
debian/patches/no-compiler-path.diff \
134
debian/patches/fix-race-cond-print.diff \
135
198
debian/patches/jdk-freetypeScaler-crash.diff \
136
199
debian/patches/icedtea-pretend-memory.diff \
137
debian/patches/hotspot-warn-no-errformat.diff \
200
debian/patches/default-jvm-cfg.diff \
201
debian/patches/nonreparenting-wm.diff \
202
debian/patches/java-access-bridge-security.patch \
203
debian/patches/accessible-toolkit.patch \
204
debian/patches/default-libpath.diff \
139
206
# debian/patches/gcc-mtune-generic.diff \
147
214
ifeq ($(distribution),Ubuntu)
148
DISTRIBUTION_PATCHES += debian/patches/openjdk-ubuntu-branding.patch
151
ifneq (,$(findstring cacao, $(PKGSOURCE)))
152
215
DISTRIBUTION_PATCHES += \
153
debian/patches/cacao-no-mmap-first-page.diff
216
debian/patches/openjdk-ubuntu-branding.patch \
217
debian/patches/gcc-jdk-no-stack-protector.diff
218
ifeq ($(with_hotspot),original)
219
DISTRIBUTION_PATCHES += \
220
debian/patches/gcc-hotspot-no-stack-protector-original.diff
222
DISTRIBUTION_PATCHES += \
223
debian/patches/gcc-hotspot-no-stack-protector.diff
227
# FIXME: temporarily disabled
228
#ifneq (,$(filter $(DEB_HOST_ARCH),armel))
229
# DISTRIBUTION_PATCHES += \
230
# debian/patches/zero-hotspot-opt.diff
156
233
export DISTRIBUTION_PATCHES
158
235
ifeq ($(STAGE1_JAVA),gcj)
186
262
# see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=217
187
263
# only use it for zero ports except powerpc (which we assume as
188
264
# fast enough to build.
189
ifneq (,$(findstring openjdk, $(PKGSOURCE)))
190
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) ia64 powerpc))
191
CONFIGURE_ARGS += --with-alt-jar=/usr/bin/fastjar
265
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) ia64 powerpc))
266
CONFIGURE_ARGS += --with-alt-jar=/usr/bin/fastjar
195
269
CONFIGURE_ARGS += \
196
270
--with-xalan2-jar=/usr/share/java/xalan2.jar \
197
271
--with-xalan2-serializer-jar=/usr/share/java/serializer.jar \
198
272
--with-rhino=/usr/share/java/js.jar \
199
--with-openjdk-src-zip=$(firstword $(wildcard $(OPENJDK_SRC_ZIP) /usr/src/$(OPENJDK_SRC_ZIP)))
201
ifneq (,$(findstring cacao, $(PKGSOURCE)))
273
--with-openjdk-src-zip=$(CURDIR)/openjdk.tar.gz \
274
--with-hotspot-src-zip=$(CURDIR)/hotspot.tar.gz \
275
--with-corba-src-zip=$(CURDIR)/corba.tar.gz \
276
--with-jaxp-src-zip=$(CURDIR)/jaxp.tar.gz \
277
--with-jaxws-src-zip=$(CURDIR)/jaxws.tar.gz \
278
--with-jdk-src-zip=$(CURDIR)/jdk-dfsg.tar.gz \
279
--with-langtools-src-zip=$(CURDIR)/langtools.tar.gz
281
#CONFIGURE_ARGS += --disable-nimbus --disable-nimbus-generation
283
ifneq (,$(filter $(DEB_HOST_ARCH), $(cacao_archs)))
202
284
CONFIGURE_ARGS += \
204
285
--with-cacao-src-zip=$(firstword $(wildcard $(CURDIR)/cacao-*.tar.* /usr/src/cacao-*.tar.*))
205
ifneq (,$(filter $(DEB_HOST_ARCH), arm armel))
286
ifneq (,$(filter $(DEB_HOST_ARCH), armel))
206
287
EXTRA_BUILD_ENV = CACAO_CONFIGURE_ARGS='--enable-softfloat --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)'
208
289
EXTRA_BUILD_ENV = CACAO_CONFIGURE_ARGS='--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)'
293
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
294
CONFIGURE_ARGS += --enable-zero
295
ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
296
CONFIGURE_ARGS += --enable-shark
300
ifeq ($(with_hotspot),original)
301
CONFIGURE_ARGS += --without-hotspot-build
211
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
212
CONFIGURE_ARGS += --enable-zero
213
ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
214
CONFIGURE_ARGS += --enable-shark
217
CONFIGURE_ARGS += --with-hotspot-build
219
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
220
EXTRA_BUILD_ENV = LIBFFI_LIBS=-lffi_pic
303
CONFIGURE_ARGS += --with-hotspot-build
306
EXTRA_BUILD_ENV += LIBFFI_LIBS=-lffi_pic
224
308
# assume we don't build binary indep packages on these architectures
225
309
ifeq ($(with_docs),yes)
226
ifneq (,$(filter $(DEB_HOST_ARCH), alpha arm armel hppa ia64 lpia m68k mips mipsel powerpc s390 sparc))
310
ifeq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia))
227
311
CONFIGURE_ARGS += --disable-docs
244
328
CONFIGURE_ARGS += --enable-pulse-java
331
ifeq ($(with_systemtap),yes)
332
CONFIGURE_ARGS += --enable-systemtap --with-abs-install-dir=/$(basedir)
335
ifneq (,$(alternate_vms))
336
CONFIGURE_ARGS += --with-additional-vms=$(subst $(SPACE),$(COMMA),$(alternate_vms))
247
339
CONFIGURE_ARGS += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
253
jdirname = java-$(shortver)-$(origin)
254
ifneq (,$(findstring cacao, $(PKGSOURCE)))
256
basename = cacao-oj$(shortver)
259
vm_name = CacaoVM JIT
262
basename = openjdk-$(shortver)
263
ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
265
vm_name = Hotspot JIT
268
vm_name = Hotspot Zero
274
jdiralias = java-$(shortver)-$(origin)
275
basedir = usr/lib/jvm/$(jdiralias)
276
jreimg = openjdk/build/linux-$(jvmarch)/j2re-image
277
sdkimg = openjdk/build/linux-$(jvmarch)/j2sdk-image
278
security = etc/$(jdiralias)/security
280
341
# (most) jre and jdk tools handled by the alternatives system.
281
342
# dups in heimdal-clients, krb5-user: kinit, klist, ktab, no alternatives
282
all_jre_tools = $(notdir $(wildcard $(jreimg)/bin/*))
343
all_jre_tools = $(notdir $(wildcard build/$(jreimg)/bin/*))
283
344
jre_tools = $(filter javaws pluginappletviewer policytool, $(all_jre_tools))
284
345
jre_hl_tools := $(filter-out $(jre_tools), $(all_jre_tools))
302
363
ifneq (,$(stage1_gcj_archs))
303
364
bd_bootstrap += \
365
ecj-gcj [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))],
366
ifneq (,$(filter $(distrel),karmic unstable experimental))
368
gcj-jdk [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))],
304
371
gcj (>= 4:4.2.1) [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))], \
305
ecj-gcj [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))], \
306
372
java-gcj-compat-dev (>= 1.0.76-2ubuntu3) [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))],
308
375
ifneq (,$(stage1_openjdk_archs))
309
376
bd_bootstrap += \
313
380
bd_bootstrap += \
314
381
cacao-oj6-jdk [$(strip $(foreach a,$(stage1_cacao_archs), $(a)))],
316
bd_tarball = $(if $(findstring openjdk, $(PKGSOURCE)),,$(p_tar) (>= 6b40)$(COMMA) $(p_tar) (<< 6b41)$(COMMA))
318
bd_cacao = $(if $(findstring cacao, $(PKGSOURCE)),cacao-source (>= 0.99.4~20081012)$(COMMA))
320
g++-4.2 [amd64 powerpc sparc], g++-4.1 [i386 lpia],
321
ifeq (,$(filter $(distrel),hardy gutsy feisty edgy dapper))
384
ifneq (,$(filter $(distrel),hardy gutsy feisty edgy dapper))
385
bd_gcc = g++-4.2 [amd64 powerpc sparc], g++-4.1 [i386 lpia],
386
else ifneq (,$(filter $(distrel),lenny intrepid jaunty squeeze sid))
389
bd_gcc = g++-4.4 [!sparc], g++-4.3 [sparc],
326
392
libjpeg62-dev, libpng12-dev, libgif-dev$(if $(filter $(distrel),etch dapper edgy feisty gutsy), | libungif4-dev), zlib1g-dev,
329
395
$(if $(filter $(distrel), etch dapper edgy gutsy hardy),libcupsys2-dev,libcups2-dev), \
330
396
libasound2-dev, libfreetype6-dev, \
331
397
libxalan2-java, rhino, liblcms1-dev, libxinerama-dev,
333
$(if $(filter $(distribution),Ubuntu),$(if $(filter $(distrel),hardy),libffi4-dev,libffi-dev),libffi-dev) [$(foreach a,$(hotspot_archs),!$(a))],
335
llvm-dev (>= 2.4) [$(foreach a,$(shark_archs),$(a))],
337
#ifeq ($(with_plugin_pkg),yes)
339
libgtk2.0-dev, $(if $(filter $(distribution),Debian),$(if $(findstring gcj,$(plugin_name)),iceape-dev,xulrunner-dev (>= 1.9.0)),$(if $(filter $(distrel),hardy intrepid jaunty),xulrunner-1.9-dev,firefox-dev)),
399
libxpp3-java, libjibx-java,
401
pkg_ffidev = $(if $(filter $(distribution),Ubuntu),$(if $(filter $(distrel),hardy),libffi4-dev,libffi-dev),libffi-dev)
404
$(pkg_ffidev) [$(foreach a,$(hotspot_archs),!$(a))],
408
ifneq (,$(shark_archs))
409
bd_zero = $(pkg_ffidev),
410
bd_shark = llvm-dev (>= 2.5) [$(foreach a,$(shark_archs),$(a))],
414
ifneq ($(distribution),Ubuntu)
415
bd_cacao += cacao-source (>= 0.99.4-1),
419
libgtk2.0-dev, $(if $(filter $(distribution),Debian),xulrunner-dev (>= 1.9.0),$(if $(filter $(distrel),hardy intrepid jaunty karmic),xulrunner-1.9-dev,firefox-dev)),
341
420
bd_netx = fastjar (>= 2:0.96-0ubuntu2),
342
421
ifneq (,$(filter $(distrel),lenny sid experimental))
343
422
bd_netx = fastjar (>= 2:0.95-4),
351
430
ifeq ($(with_pulse),yes)
352
431
bd_pulsejava = libpulse-dev (>= 0.9.12), $(pkg_pulseaudio),
433
ifeq ($(with_systemtap),yes)
434
bd_systemtap = systemtap-sdt-dev,
355
437
dlopen_hl_depends = \
356
438
$(if $(filter $(distrel), etch dapper edgy gutsy hardy),libcupsys2,libcups2), \
358
440
dlopen_hl_recommends = \
359
441
dlopen_jre_depends = \
360
442
libgtk2.0-0, libgnome2-0, libgnomevfs2-0, libgconf2-4, \
361
443
libxrandr2, libxinerama1, libgl1-mesa-glx
362
444
dlopen_jre_recommends =
364
browser_plugin_dirs = xulrunner-addons firefox iceape iceweasel mozilla midbrowser xulrunner
365
browser_plugin_dirs = xulrunner-addons
446
ifeq ($(distribution),Ubuntu)
447
browser_plugin_dirs = xulrunner-addons firefox iceape iceweasel mozilla midbrowser xulrunner
448
browser_plugin_dirs = xulrunner-addons
450
browser_plugin_dirs = mozilla
367
453
ifneq (,$(filter $(distrel),etch dapper feisty))
368
454
core_fonts = ttf-dejavu
433
532
-e 's/@bd_netx@/$(bd_netx)/g' \
434
533
-e 's/@bd_mauve@/$(bd_mauve)/g' \
435
534
-e 's/@bd_compress@/$(pkg_compress)/g' \
436
-e 's/@bd_tarball@/$(bd_tarball)/g' \
437
535
-e 's/@bd_cacao@/$(bd_cacao)/g' \
438
536
-e 's/@bd_pulsejava@/$(bd_pulsejava)/g' \
537
-e 's/@bd_systemtap@/$(bd_systemtap)/g' \
439
538
-e 's/@bd_shark@/$(bd_shark)/g' \
440
539
-e 's/@core_fonts@/$(core_fonts)/g' \
441
540
-e 's/@cjk_fonts@/$(cjk_fonts)/g' \
442
541
-e 's/@pkg_plugin@/$(p_plug)/g' \
542
-e 's/@cacao_archs@/$(cacao_archs)/g' \
543
-e 's/@hotspot_archs@/$(hotspot_archs)/g' \
544
-e 's/@altzero_archs@/$(altzero_archs)/g' \
443
545
-e 's,@pkg_version@,$(if $(filter $(distrel),etch dapper edgy feisty gutsy),$${Source-Version},$${binary:Version}),g' \
444
546
-e 's/@lib_arch@/$(p_lib_arch)/g' \
445
547
debian/control.in \
446
$(if $(with_plugin_pkg),debian/control.$(plugin_name)) \
447
$(if $(findstring openjdk-,$(PKGSOURCE)),debian/control.tarball) \
548
debian/control.plugin \
549
$(if $(cacao_archs), debian/control.cacao-jre) \
550
$(if $(altzero_archs), debian/control.zero-jre) \
449
552
@if cmp -s debian/control debian/control.old; then \
450
553
rm -f debian/control.old; \
524
620
test -x /usr/bin/linux32 && linux32 uname -a || true
525
621
test -x /usr/bin/linux32 &&linux32 /bin/uname -a || true
623
# FIXME: temporarily disabled
624
# patch --verbose -p0 < debian/patches/zero-port-opt.diff
528
628
chmod +x configure
529
$(EXTRA_BUILD_ENV) ./configure $(CONFIGURE_ARGS)
629
cd build && $(EXTRA_BUILD_ENV) ../configure $(CONFIGURE_ARGS)
532
unpack: stamps/backup-generated stamps/unpack
533
stamps/unpack: stamps/icedtea-configure stamps/backup-generated
534
$(MAKE) stamps/extract.stamp
632
unpack: stamps/unpack
633
stamps/unpack: stamps/icedtea-configure
634
$(MAKE) -C build stamps/extract.stamp
635
ifeq ($(STAGE1_JAVA),gcj)
636
# $(MAKE) -C build stamps/extract-ecj.stamp
537
640
dist-openjdk: $(OPENJDK_SRC_ZIP)
538
641
@echo "downloading openjdk source from hg to create zipfile: $(OPENJDK_SRC_ZIP)"
541
stamps/backup-generated: stamps/icedtea-configure
542
if [ -f generated.tar ]; then \
543
echo >&2 "backup of generated files already exists"; \
546
tar cf generated.tar generated
549
644
patch: stamps/patch
550
645
stamps/patch: stamps/unpack
551
646
ifeq ($(STAGE1_JAVA),gcj)
552
$(MAKE) stamps/patch-ecj.stamp
647
$(MAKE) -C build stamps/patch-ecj.stamp
554
$(MAKE) stamps/patch.stamp
649
$(MAKE) -C build stamps/patch.stamp
557
652
ifeq ($(with_check),yes)
558
ifneq (,$(findstring cacao, $(PKGSOURCE)))
559
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia powerpc sparc))
560
# only activate after testing; problems on s390
561
with_mauve_check = yes
563
ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel i386 lpia mips mipsel powerpc s390))
564
# only activate after testing; hangs several tests.
565
with_jtreg_check = yes
568
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia powerpc sparc))
569
with_mauve_check = yes
571
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia sparc))
572
with_jtreg_check = yes
653
ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) alpha armel ia64 mips mipsel powerpc s390))
654
with_mauve_check = $(default_vm)
656
ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) alpha armel ia64 mips mipsel powerpc s390))
657
with_jtreg_check = $(default_vm)
660
ifneq (,$(filter cacao, $(alternate_vms)))
661
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia powerpc sparc))
662
# only activate after testing; problems on s390
663
with_mauve_check += cacao
665
ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel i386 lpia mips mipsel powerpc s390))
666
# only activate after testing; hangs several tests.
667
with_jtreg_check += cacao
671
ifneq (,$(filter zero, $(alternate_vms)))
672
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia))
673
# only activate after testing
674
with_mauve_check += zero
676
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia))
677
# only activate after testing; hangs several tests.
678
with_jtreg_check += zero
577
build: stamps/build stamps/mauve-check stamps/jtreg-check
683
build_stamps = stamps/build
684
build_stamps += stamps/mauve-check-default stamps/jtreg-check-default
685
#build_stamps += $(if $(filter cacao, $(alternate_vms)),stamps/mauve-check-cacao stamps/jtreg-check-cacao)
686
build_stamps += $(if $(filter zero, $(alternate_vms)),stamps/mauve-check-zero stamps/jtreg-check-zero)
688
build: $(build_stamps)
578
689
if [ -f buildwatch.pid ]; then \
579
690
pid=$$(cat buildwatch.pid); \
580
691
kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \
584
695
stamps/build: stamps/patch
585
696
ifneq (,$(filter $(DEB_HOST_ARCH), alpha arm armel hppa ia64 m68k mips mipsel powerpc s390 sparc))
586
sh -c 'sh debian/buildwatch.sh &'
697
sh -c 'sh debian/buildwatch.sh $(CURDIR)/build &'
588
$(EXTRA_BUILD_ENV) $(MAKE) $(build_target)
699
if $(EXTRA_BUILD_ENV) $(MAKE) -C build $(build_target); then \
702
if [ -f buildwatch.pid ]; then \
703
pid=$$(cat buildwatch.pid); \
704
kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \
591
710
stamps/xvfb-check:
593
712
echo 'xvfb-run -a -e xvfb-run.log -s "-extension GLX" "$$@"' > bin/my-xvfb-run
594
if ! /bin/sh bin/my-xvfb-run : ; then \
713
if ! /bin/sh bin/my-xvfb-run true ; then \
595
714
echo "error running $$(cat bin/my-xvfb-run)"; \
596
715
cat xvfb-run.log; \
597
716
echo 'xvfb-run -a -e xvfb-run.log -s "$$@"' > bin/my-xvfb-run; \
598
if ! /bin/sh bin/my-xvfb-run : ; then \
717
if ! /bin/sh bin/my-xvfb-run true ; then \
599
718
echo "error running $$(cat bin/my-xvfb-run)"; \
600
719
cat xvfb-run.log; \
601
720
rm -f bin/my-xvfb-run; \
728
stamps/mauve-check-default: stamps/build stamps/xvfb-check
729
$(MAKE) -f debian/rules mauve-run-check VMNAME=$(default_vm) VMARGS=
732
stamps/mauve-check-cacao: stamps/xvfb-check
733
$(MAKE) -f debian/rules mauve-run-check VMNAME=cacao VMARGS='-vmarg -cacao'
736
stamps/mauve-check-zero: stamps/xvfb-check
737
$(MAKE) -f debian/rules mauve-run-check VMNAME=zero VMARGS='-vmarg -zero'
609
740
stamps/mauve-build: stamps/build
612
743
ifeq ($(with_mauve_check),yes)
613
tar xf /usr/src/mauve.tar.gz
744
tar -x -C build -f /usr/src/mauve.tar.gz
618
&& PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
619
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH $(MAKE) -C mauve
749
&& PATH=$(CURDIR)/build/$(sdkimg)/bin:$$PATH \
750
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
751
PATH=$(CURDIR)/build/$(sdkimg)/bin:$$PATH $(MAKE) -C build/mauve
623
755
stamps/mauve-check: stamps/build stamps/mauve-build stamps/xvfb-check
624
ifeq ($(with_mauve_check),yes)
758
rm -rf build/mauve build/mauve-$(VMNAME)
759
ifneq (,$(filter $(VMNAME), $(with_mauve_check)))
760
tar -x -C build -f /usr/src/mauve.tar.gz
761
mv build/mauve build/mauve-$(VMNAME)
762
cd build/mauve-$(VMNAME) \
766
&& PATH=$(CURDIR)/build/$(sdkimg)/bin:$$PATH ./configure \
767
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
768
PATH=$(CURDIR)/build/$(sdkimg)/bin:$$PATH $(MAKE) -C build/mauve-$(VMNAME)
625
770
if [ -f bin/my-xvfb-run ]; then \
627
JAVA_HOME=$(CURDIR)/$(sdkimg) \
628
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH \
771
cd build/mauve-$(VMNAME) && \
772
JAVA_HOME=$(CURDIR)/build/$(sdkimg) \
773
PATH=$(CURDIR)/build/$(sdkimg)/bin:$$PATH \
629
774
/bin/sh $(CURDIR)/bin/my-xvfb-run java Harness \
630
-vm $(CURDIR)/$(sdkimg)/bin/java \
775
-vm $(CURDIR)/build/$(sdkimg)/bin/java \
631
777
-file $(CURDIR)/debian/mauve_tests \
632
778
-timeout 30000 2>&1 \
633
| tee mauve_output; \
779
| tee mauve_output-$(VMNAME); \
635
echo "mauve testsuite not run for this build (xvfb failures)" > mauve/mauve_output; \
636
cat xvfb-run.log >> mauve/mauve_output; \
781
echo "mauve testsuite not run for this build (xvfb failures)" \
782
> build/mauve-$(VMNAME)/mauve_output-$(VMNAME); \
783
cat xvfb-run.log >> build/mauve-$(VMNAME)/mauve_output-$(VMNAME); \
640
echo "mauve testsuite not run for this build" > mauve/mauve_output
787
mkdir -p build/mauve-$(VMNAME)
788
echo "mauve testsuite not run for this build" \
789
> build/mauve-$(VMNAME)/mauve_output-$(VMNAME)
644
792
jtreg_processes = ps x -ww -o pid,ppid,args \
645
793
| awk '$$2 == 1 && $$3 ~ /^$(subst /,\/,/scratch)/' \
646
| sed 's,$(CURDIR)/$(sdkimg),<sdkimg>,g;s,$(CURDIR),<pwd>,g'
794
| sed 's,$(CURDIR)/build/$(sdkimg),<sdkimg>,g;s,$(CURDIR),<pwd>,g'
647
795
jtreg_pids = ps x --no-headers -ww -o pid,ppid,args \
648
| awk '$$2 == 1 && $$3 ~ /^$(subst /,\/,$(CURDIR)/$(sdkimg))/ {print $$1}'
650
stamps/jtreg-check: stamps/build stamps/xvfb-check
651
ifeq ($(with_jtreg_check),yes)
796
| awk '$$2 == 1 && $$3 ~ /^$(subst /,\/,$(CURDIR)/build/$(sdkimg))/ {print $$1}'
798
stamps/jtreg-check-default: stamps/build stamps/xvfb-check
799
$(MAKE) -f debian/rules jtreg-run-check VMNAME=$(default_vm) VMARGS=
802
stamps/jtreg-check-cacao: stamps/build stamps/xvfb-check
803
$(MAKE) -f debian/rules jtreg-run-check VMNAME=cacao VMARGS='-vmoption:-cacao'
806
stamps/jtreg-check-zero: stamps/build stamps/xvfb-check
807
$(MAKE) -f debian/rules jtreg-run-check VMNAME=zero VMARGS='-vmoption:-zero'
811
ifneq (,$(filter $(VMNAME), $(with_jtreg_check)))
652
812
@echo "BEGIN jtreg"
653
813
if [ -f bin/my-xvfb-run ]; then \
654
/bin/sh bin/my-xvfb-run $(MAKE) -j $(NJOBS) -k jtregcheck 2>&1 | tee jtreg_output; \
814
/bin/sh bin/my-xvfb-run $(MAKE) -C build -k jtregcheck ICEDTEA_JTREG_OPTIONS='$(VMARGS)' \
815
2>&1 | tee jtreg_output-$(VMNAME); \
656
echo "jtreg harness not run for this build" > jtreg_output; \
657
cat xvfb-run.log >> jtreg_output; \
817
echo "jtreg harness not run for this build" > jtreg_output-$(VMNAME); \
818
cat xvfb-run.log >> jtreg_output-$(VMNAME); \
659
820
@echo "END jtreg"
661
@echo "BEGIN jtreg-summary"
662
-cat test/jtreg-summary.log
663
@echo "END jtreg-summary"
822
for i in check-hotspot.log check-jdk.log check-langtools.log jtreg-summary.log; do \
823
if [ -f build/test/$$i ]; then \
824
mv build/test/$$i build/test/$${i%*.log}-$(VMNAME).log; \
826
mkdir -p build/test; \
827
cp jtreg_output-$(VMNAME) build/test/$${i%*.log}-$(VMNAME).log; \
831
@echo "BEGIN jtreg-summary-$(VMNAME)"
832
-cat build/test/jtreg-summary-$(VMNAME).log
833
@echo "END jtreg-summary-$(VMNAME)"
665
835
: # kill testsuite processes still hanging
666
836
@pids=$$($(jtreg_pids)); \
684
854
echo "leftover processes..."; \
685
855
$(jtreg_processes); \
858
-for i in hotspot langtools jdk; do \
859
for t in $$(egrep '^(FAILED|Error)' build/test/check-$$i-$(VMNAME).log | sed 's/.* \(.*\)\.[^.][^.]*$$/\1/'); do \
860
echo test/$$i/JTwork/$$t.jtr; \
862
done > build/test/failed_tests-$(VMNAME).list; \
863
tar -C build -c -z -f build/test/failed_tests-$(VMNAME).tar.gz -T build/test/failed_tests-$(VMNAME).list
688
echo "jtreg harness not run for this build" > jtreg_output
865
echo "jtreg harness not run for this build" > jtreg_output-$(VMNAME)
692
868
clean: debian-clean
696
[ ! -f Makefile ] || $(MAKE) distclean
697
rm -rf openjdk openjdk-ecj
698
rm -f generated/sun/awt/X11/generator/sizer.{32,64}
871
rm -rf stamps build build-*
699
872
rm -rf autom4te.cache
702
rm -f jtreg_output xvfb-run.log
874
rm -f jtreg_output* xvfb-run.log
703
875
rm -f buildwatch.pid
704
if [ -f generated.tar ]; then \
706
tar xf generated.tar; \
707
rm -f generated.tar; \
877
if [ -f ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_arm.S ]; then \
878
patch --verbose -p0 -R < debian/patches/zero-port-opt.diff; \
879
rm -f ports/hotspot/src/cpu/zero/vm/bytecodeInterpreter_arm.S; \
711
for i in $$(find test/jtreg -name '*.gif') overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/expresso.mid overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/ding.sf2; do \
712
[ -f $$i ] || continue; \
713
if [ -f $$i.uu -a $$i.uu -nt $$i ]; then \
716
d=$$(dirname $$i); i=$$(basename $$i); \
717
(cd $$d && uuencode -m $$i $$i > $$i.uu); \
1090
1262
mv $(d_jre)/$(basedir)/jre/bin/javaws $(d_jre)/$(basedir)/jre/bin/javaws.real
1091
1263
install -m 755 debian/javaws-wrapper.sh $(d_jre)/$(basedir)/jre/bin/javaws
1265
: # another jvm symlink
1266
ln -sf $(jdiralias) $(d_jrehl)/usr/lib/jvm/java-$(jvmver)-$(origin)
1268
ifeq ($(with_systemtap),yes)
1269
: # systemtap support
1270
mkdir -p $(d_jrehl)/usr/share/systemtap/tapset
1271
cp -p build/tapset/hotspot.stp $(d_jrehl)/usr/share/systemtap/tapset/
1093
1274
: # Install stuff to generate font config and timezone files.
1094
1275
mkdir -p $(d_lib)/$(basedir)/jre/lib
1095
cp -p openjdk/build/linux-$(jvmarch)/btjars/compilefontconfig.jar \
1276
cp -p build/openjdk/build/linux-$(jvmarch)/btjars/compilefontconfig.jar \
1096
1277
$(d_lib)/$(basedir)/jre/lib/
1097
cp -p openjdk/build/linux-$(jvmarch)/btjars/javazic.jar \
1278
cp -p build/openjdk/build/linux-$(jvmarch)/btjars/javazic.jar \
1098
1279
$(d_lib)/$(basedir)/jre/lib/
1100
1281
: # install lintian overrides
1106
1287
nodocs = $(if $(findstring nodocs, $(DEB_BUILD_OPTIONS)),-N$(p_doc))
1107
1288
nodemo = $(if $(findstring cacao, $(PKGSOURCE)),-N$(p_demo))
1289
nojrec = $(if $(filter cacao, $(alternate_vms)),,-N$(p_jrec))
1290
nojrez = $(if $(filter zero, $(alternate_vms)),,-N$(p_jrez))
1109
1292
# Build architecture independant packages
1110
1293
binary-indep: build install
1113
ifneq (,$(findstring cacao, $(PKGSOURCE)))
1114
: # not building any binary-indep packages for cacao
1116
ifeq ($(with_docs),yes)
1296
ifeq ($(with_docs),yes)
1117
1297
dh_installchangelogs -p$(p_doc)
1118
1298
dh_installdocs -p$(p_doc)
1119
1299
mkdir -p $(d_doc)/usr/share/doc/$(p_jre)
1120
for i in openjdk/build/linux-$(jvmarch)/docs/*; do \
1300
for i in build/openjdk/build/linux-$(jvmarch)/docs/*; do \
1121
1301
[ -e $$i ] || continue; \
1122
1302
b=$$(basename $$i); \
1123
1303
cp -a $$i $(d_doc)/usr/share/doc/$(p_jre)/; \
1124
1304
ln -sf ../$(p_jre)/$$b $(d_doc)/usr/share/doc/$(p_doc)/$$b; \
1127
ifneq (,$(findstring openjdk-, $(PKGSOURCE)))
1128
dh_installdocs -p$(p_tar)
1129
dh_installchangelogs -p$(p_tar)
1130
mkdir -p $(d_tar)/usr/src
1131
cp -p $(OPENJDK_SRC_ZIP) $(d_tar)/usr/src/
1133
1307
dh_installmenu -i $(nodocs)
1134
1308
-dh_icons -i $(nodocs) || dh_iconcache -i $(nodocs)
1135
1309
# dh_installdebconf -i $(nodocs)
1160
1333
cp -p $$i $(d_jrehl)/usr/share/doc/$(p_jre)/$$i.IcedTea; \
1162
1335
mkdir -p $(d_jdk)/usr/share/doc/$(p_jre)
1163
cp mauve/mauve_output $(d_jdk)/usr/share/doc/$(p_jre)/mauve_output.log
1164
cp jtreg_output $(d_jdk)/usr/share/doc/$(p_jre)/jtreg_output.log
1165
-cp test/jtreg-summary.log $(d_jdk)/usr/share/doc/$(p_jre)/
1336
cp build/mauve-$(default_vm)/mauve_output-$(default_vm) \
1337
$(d_jdk)/usr/share/doc/$(p_jre)/mauve_output-$(default_vm).log
1338
cp jtreg_output-$(default_vm) \
1339
$(d_jdk)/usr/share/doc/$(p_jre)/jtreg_output-$(default_vm).log
1340
-cp build/test/jtreg-summary-$(default_vm).log build/test/check-*-$(default_vm).log \
1341
$(d_jdk)/usr/share/doc/$(p_jre)/
1342
-cp build/test/failed_tests-$(default_vm).tar.gz $(d_jdk)/usr/share/doc/$(p_jre)/
1167
dh_installmenu -s $(nodemo)
1168
-dh_icons -s $(nodemo) || dh_iconcache -s $(nodemo)
1169
# dh_installdebconf -s $(nodemo)
1170
dh_link -s $(nodemo)
1171
dh_strip -s $(nodemo) --dbg-package=$(p_dbg)
1172
dh_compress -s $(nodemo)
1173
dh_fixperms -s $(nodemo)
1344
ifneq (,$(filter cacao, $(alternate_vms)))
1345
dh_installchangelogs -p$(p_jrec)
1346
dh_installdocs -p$(p_jrec)
1347
mkdir -p $(d_jrec)/usr/share/doc/$(p_jre)
1348
-cp build/mauve-cacao/mauve_output-cacao \
1349
$(d_jrec)/usr/share/doc/$(p_jre)/mauve_output-cacao.log
1350
-cp jtreg_output-cacao \
1351
$(d_jrec)/usr/share/doc/$(p_jre)/jtreg_output-cacao.log
1352
-cp build/test/jtreg-summary-cacao.log build/test/check-*-cacao.log \
1353
$(d_jrec)/usr/share/doc/$(p_jre)/
1354
-cp build/test/failed_tests-cacao.tar.gz $(d_jrec)/usr/share/doc/$(p_jre)/
1356
ifneq (,$(filter zero, $(alternate_vms)))
1357
mkdir -p $(d_jrez)/usr/share/doc/$(p_jre)
1358
-cp build/mauve-zero/mauve_output-zero \
1359
$(d_jrez)/usr/share/doc/$(p_jre)/mauve_output-zero.log
1360
-cp jtreg_output-zero \
1361
$(d_jrez)/usr/share/doc/$(p_jre)/jtreg_output-zero.log
1362
-cp build/test/jtreg-summary-zero.log build/test/check-*-zero.log \
1363
$(d_jrez)/usr/share/doc/$(p_jre)/
1364
-cp build/test/failed_tests-zero.tar.gz $(d_jrez)/usr/share/doc/$(p_jre)/
1366
dh_desktop -s $(nodemo) $(nojrec) $(nojrez)
1367
dh_installmenu -s $(nodemo) $(nojrec) $(nojrez)
1368
-dh_icons -s $(nodemo) $(nojrec) $(nojrez) || dh_iconcache -s $(nodemo) $(nojrec) $(nojrez)
1369
# dh_installdebconf -s $(nodemo) $(nojrec) $(nojrez)
1370
dh_link -s $(nodemo) $(nojrec) $(nojrez)
1371
dh_strip -s $(nodemo) $(nojrec) $(nojrez) --dbg-package=$(p_dbg)
1372
dh_compress -s $(nodemo) $(nojrec) $(nojrez)
1373
dh_fixperms -s $(nodemo) $(nojrec) $(nojrez)
1174
1374
dh_makeshlibs -p$(p_jrehl) -p$(p_jre)
1175
dh_shlibdeps -s $(nodemo) -L $(p_jrehl) \
1375
dh_shlibdeps -s $(nodemo) $(nojrec) $(nojrez) -L $(p_jrehl) \
1176
1376
-l$(shlibdeps_ld_path) \
1178
dh_installdeb -s $(nodemo)
1179
dh_gencontrol -s $(nodemo) -- $(control_vars)
1180
dh_md5sums -s $(nodemo)
1181
dh_builddeb -s $(nodemo) #$(bd_options)
1378
dh_installdeb -s $(nodemo) $(nojrec) $(nojrez)
1379
dh_gencontrol -s $(nodemo) $(nojrec) $(nojrez) -- $(control_vars)
1380
dh_md5sums -s $(nodemo) $(nojrec) $(nojrez)
1381
dh_builddeb -s $(nodemo) $(nojrec) $(nojrez) #$(bd_options)
1183
1383
binary: binary-arch binary-indep
1184
1384
.PHONY: build clean binary-indep binary-arch binary install