~openjdk/openjdk/openjdk8

« back to all changes in this revision

Viewing changes to rules

  • Committer: Matthias Klose
  • Date: 2009-05-27 10:08:07 UTC
  • mfrom: (305.1.57 openjdk6)
  • Revision ID: doko@canonical.com-20090527100807-7kn11m6ux57am1y1
* Merge debian packaging r205:362 from openjdk-6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
DEB_HOST_ARCH           ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
17
17
 
18
18
# don't use it on 64bit archs
19
 
ifeq (,$(filter $(DEB_HOST_ARCH), alpha amd64 ppc64 s390x))
 
19
ifeq (,$(filter $(DEB_HOST_ARCH), alpha amd64 hppa ppc64 s390x))
20
20
  PATH := $(CURDIR)/bin:$(PATH)
21
21
  export PATH
22
22
endif
25
25
PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
26
26
PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
27
27
 
 
28
hotspot_archs   = amd64 i386 lpia sparc
 
29
shark_archs     = amd64 i386 lpia
 
30
shark_archs     =
 
31
no_bootstrap_archs = alpha armel
 
32
 
 
33
VENDOR          = openjdk
 
34
Vendor          = OpenJDK
 
35
TOP             = usr/lib/jvm
 
36
jdirname        = java-$(shortver)-$(origin)
 
37
origin          = openjdk
 
38
basename        = openjdk-$(shortver)
 
39
ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
 
40
  priority      = 1061
 
41
  vm_name       = Hotspot JIT
 
42
else ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
 
43
  priority      = 1055
 
44
  vm_name       = Hotspot Shark
 
45
else
 
46
  priority      = 1053
 
47
  vm_name       = Hotspot Zero
 
48
endif
 
49
p_lib_arch      = all
 
50
jvmver          = 1.7.0
 
51
shortver        = 7
 
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
 
57
 
28
58
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
29
59
COMMA=,
 
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)
41
72
 
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
46
77
endif
47
78
 
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
52
81
 
53
82
distribution := $(shell lsb_release --id --short)
54
83
distrel := $(shell lsb_release --codename --short)
55
84
 
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)
57
86
 
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
60
89
 
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))))
65
94
 
66
 
hotspot_archs   = amd64 i386 lpia sparc
67
 
hotspot_archs   = amd64 lpia sparc
68
 
shark_archs     = i386
69
 
no_bootstrap_archs = alpha hppa
 
95
default_vm = $(if $(filter $(DEB_HOST_ARCH), $(hotspot_archs)),hotspot,zero)
70
96
 
71
 
stage1_gcj_archs =
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 =
74
102
 
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))
 
105
altzero_archs =
 
106
 
 
107
ifneq (,$(filter $(DEB_HOST_ARCH), $(cacao_archs)))
 
108
  alternate_vms += cacao
 
109
endif
 
110
ifneq (,$(filter $(DEB_HOST_ARCH), $(altzero_archs)))
 
111
  ifneq (,$(filter $(DEB_HOST_ARCH), $(shark_archs)))
 
112
    alternate_vms += shark
 
113
  else
 
114
    alternate_vms += zero
 
115
  endif
79
116
endif
80
117
 
81
118
ifneq (,$(filter $(DEB_HOST_ARCH), $(stage1_gcj_archs)))
91
128
  $(error unknown bootstrap method for architecture $(DEB_HOST_ARCH))
92
129
endif
93
130
 
94
 
OPENJDK_VERSION = b40
 
131
OPENJDK_VERSION = b59
95
132
OPENJDK_SRC_ZIP = openjdk-7-ea-src-$(OPENJDK_VERSION)-20_nov_2008-dfsg.tar.gz
96
133
# the version of the build dependency for non-bootstrap builds; only adjust if
97
134
# the package is installable on all these architectures.
98
 
req_openjdk_bd_ver = 6b11
99
 
req_openjdk_ver = 6b40
 
135
req_openjdk_bd_ver = 6b14
 
136
req_openjdk_ver = 7b59
100
137
 
101
138
unexport CFLAGS CXXFLAGS CPPFLAGS FFLAGS LDFLAGS
102
139
 
108
145
  ifneq (,$(filter $(DEB_HOST_ARCH), amd64 powerpc sparc))
109
146
    export GCC_SUFFIX = -4.2
110
147
  endif
111
 
else
 
148
else ifneq (,$(filter $(distrel),lenny intrepid jaunty squeeze sid))
112
149
  export GCC_SUFFIX = -4.3
113
150
  export GCJ_SUFFIX = -4.3
114
 
endif
115
 
 
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)
 
151
else
 
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
119
157
  endif
120
158
endif
121
159
 
122
 
ifneq (,$(filter $(distrel),jaunty))
 
160
ifneq (,$(filter $(distrel),jaunty karmic unstable experimental sid))
123
161
  with_pulse = yes
124
162
endif
125
163
 
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
 
166
endif
 
167
 
 
168
#ifneq (,$(filter $(distrel),karmic unstable experimental sid))
 
169
#  with_systemtap = yes
 
170
#endif
 
171
 
 
172
with_hotspot = new
 
173
ifneq (,$(filter $(distrel),gutsy feisty edgy dapper hardy intrepid))
 
174
  with_hotspot = original
 
175
endif
 
176
 
 
177
ifeq ($(with_hotspot),original)
 
178
#       $(if $(filter $(distribution),Ubuntu),debian/patches/gcc-no-stack-protector-original.diff) \
 
179
 
 
180
  DISTRIBUTION_PATCHES = \
 
181
        debian/patches/ld-symbolic-functions-original.diff \
 
182
        debian/patches/set-exec-name-original.diff
 
183
else
 
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) \
 
186
 
 
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
 
191
endif
 
192
 
 
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 \
138
205
 
139
206
#       debian/patches/gcc-mtune-generic.diff \
140
207
 
145
212
endif
146
213
 
147
214
ifeq ($(distribution),Ubuntu)
148
 
  DISTRIBUTION_PATCHES += debian/patches/openjdk-ubuntu-branding.patch
149
 
endif
150
 
 
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
 
221
  else
 
222
    DISTRIBUTION_PATCHES += \
 
223
        debian/patches/gcc-hotspot-no-stack-protector.diff
 
224
  endif
154
225
endif
155
226
 
 
227
# FIXME: temporarily disabled
 
228
#ifneq (,$(filter $(DEB_HOST_ARCH),armel))
 
229
#  DISTRIBUTION_PATCHES += \
 
230
#       debian/patches/zero-hotspot-opt.diff
 
231
#endif
 
232
 
156
233
export DISTRIBUTION_PATCHES
157
234
 
158
235
ifeq ($(STAGE1_JAVA),gcj)
161
238
        --with-ecj=/usr/bin/ecj \
162
239
        --with-java=$(STAGE1_HOME)/bin/java \
163
240
        --with-javah=/usr/bin/gjavah$(GCJ_SUFFIX) \
164
 
        --with-rmic=/usr/bin/grmic$(GCJ_SUFFIX) \
165
 
        --with-libgcj-jar=/usr/share/java/libgcj$(GCJ_SUFFIX).jar
 
241
        --with-rmic=/usr/bin/grmic$(GCJ_SUFFIX)
166
242
  ifeq (,$(filter ia64, $(DEB_HOST_ARCH)))
167
243
    CONFIGURE_ARGS += \
168
244
        --with-jar=/usr/bin/fastjar
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
192
 
  endif
 
265
ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) ia64 powerpc))
 
266
  CONFIGURE_ARGS += --with-alt-jar=/usr/bin/fastjar
193
267
endif
194
268
 
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)))
200
 
 
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
 
280
 
 
281
#CONFIGURE_ARGS += --disable-nimbus --disable-nimbus-generation
 
282
 
 
283
ifneq (,$(filter $(DEB_HOST_ARCH), $(cacao_archs)))
202
284
  CONFIGURE_ARGS += \
203
 
        --enable-cacao \
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)'
207
288
  else
208
289
    EXTRA_BUILD_ENV = CACAO_CONFIGURE_ARGS='--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)'
209
290
  endif
 
291
endif
 
292
 
 
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
 
297
  endif
 
298
endif
 
299
 
 
300
ifeq ($(with_hotspot),original)
 
301
  CONFIGURE_ARGS += --without-hotspot-build
210
302
else
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
215
 
    endif
216
 
  else
217
 
    CONFIGURE_ARGS += --with-hotspot-build
218
 
  endif
219
 
  ifeq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
220
 
    EXTRA_BUILD_ENV = LIBFFI_LIBS=-lffi_pic
221
 
  endif
 
303
  CONFIGURE_ARGS += --with-hotspot-build
222
304
endif
223
305
 
 
306
EXTRA_BUILD_ENV += LIBFFI_LIBS=-lffi_pic
 
307
 
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
228
312
  endif
229
313
else
244
328
  CONFIGURE_ARGS += --enable-pulse-java
245
329
endif
246
330
 
 
331
ifeq ($(with_systemtap),yes)
 
332
  CONFIGURE_ARGS += --enable-systemtap --with-abs-install-dir=/$(basedir)
 
333
endif
 
334
 
 
335
ifneq (,$(alternate_vms))
 
336
  CONFIGURE_ARGS += --with-additional-vms=$(subst $(SPACE),$(COMMA),$(alternate_vms))
 
337
endif
 
338
 
247
339
CONFIGURE_ARGS += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
248
340
 
249
 
VENDOR          := openjdk
250
 
Vendor          := OpenJDK
251
 
 
252
 
TOP             = usr/lib/jvm
253
 
jdirname        = java-$(shortver)-$(origin)
254
 
ifneq (,$(findstring cacao, $(PKGSOURCE)))
255
 
  origin        = cacao
256
 
  basename      = cacao-oj$(shortver)
257
 
  priority      = 1059
258
 
  p_lib_arch    = any
259
 
  vm_name       = CacaoVM JIT
260
 
else
261
 
  origin        = openjdk
262
 
  basename      = openjdk-$(shortver)
263
 
  ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs)))
264
 
    priority    = 1061
265
 
    vm_name     = Hotspot JIT
266
 
  else
267
 
    priority    = 1057
268
 
    vm_name     = Hotspot Zero
269
 
  endif
270
 
  p_lib_arch    = all
271
 
endif
272
 
jvmver          = 1.7.0
273
 
shortver        = 7
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
279
 
 
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))
285
346
 
287
348
jre_hl_tools_alt= $(filter-out $(corba_tools), $(jre_hl_tools)) $(corba_tools)
288
349
jre_tools_alt   = $(filter-out kinit klist ktab, $(jre_tools))
289
350
 
290
 
all_jdk_tools   = $(notdir $(wildcard $(sdkimg)/bin/*))
 
351
all_jdk_tools   = $(notdir $(wildcard build/$(sdkimg)/bin/*))
291
352
jdk_tools       = $(filter-out $(all_jre_tools), $(all_jdk_tools))
292
353
jdk_tools_alt   = $(filter-out java-rmi.cgi, $(jdk_tools))
293
354
 
301
362
bd_bootstrap =
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))
 
367
    bd_bootstrap += \
 
368
        gcj-jdk [$(strip $(foreach a,$(stage1_gcj_archs), $(a)))],
 
369
  else
 
370
    bd_bootstrap += \
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)))],
 
373
  endif
307
374
endif
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)))],
315
382
endif
316
 
bd_tarball = $(if $(findstring openjdk, $(PKGSOURCE)),,$(p_tar) (>= 6b40)$(COMMA) $(p_tar) (<< 6b41)$(COMMA))
317
 
bd_cacao = libtool,
318
 
bd_cacao = $(if $(findstring cacao, $(PKGSOURCE)),cacao-source (>= 0.99.4~20081012)$(COMMA))
319
 
bd_gcc = \
320
 
        g++-4.2 [amd64 powerpc sparc], g++-4.1 [i386 lpia],
321
 
ifeq (,$(filter $(distrel),hardy gutsy feisty edgy dapper))
322
 
  bd_gcc = \
323
 
        g++-4.3,
 
383
 
 
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))
 
387
  bd_gcc = g++-4.3,
 
388
else
 
389
  bd_gcc = g++-4.4 [!sparc], g++-4.3 [sparc],
324
390
endif
325
391
bd_syslibs = \
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,
332
 
bd_zero = \
333
 
        $(if $(filter $(distribution),Ubuntu),$(if $(filter $(distrel),hardy),libffi4-dev,libffi-dev),libffi-dev) [$(foreach a,$(hotspot_archs),!$(a))],
334
 
bd_shark = \
335
 
        llvm-dev (>= 2.4) [$(foreach a,$(shark_archs),$(a))],
336
 
bd_shark =
337
 
#ifeq ($(with_plugin_pkg),yes)
338
 
  bd_plugin = \
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)),
340
 
#endif
 
398
bd_openjdk += \
 
399
        libxpp3-java, libjibx-java,
 
400
 
 
401
pkg_ffidev = $(if $(filter $(distribution),Ubuntu),$(if $(filter $(distrel),hardy),libffi4-dev,libffi-dev),libffi-dev)
 
402
 
 
403
bd_zero = \
 
404
        $(pkg_ffidev) [$(foreach a,$(hotspot_archs),!$(a))],
 
405
bd_zero = \
 
406
        $(pkg_ffidev),
 
407
 
 
408
ifneq (,$(shark_archs))
 
409
  bd_zero = $(pkg_ffidev),
 
410
  bd_shark = llvm-dev (>= 2.5) [$(foreach a,$(shark_archs),$(a))],
 
411
endif
 
412
 
 
413
bd_cacao = libtool,
 
414
ifneq ($(distribution),Ubuntu)
 
415
  bd_cacao += cacao-source (>= 0.99.4-1),
 
416
endif
 
417
 
 
418
bd_plugin = \
 
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),
353
432
endif
 
433
ifeq ($(with_systemtap),yes)
 
434
  bd_systemtap = systemtap-sdt-dev,
 
435
endif
354
436
 
355
437
dlopen_hl_depends = \
356
438
        $(if $(filter $(distrel), etch dapper edgy gutsy hardy),libcupsys2,libcups2), \
357
 
        liblcms1
 
439
        liblcms1, libjpeg62
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 =
363
445
 
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
 
449
else
 
450
  browser_plugin_dirs = mozilla
 
451
endif
366
452
 
367
453
ifneq (,$(filter $(distrel),etch dapper feisty))
368
454
  core_fonts = ttf-dejavu
382
468
 
383
469
p_jre   = $(basename)-jre
384
470
p_jrehl = $(basename)-jre-headless
 
471
p_jrec  = icedtea-$(shortver)-jre-cacao
 
472
p_jrez  = $(basename)-jre-zero
385
473
p_lib   = $(basename)-jre-lib
386
474
p_jdk   = $(basename)-jdk
387
475
p_demo  = $(basename)-demo
388
476
p_src   = $(basename)-source
389
477
p_doc   = $(basename)-doc
390
478
p_dbg   = $(basename)-dbg
391
 
p_tar   = openjdk-$(shortver)-source-files
392
 
p_plug = $(if $(findstring openjdk,$(PKGSOURCE)),icedtea$(shortver)-plugin,$(basename)-plugin)
 
479
p_plug = icedtea7-plugin
393
480
 
394
481
d       = debian/tmp
395
482
d_jre   = debian/$(p_jre)
396
483
d_jrehl = debian/$(p_jrehl)
 
484
d_jrec  = debian/$(p_jrec)
 
485
d_jrez  = debian/$(p_jrez)
397
486
d_lib   = debian/$(p_lib)
398
487
d_jdk   = debian/$(p_jdk)
399
488
d_demo  = debian/$(p_demo)
400
489
d_src   = debian/$(p_src)
401
490
d_doc   = debian/$(p_doc)
402
491
d_dbg   = debian/$(p_dbg)
403
 
d_tar   = debian/$(p_tar)
404
492
d_plug  = debian/$(p_plug)
405
493
 
406
494
control_vars = \
420
508
  control_vars += '-Vdpkg:Depends=dpkg (>= 1.10.24)'
421
509
endif
422
510
 
 
511
ifneq (,$(filter-out $(hotspot_archs), $(cacao_archs)))
 
512
  control_vars += '-Vcacao:Recommends=$(p_jrec) (= $${binary:Version})'
 
513
endif
 
514
 
 
515
# FIXME, temporarily disabled
 
516
#ifeq ($(with_jni_bridge),yes)
 
517
#  control_vars += '-Vdep:bridge=libaccess-bridge-java'
 
518
#else
 
519
#  control_vars += '-Vdep:bridge=libaccess-bridge-java-jni'
 
520
#endif
 
521
 
423
522
debian/control: debian/control.in debian/rules
424
523
        @cp -p debian/control debian/control.old
425
524
        sed \
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) \
448
551
                > debian/control
449
552
        @if cmp -s debian/control debian/control.old; then \
450
553
          rm -f debian/control.old; \
498
601
 
499
602
icedtea-configure: stamps/icedtea-configure
500
603
stamps/icedtea-configure:
501
 
ifeq (0,1)
502
 
        for i in $$(find test/jtreg -name '*.uu'); do \
503
 
          [ -f $$i ] || continue; \
504
 
          d=$$(dirname $$i); i=$$(basename $$i .uu); \
505
 
          rm -f $$d/$$i; \
506
 
          (cd $$d && uudecode $$i.uu); \
507
 
        done
508
 
endif
 
604
        rm -f rt/net/sourceforge/jnlp/runtime/InstallDialog.java
509
605
 
510
606
        mkdir -p bin
511
607
        ( \
524
620
        test -x /usr/bin/linux32 && linux32 uname -a || true
525
621
        test -x /usr/bin/linux32 &&linux32 /bin/uname -a || true
526
622
 
 
623
# FIXME: temporarily disabled
 
624
#       patch --verbose -p0 < debian/patches/zero-port-opt.diff
 
625
 
527
626
        mkdir -p stamps
 
627
        mkdir -p build
528
628
        chmod +x configure
529
 
        $(EXTRA_BUILD_ENV) ./configure $(CONFIGURE_ARGS)
 
629
        cd build && $(EXTRA_BUILD_ENV) ../configure $(CONFIGURE_ARGS)
530
630
        touch $@
531
631
 
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
 
637
endif
535
638
        touch $@
536
639
 
537
640
dist-openjdk: $(OPENJDK_SRC_ZIP)
538
641
        @echo "downloading openjdk source from hg to create zipfile: $(OPENJDK_SRC_ZIP)"
539
 
        $(MAKE) $@
540
 
 
541
 
stamps/backup-generated: stamps/icedtea-configure
542
 
        if [ -f generated.tar ]; then \
543
 
          echo >&2 "backup of generated files already exists"; \
544
 
          exit 2; \
545
 
        fi
546
 
        tar cf generated.tar generated
547
 
        touch $@
 
642
        $(MAKE) -C build $@
548
643
 
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
553
648
endif
554
 
        $(MAKE) stamps/patch.stamp
 
649
        $(MAKE) -C build stamps/patch.stamp
555
650
        touch $@
556
651
 
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
562
 
    endif
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
566
 
    endif
567
 
  else
568
 
    ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia powerpc sparc))
569
 
      with_mauve_check = yes
570
 
    endif
571
 
    ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia sparc))
572
 
      with_jtreg_check = yes
573
 
    endif
574
 
  endif
 
653
    ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) alpha armel ia64 mips mipsel powerpc s390))
 
654
      with_mauve_check = $(default_vm)
 
655
    endif
 
656
    ifneq (,$(filter $(DEB_HOST_ARCH), $(hotspot_archs) alpha armel ia64 mips mipsel powerpc s390))
 
657
      with_jtreg_check = $(default_vm)
 
658
    endif
 
659
 
 
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
 
664
      endif
 
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
 
668
      endif
 
669
    endif
 
670
 
 
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
 
675
      endif
 
676
      ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 lpia))
 
677
        # only activate after testing; hangs several tests.
 
678
        with_jtreg_check += zero
 
679
      endif
 
680
    endif
575
681
endif
576
682
 
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)
 
687
 
 
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 || :; \
583
694
 
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 &'
587
698
endif
588
 
        $(EXTRA_BUILD_ENV) $(MAKE) $(build_target)
 
699
        if $(EXTRA_BUILD_ENV) $(MAKE) -C build $(build_target); then \
 
700
          : ; \
 
701
        else \
 
702
          if [ -f buildwatch.pid ]; then \
 
703
            pid=$$(cat buildwatch.pid); \
 
704
            kill -1 $$pid || :; sleep 1; kill -9 $$pid || :; \
 
705
          fi; \
 
706
          false; \
 
707
        fi
589
708
        touch $@
590
709
 
591
710
stamps/xvfb-check:
592
711
        mkdir -p bin
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; \
606
725
        fi
607
726
        touch $@
608
727
 
 
728
stamps/mauve-check-default: stamps/build stamps/xvfb-check
 
729
        $(MAKE) -f debian/rules mauve-run-check VMNAME=$(default_vm) VMARGS=
 
730
        touch $@
 
731
 
 
732
stamps/mauve-check-cacao: stamps/xvfb-check
 
733
        $(MAKE) -f debian/rules mauve-run-check VMNAME=cacao VMARGS='-vmarg -cacao'
 
734
        touch $@
 
735
 
 
736
stamps/mauve-check-zero: stamps/xvfb-check
 
737
        $(MAKE) -f debian/rules mauve-run-check VMNAME=zero VMARGS='-vmarg -zero'
 
738
        touch $@
 
739
 
609
740
stamps/mauve-build: stamps/build
610
 
        rm -rf mauve
611
 
        mkdir -p mauve
 
741
        rm -rf build/mauve
 
742
        mkdir -p build/mauve
612
743
ifeq ($(with_mauve_check),yes)
613
 
        tar xf /usr/src/mauve.tar.gz
614
 
        cd mauve \
 
744
        tar -x -C build -f /usr/src/mauve.tar.gz
 
745
        cd build/mauve \
615
746
            && aclocal \
616
747
            && automake \
617
748
            && autoconf \
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
620
752
endif
621
753
        touch $@
622
754
 
623
755
stamps/mauve-check: stamps/build stamps/mauve-build stamps/xvfb-check
624
 
ifeq ($(with_mauve_check),yes)
 
756
 
 
757
mauve-run-check:
 
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) \
 
763
            && aclocal \
 
764
            && automake \
 
765
            && autoconf \
 
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)
 
769
 
625
770
        if [ -f bin/my-xvfb-run ]; then \
626
 
          cd mauve && \
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 \
 
776
                    $(VMARGS) \
631
777
                    -file $(CURDIR)/debian/mauve_tests \
632
778
                    -timeout 30000 2>&1 \
633
 
                | tee mauve_output; \
 
779
                | tee mauve_output-$(VMNAME); \
634
780
        else \
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); \
637
784
        fi
638
785
        @sleep 5
639
786
else
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)
641
790
endif
642
 
        touch $@
643
791
 
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}'
649
 
 
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}'
 
797
 
 
798
stamps/jtreg-check-default: stamps/build stamps/xvfb-check
 
799
        $(MAKE) -f debian/rules jtreg-run-check VMNAME=$(default_vm) VMARGS=
 
800
        touch $@
 
801
 
 
802
stamps/jtreg-check-cacao: stamps/build stamps/xvfb-check
 
803
        $(MAKE) -f debian/rules jtreg-run-check VMNAME=cacao VMARGS='-vmoption:-cacao'
 
804
        touch $@
 
805
 
 
806
stamps/jtreg-check-zero: stamps/build stamps/xvfb-check
 
807
        $(MAKE) -f debian/rules jtreg-run-check VMNAME=zero VMARGS='-vmoption:-zero'
 
808
        touch $@
 
809
 
 
810
jtreg-run-check:
 
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); \
655
816
        else \
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); \
658
819
        fi
659
820
        @echo "END jtreg"
660
821
 
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; \
 
825
          else \
 
826
            mkdir -p build/test; \
 
827
            cp jtreg_output-$(VMNAME) build/test/$${i%*.log}-$(VMNAME).log; \
 
828
          fi; \
 
829
        done
 
830
 
 
831
        @echo "BEGIN jtreg-summary-$(VMNAME)"
 
832
        -cat build/test/jtreg-summary-$(VMNAME).log
 
833
        @echo "END jtreg-summary-$(VMNAME)"
664
834
 
665
835
        : # kill testsuite processes still hanging
666
836
        @pids=$$($(jtreg_pids)); \
684
854
          echo "leftover processes..."; \
685
855
          $(jtreg_processes); \
686
856
        fi
 
857
 
 
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; \
 
861
          done; \
 
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
687
864
else
688
 
        echo "jtreg harness not run for this build" > jtreg_output
 
865
        echo "jtreg harness not run for this build" > jtreg_output-$(VMNAME)
689
866
endif
690
 
        touch $@
691
867
 
692
868
clean: debian-clean
693
869
        dh_testdir
694
870
        dh_testroot
695
 
        rm -rf stamps
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
700
 
        rm -rf mauve
701
873
        rm -rf bin
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 \
705
 
          rm -rf generated; \
706
 
          tar xf generated.tar; \
707
 
          rm -f generated.tar; \
 
876
 
 
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; \
708
880
        fi
709
881
 
710
 
ifeq (0,1)
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 \
714
 
            rm -f $$i; \
715
 
          else \
716
 
           d=$$(dirname $$i); i=$$(basename $$i); \
717
 
           (cd $$d && uuencode -m $$i $$i > $$i.uu); \
718
 
           rm -f $$d/$$i; \
719
 
          fi; \
720
 
        done
721
 
endif
722
 
 
723
882
        dh_clean
724
883
 
725
884
debian-clean:
745
904
 
746
905
        : # install into temporary location
747
906
        mkdir -p $(d)/$(basedir)
748
 
        cp -a $(sdkimg)/* $(d)/$(basedir)/
749
 
        cp -a $(jreimg)/man $(d)/$(basedir)/jre/
 
907
        cp -a build/$(sdkimg)/* $(d)/$(basedir)/
 
908
        cp -a build/$(jreimg)/man $(d)/$(basedir)/jre/
750
909
        chmod -R u+w $(d)
751
910
 
752
 
        : # specific to OpenJDK7, or missing explicitely?
753
 
        cp -p openjdk/jdk/src/share/lib/management/snmp.acl.template \
754
 
                debian/tmp/usr/lib/jvm/java-7-openjdk/jre/lib/management/
 
911
        : # install default jvm config file
 
912
        cp debian/jvm.cfg-default $(d)/$(basedir)/jre/lib/$(archdir)/
755
913
 
756
914
        : # add extra symlinks for header files
757
915
        ln -sf linux/jni_md.h $(d)/$(basedir)/include/jni_md.h
821
979
                $(d)/etc/$(jdiralias)/
822
980
 
823
981
        mv $(d)/$(basedir)/jre/lib/fontconfig.Ubuntu.properties.src \
824
 
                $(d)/etc/$(jdiralias)/fontconfig.properties.src
 
982
                $(d)/etc/$(jdiralias)/fontconfig.properties
825
983
        mv $(d)/$(basedir)/jre/lib/fontconfig.Ubuntu.bfc \
826
984
                $(d)/etc/$(jdiralias)/fontconfig.bfc
827
985
 
876
1034
          case "$$i" in \
877
1035
            */$(plugin_name)) continue;; \
878
1036
            */libsplashscreen.so|*/libjsoundalsa.so|$(if $(with_pulse),*/libpulse-java.so|)*/xawt) echo $$i >> ../$(p_jre).install;; \
 
1037
            */cacao) echo $$i >> ../$(p_jrec).install;; \
 
1038
            */zero) echo $$i >> ../$(p_jrez).install;; \
879
1039
            *) echo $$i >> ../$(p_jrehl).install; \
880
1040
          esac; \
881
1041
        done
1003
1163
 
1004
1164
        : # install icons
1005
1165
        for i in 16 24 32 48; do \
1006
 
          install -D -m 644 -p openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon$${i}.png \
 
1166
          install -D -m 644 -p build/openjdk/jdk/src/solaris/classes/sun/awt/X11/java-icon$${i}.png \
1007
1167
            $(d_jre)/usr/share/icons/hicolor/$${i}x$${i}/apps/$(basename).png; \
1008
1168
        done
1009
1169
 
1013
1173
          echo usr/share/doc/$(p_jre) $(basedir)/docs; \
1014
1174
        ) > $(d_jrehl).links
1015
1175
 
 
1176
ifneq (,$(filter zero, $(alternate_vms)))
 
1177
        : # create docdir symlinks for $(p_jrez)
 
1178
        ( \
 
1179
          echo usr/share/doc/$(p_jre) usr/share/doc/$(p_jrez); \
 
1180
        ) > $(d_jrez).links
 
1181
endif
 
1182
 
1016
1183
        : # create docdir symlinks for $(p_src)
1017
1184
        ( \
1018
1185
          echo usr/share/doc/$(p_jre) usr/share/doc/$(p_src); \
1035
1202
          echo usr/share/doc/$(p_jre) usr/share/doc/$(p_lib); \
1036
1203
        ) > $(d_lib).links
1037
1204
 
1038
 
        : # create docdir symlinks for $(p_jdk)
 
1205
        : # create docdir symlinks for $(p_dbg)
1039
1206
        ( \
1040
1207
          echo usr/share/doc/$(p_jre) usr/share/doc/$(p_dbg); \
1041
1208
        ) > $(d_dbg).links
1042
1209
 
1043
 
        : # create links for the gnome accessibility bridge
1044
 
        echo "usr/share/java/gnome-java-bridge.jar $(basedir)/jre/lib/ext/gnome-java-bridge.jar" \
1045
 
            >> $(d_jrehl).links
 
1210
# FIXME: temporarily disabled
 
1211
#       : # create links for the gnome accessibility bridge
 
1212
#       echo "usr/share/java/gnome-java-bridge.jar $(basedir)/jre/lib/ext/gnome-java-bridge.jar" \
 
1213
#           >> $(d_jre).links
 
1214
#ifeq ($(with_jni_bridge),yes)
 
1215
#         echo "usr/lib/jni/libjava-access-bridge-jni.so $(basedir)/jre/lib/ext/libjava-access-bridge-jni.so" \
 
1216
#           >> $(d_jre).links
 
1217
#endif
1046
1218
 
1047
1219
        : # create links for the config files
1048
1220
        find $(d_jrehl)/etc/$(jdiralias) -type f ! -name jvm.cfg \
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
1092
1264
 
 
1265
        : # another jvm symlink
 
1266
        ln -sf $(jdiralias) $(d_jrehl)/usr/lib/jvm/java-$(jvmver)-$(origin)
 
1267
 
 
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/
 
1272
endif
 
1273
 
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/
1099
1280
 
1100
1281
        : # install lintian overrides
1105
1286
 
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))
1108
1291
 
1109
1292
# Build architecture independant packages
1110
1293
binary-indep: build install
1111
1294
        dh_testdir
1112
1295
        dh_testroot
1113
 
ifneq (,$(findstring cacao, $(PKGSOURCE)))
1114
 
        : # not building any binary-indep packages for cacao
1115
 
else
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; \
1125
1305
        done
1126
 
  endif
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/
1132
 
  endif
 
1306
endif
1133
1307
        dh_installmenu -i $(nodocs)
1134
1308
        -dh_icons -i $(nodocs) || dh_iconcache -i $(nodocs)
1135
1309
#       dh_installdebconf -i $(nodocs)
1140
1314
        dh_gencontrol -i $(nodocs) -- $(control_vars)
1141
1315
        dh_md5sums -i $(nodocs)
1142
1316
        dh_builddeb -i $(nodocs) $(bd_options)
1143
 
endif
1144
1317
 
1145
1318
absarchdir = $(CURDIR)/$(d_jrehl)/$(basedir)/jre/lib/$(archdir)
1146
1319
shlibdeps_ld_path =$(absarchdir):$(absarchdir)/client:$(absarchdir)/server:$(absarchdir)/native_threads
1160
1333
          cp -p $$i $(d_jrehl)/usr/share/doc/$(p_jre)/$$i.IcedTea; \
1161
1334
        done
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)/
1166
1343
 
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)/
 
1355
endif
 
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)/
 
1365
endif
 
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) \
1177
1377
                --
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)
1182
1382
 
1183
1383
binary: binary-arch binary-indep
1184
1384
.PHONY: build clean binary-indep binary-arch binary install