~ubuntu-branches/ubuntu/trusty/gnat-4.6/trusty-proposed

« back to all changes in this revision

Viewing changes to _MTN/debian/rules2

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta, Aurelien Jarno, Ludovic Brenta, Matthias Klose, Marcin Juszkiewicz, Thorsten Glaser
  • Date: 2011-07-23 01:32:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110723013215-l72pag8p1o09ef8z
Tags: 4.6.1-2

[Aurelien Jarno]
* debian/patches/ada-mips.diff: work around a bootstrap comparison
  failure on mips and mipsel.  Closes: #634881, pending a proper fix.

[Ludovic Brenta]
* debian/patches/pr49819.diff: new.  Closes: #635112.

Merge from gcc-4.6 (4.6.1-4) unstable; urgency=low

* Update to SVN 20110714 (r176280) from the gcc-4_6-branch.
  - Fix PR tree-optimization/49094, PR target/39633, PR c++/49672,
    PR fortran/49698, PR fortran/49690, PR fortran/49562, PR libfortran/49296,
    PR target/49487, PR tree-optimization/49651, PR ada/48711.

[ Matthias Klose ]
* Build Go on alpha for gcc-snapshot builds.
* For multicore ARM, clear both caches, not just the dcache (proposed
  patch by Andrew Haley).
* Fix for PR rtl-optimization/{48830,48808,48792}, taken from the trunk.
  LP: #807573.
* Fix PR tree-optimization/49169, optimisations strip the Thumb/ARM mode bit
  off function pointers (Richard Sandiford). LP: #721531.

[ Marcin Juszkiewicz ]
* Define DEB_TARGET_MULTIARCH macro.
* debian/rules2: Macro and configuration consolidation.

Merge from gcc-4.6 (4.6.1-3) unstable; urgency=medium

* Update to SVN 20110709 (r176108) from the gcc-4_6-branch.
  - Fix PR target/49335, PR tree-optimization/49618, PR c++/49598,
    PR fortran/49479, PR target/49621, PR target/46779, PR target/49660,
    PR c/49644, PR debug/49522, PR debug/49522, PR middle-end/49640,
    PR c++/48157, PR c/49644, PR fortran/48926.
  - Apparently fixes a boost issue. Fixes: #632938.
* Apply proposed patch for PR fortran/49690. Fixes: #631204.

* README.Debian: New section 'Former and/or inactive maintainers'.

Merge from gcc-4.6 (4.6.1-2) unstable; urgency=medium

* Update to SVN 20110705 (r175840) from the gcc-4_6-branch.
  - Fix PR target/47997, PR c++/49528, PR c++/49440, PR c++/49418,
    PR target/44643, PR tree-optimization/49615, PR tree-optimization/49572,
    PR target/34734, PR tree-optimization/49539, PR tree-optimizations/49516,
    PR target/49089, PR rtl-optimization/49014, PR target/48273,
    PR fortran/49466, PR libfortran/49296, PR libffi/46660, PR debug/49262,
    PR rtl-optimization/49472, PR rtl-optimization/49619, PR fortran/49623,
    PR fortran/49540.

[ Matthias Klose ]
* Do not install the spu and hppa64 cross compilers into the multiarch path.
* Update the Linaro support to 20110704.

[ Thorsten Glaser ]
* Apply changes from src:gcc-4.4 for m68k support. Fixes: #632380.
  - debian/rules.defs: Remove m68k from locale_no_cpus.
  - debian/patches/gcc-multiarch.diff: Add m68k multiarch_mappings.
  - debian/patches/pr43804.diff: Fix backported from SVN.
  - debian/rules.patch: Add pr43804.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/make -f
2
 
# -*- makefile -*-
3
 
 
4
 
# Uncomment this to turn on verbose mode.
5
 
#export DH_VERBOSE=1
6
 
 
7
 
.SUFFIXES:
8
 
 
9
 
include debian/rules.defs
10
 
include debian/rules.parameters
11
 
 
12
 
# some tools
13
 
SHELL   = /bin/bash -e          # brace expansion in rules file
14
 
IR      = install -m 644        # Install regular file
15
 
IP      = install -m 755        # Install program
16
 
IS      = install -m 755        # Install script
17
 
 
18
 
#number of jobs to run for build
19
 
ifeq ($(USE_NJOBS),no)
20
 
  NJOBS :=
21
 
  USE_CPUS := 1
22
 
else
23
 
  ifeq ($(with_java),yes)
24
 
    MEM_PER_CPU = 192
25
 
  else
26
 
    MEM_PER_CPU = 128
27
 
  endif
28
 
  NUM_CPUS := $(shell if echo $(USE_NJOBS) | grep -q -E '^[0-9]+$$'; \
29
 
                        then echo $(USE_NJOBS); \
30
 
                        else getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1; fi)
31
 
  USE_CPUS := $(shell mt=`awk '/^MemTotal/ { print $$2 }' /proc/meminfo`; \
32
 
                        awk -vn=$(NUM_CPUS) -vmt=$$mt -vm=$(MEM_PER_CPU) \
33
 
                                'END { mt/=1024; n2 = int(mt/m); print n==1 ? 1 : n2<n+1 ? n2 : n+1}' < /dev/null)
34
 
  ifneq (,$(strip $(USE_CPUS)))
35
 
    NJOBS := -j $(USE_CPUS)
36
 
  endif
37
 
endif
38
 
 
39
 
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
40
 
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
41
 
  NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
42
 
endif
43
 
 
44
 
# kernel-specific ulimit hack
45
 
ifeq ($(findstring linux,$(DEB_HOST_GNU_SYSTEM)),linux)
46
 
  ULIMIT_M =  if [ -e /proc/meminfo ]; then \
47
 
            m=`awk '/^((Mem|Swap)Free|Cached)/{m+=$$2}END{print int(m*.9)}' \
48
 
                /proc/meminfo`; \
49
 
          else \
50
 
            m=`vmstat --free --swap-free --kilobytes|awk '{m+=$$2}END{print int(m*.9)}'`; \
51
 
          fi; \
52
 
          ulimit -m $$m; \
53
 
          echo "Limited memory for test runs to `ulimit -m`kB"
54
 
else
55
 
  ULIMIT_M = true
56
 
endif
57
 
 
58
 
ifeq ($(locale_data),generate)
59
 
  SET_LOCPATH = LOCPATH=$(PWD)/locales
60
 
endif
61
 
 
62
 
SET_PATH = PATH=$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
63
 
ifeq ($(PKGSOURCE),gcc-snapshot)
64
 
  ifneq (,$(findstring arm-linux-gnueabi,$(DEB_TARGET_GNU_TYPE)))
65
 
    SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
66
 
  endif
67
 
  ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
68
 
    SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
69
 
  endif
70
 
  ifneq (,$(findstring ppc64-linux,$(DEB_TARGET_GNU_TYPE)))
71
 
    SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
72
 
  endif
73
 
endif
74
 
 
75
 
# the recipient for the test summaries. Send with: debian/rules mail-summary
76
 
S_EMAIL = gcc@packages.debian.org gcc-testresults@gcc.gnu.org
77
 
 
78
 
# build not yet prepared to take variables from the environment
79
 
define unsetenv
80
 
  unexport $(1)
81
 
  $(1) =
82
 
endef
83
 
$(foreach v, CPPFLAGS CFLAGS CXXFLAGS FFLAGS LDFLAGS, $(if $(filter environment,$(origin $(v))),$(eval $(call unsetenv, $(v)))))
84
 
 
85
 
ifeq ($(REVERSE_CROSS),yes)
86
 
  CC    =
87
 
else
88
 
  CC    = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
89
 
endif
90
 
 
91
 
ifneq ($(distribution),Ubuntu)
92
 
  #ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel armhf mips mipsel))
93
 
  ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
94
 
    STAGE1_CFLAGS = -g -O2
95
 
  endif
96
 
endif
97
 
 
98
 
ifeq ($(with_d),yes)
99
 
  CFLAGS  += -std=gnu99
100
 
  LDFLAGS += -lm
101
 
endif
102
 
 
103
 
ifeq ($(with_ssp_default),yes)
104
 
  STAGE1_CFLAGS = -g
105
 
  BOOT_CFLAGS   = -g -O2
106
 
  LIBCFLAGS             = -g -O2
107
 
  LIBCXXFLAGS   = -g -O2 -fno-implicit-templates
108
 
  # Only use -fno-stack-protector when known to the stage1 compiler.
109
 
  cc-fno-stack-protector := $(shell if $(CC) $(CFLAGS) -fno-stack-protector \
110
 
                             -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
111
 
                                                         then echo "-fno-stack-protector"; fi;)
112
 
  $(foreach var,STAGE1_CFLAGS BOOT_CFLAGS LIBCFLAGS LIBCXXFLAGS,$(eval \
113
 
    $(var) += $(cc-fno-stack-protector)))
114
 
endif
115
 
 
116
 
ifeq ($(DEB_CROSS),yes)
117
 
  CFLAGS        = -g -O2
118
 
endif
119
 
 
120
 
ifneq (,$(findstring static,$(DEB_BUILD_OPTIONS)))
121
 
  LDFLAGS       += -static
122
 
endif
123
 
 
124
 
CFLAGS_TO_PASS = \
125
 
        $(if $(CFLAGS),CFLAGS="$(CFLAGS)") \
126
 
        $(if $(BOOT_CFLAGS),BOOT_CFLAGS="$(BOOT_CFLAGS)") \
127
 
        $(if $(LIBCFLAGS),LIBCFLAGS="$(LIBCFLAGS)") \
128
 
        $(if $(LIBCXXFLAGS),LIBCXXFLAGS="$(LIBCXXFLAGS)")
129
 
LDFLAGS_TO_PASS = \
130
 
        $(if $(LDFLAGS),LDFLAGS="$(LDFLAGS)")
131
 
STAGE1_CFLAGS_TO_PASS = \
132
 
        $(if $(STAGE1_CFLAGS),STAGE1_CFLAGS="$(STAGE1_CFLAGS)")
133
 
 
134
 
docdir          = usr/share/doc
135
 
 
136
 
CONFARGS = -v \
137
 
        --with-pkgversion='$(distribution)$(if $(with_linaro_branch),/Linaro)___$(DEB_VERSION)' \
138
 
        --with-bugurl='file:///usr/share/doc/$(PKGSOURCE)/README.Bugs'
139
 
 
140
 
CONFARGS += \
141
 
        --enable-languages=$(subst $(SPACE),$(COMMA),$(enabled_languages)) \
142
 
        --prefix=/$(PF)
143
 
 
144
 
ifeq ($(versioned_packages),yes)
145
 
  CONFARGS += --program-suffix=-$(BASE_VERSION)
146
 
endif
147
 
 
148
 
# if this variable exists at all, it's reasonable to use it, giving us
149
 
# multiarch support for free
150
 
ifneq ($(DEB_HOST_MULTIARCH),)
151
 
  MULTIARCH_CONFARG = --with-multiarch-defaults=$(DEB_HOST_MULTIARCH)
152
 
endif
153
 
 
154
 
ifdef DEB_STAGE
155
 
  CONFARGS += \
156
 
        --disable-libgomp  \
157
 
        --disable-libmudflap  \
158
 
        --disable-libssp \
159
 
        --disable-multiarch \
160
 
        --disable-multilib  \
161
 
        --disable-threads \
162
 
        --libexecdir=/$(libexecdir) \
163
 
        --libdir=/$(PF)/$(libdir) \
164
 
        --with-build-sysroot=$(with_build_sysroot) \
165
 
        --with-sysroot=$(with_sysroot)
166
 
 
167
 
  ifeq ($(DEB_STAGE),stage1)
168
 
    CONFARGS += \
169
 
        --disable-shared  \
170
 
        --with-newlib  \
171
 
        --without-headers
172
 
  else
173
 
    # stage2
174
 
    CONFARGS += \
175
 
        --enable-shared
176
 
  endif
177
 
else
178
 
  CONFARGS += \
179
 
        --enable-shared \
180
 
        --enable-multiarch \
181
 
        $(MULTIARCH_CONFARG) \
182
 
        --enable-linker-build-id \
183
 
        --with-system-zlib \
184
 
 
185
 
ifneq ($(PKGSOURCE),gcc-snapshot)
186
 
  CONFARGS += \
187
 
        --libexecdir=/$(libexecdir) \
188
 
        --without-included-gettext \
189
 
        --enable-threads=posix \
190
 
        --with-gxx-include-dir=/$(cxx_inc_dir) \
191
 
        --libdir=/$(PF)/$(libdir)
192
 
endif
193
 
 
194
 
ifneq ($(with_cpp),yes)
195
 
  CONFARGS += --disable-cpp
196
 
endif
197
 
 
198
 
ifeq ($(with_nls),yes)
199
 
  CONFARGS += --enable-nls
200
 
else
201
 
  CONFARGS += --disable-nls
202
 
endif
203
 
 
204
 
ifeq ($(with_bootstrap),off)
205
 
  CONFARGS += --disable-bootstrap
206
 
else ifneq ($(with_bootstrap),)
207
 
  CONFARGS += --enable-bootstrap=$(with_bootstrap)
208
 
endif
209
 
 
210
 
ifneq ($(with_sysroot),)
211
 
  CONFARGS += --with-sysroot=$(with_sysroot)
212
 
endif
213
 
ifneq ($(with_build_sysroot),)
214
 
  CONFARGS += --with-build-sysroot=$(with_build_sysroot)
215
 
endif
216
 
 
217
 
ifeq ($(force_gnu_locales),yes)
218
 
  CONFARGS += --enable-clocale=gnu
219
 
endif
220
 
 
221
 
ifeq ($(with_cxx)-$(with_debug),yes-yes)
222
 
  CONFARGS += --enable-libstdcxx-debug
223
 
endif
224
 
  CONFARGS += --enable-libstdcxx-time=yes
225
 
 
226
 
ifneq ($(with_ssp),yes)
227
 
  CONFARGS += --disable-libssp
228
 
endif
229
 
 
230
 
ifneq ($(with_mudflap),yes)
231
 
  CONFARGS += --disable-libmudflap
232
 
endif
233
 
 
234
 
ifneq ($(with_gomp),yes)
235
 
  CONFARGS += --disable-libgomp
236
 
endif
237
 
 
238
 
ifeq ($(with_plugins),yes)
239
 
  CONFARGS += --enable-plugin
240
 
endif
241
 
 
242
 
ifeq ($(with_gold),yes)
243
 
  CONFARGS += --enable-gold --enable-ld=default
244
 
  CONFARGS += --with-plugin-ld=ld.gold
245
 
else
246
 
  CONFARGS += --with-plugin-ld
247
 
endif
248
 
 
249
 
jvm_name_short = java-1.5.0-gcj-$(BASE_VERSION)$(if $(findstring snap,$(PKGSOURCE)),-snap)
250
 
jvm_name_long = $(jvm_name_short)-1.5.0.0
251
 
 
252
 
ifeq ($(with_java),yes)
253
 
  CONFARGS += --disable-browser-plugin
254
 
  ifeq ($(with_java_maintainer_mode),yes)
255
 
    CONFARGS += --enable-java-maintainer-mode
256
 
  endif
257
 
  ifeq ($(with_java_biarch_awt),yes)
258
 
    CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)-default))
259
 
  else
260
 
    CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)))
261
 
  endif
262
 
  ifneq (,$(findstring gtk,$(java_awt_peers)))
263
 
    CONFARGS += --enable-gtk-cairo
264
 
  endif
265
 
  jvm_dir = /usr/lib/jvm/$(jvm_name_short)
266
 
  CONFARGS += --with-java-home=$(jvm_dir)/jre
267
 
  CONFARGS += --enable-java-home \
268
 
        --with-jvm-root-dir=$(jvm_dir) \
269
 
        --with-jvm-jar-dir=/usr/lib/jvm-exports/$(jvm_name_short)
270
 
  CONFARGS += --with-arch-directory=$(java_cpu)
271
 
  ifeq (./,$(dir $(ecj_jar)))
272
 
    CONFARGS += --with-ecj-jar=$(jvm_dir)/lib/ecj.jar
273
 
  else
274
 
    CONFARGS += --with-ecj-jar=$(ecj_jar)
275
 
  endif
276
 
endif
277
 
 
278
 
ifeq ($(with_gcj),yes)
279
 
  ifeq ($(DEB_HOST_GNU_CPU),m32r)
280
 
    CONFARGS += --enable-libgcj
281
 
  endif
282
 
endif
283
 
 
284
 
ifeq ($(with_objc)-$(with_objc_gc),yes-yes)
285
 
  CONFARGS += --enable-objc-gc
286
 
endif
287
 
 
288
 
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), i486-linux-gnu i586-linux-gnu i686-linux-gnu))
289
 
    ifeq ($(biarch64),yes)
290
 
      CONFARGS += --enable-targets=all
291
 
    endif
292
 
endif
293
 
 
294
 
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), x86_64-linux-gnu))
295
 
    ifneq ($(biarch32),yes)
296
 
      CONFARGS += --disable-multilib
297
 
    endif
298
 
endif
299
 
 
300
 
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), powerpc-linux-gnu powerpc-linux-gnuspe))
301
 
    CONFARGS += --enable-secureplt
302
 
    ifeq ($(biarch64),yes)
303
 
      CONFARGS += --disable-softfloat \
304
 
        --enable-targets=powerpc-linux,powerpc64-linux --with-cpu=default32
305
 
    else
306
 
      CONFARGS += --disable-multilib
307
 
    endif
308
 
endif
309
 
 
310
 
ifneq (,$(findstring powerpc64-linux,$(DEB_TARGET_GNU_TYPE)))
311
 
    CONFARGS += --enable-secureplt
312
 
    ifeq ($(biarch32),yes)
313
 
      CONFARGS += --disable-softfloat --enable-targets=powerpc64-linux,powerpc-linux
314
 
    else
315
 
      CONFARGS += --disable-multilib
316
 
    endif
317
 
    ifeq ($(distribution),Ubuntu)
318
 
      CONFARGS += --with-cpu-32=power7 --with-cpu-64=power7
319
 
    endif
320
 
endif
321
 
 
322
 
ifeq ($(REVERSE_CROSS),yes)
323
 
  # FIXME: requires ppl and cloog headers for the target
324
 
  CONFARGS += --without-ppl
325
 
  # FIXME: build currently fails build the precompiled headers
326
 
  CONFARGS += --disable-libstdcxx-pch
327
 
endif
328
 
endif # !DEB_STAGE
329
 
 
330
 
ifeq ($(findstring powerpcspe,$(DEB_TARGET_ARCH)),powerpcspe)
331
 
  CONFARGS += --with-cpu=8548 --enable-e500_double --with-long-double-128
332
 
endif
333
 
 
334
 
ifneq (,$(findstring softfloat,$(DEB_TARGET_GNU_CPU)))
335
 
  CONFARGS += --with-float=soft
336
 
endif
337
 
 
338
 
ifneq (,$(findstring arm-vfp,$(DEB_TARGET_GNU_CPU)))
339
 
  CONFARGS += --with-fpu=vfp
340
 
endif
341
 
 
342
 
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
343
 
  CONFARGS += --disable-sjlj-exceptions
344
 
  # FIXME: libjava is not ported for thumb, this hack only works for
345
 
  # separate gcj builds
346
 
  # any Ubuntu arch or Debian armhf arch
347
 
  ifneq (,$(filter Ubuntu-% Debian-armhf,$(distribution)-$(DEB_TARGET_ARCH)))
348
 
    ifneq (,$(findstring gcj,$(PKGSOURCE)))
349
 
      CONFARGS += --with-arch=armv6
350
 
    else
351
 
      CONFARGS += --with-arch=armv7-a
352
 
    endif
353
 
    CONFARGS += --with-float=$(float_abi) --with-fpu=vfpv3-d16
354
 
  endif
355
 
  ifeq ($(with_arm_thumb),yes)
356
 
    CONFARGS += --with-mode=thumb
357
 
  endif
358
 
endif
359
 
 
360
 
ifeq ($(DEB_TARGET_GNU_CPU),$(findstring $(DEB_TARGET_GNU_CPU),m68k))
361
 
  CONFARGS += --disable-werror
362
 
endif
363
 
# FIXME: correct fix-warnings.dpatch
364
 
ifeq ($(distribution),Ubuntu)
365
 
  CONFARGS += --disable-werror
366
 
endif
367
 
 
368
 
ifneq (,$(findstring sparc-linux,$(DEB_TARGET_GNU_TYPE)))
369
 
  ifeq ($(biarch64),yes)
370
 
    CONFARGS += --enable-targets=all
371
 
  endif
372
 
endif
373
 
 
374
 
ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
375
 
    ifneq ($(biarch32),yes)
376
 
      CONFARGS += --disable-multilib
377
 
    endif
378
 
endif
379
 
 
380
 
ifneq (,$(findstring ia64-linux,$(DEB_TARGET_GNU_TYPE)))
381
 
  CONFARGS += --with-system-libunwind
382
 
endif
383
 
 
384
 
ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
385
 
  CONFARGS += --with-multilib-list=m4,m4-nofpu --with-cpu=sh4
386
 
endif
387
 
 
388
 
ifeq ($(DEB_TARGET_ARCH_OS),linux)
389
 
  ifneq (,$(findstring $(DEB_TARGET_ARCH), alpha powerpc ppc64 s390 s390x sparc sparc64))
390
 
    ifeq ($(DEB_TARGET_ARCH),alpha)
391
 
      glibc_version := $(shell dpkg -s libc6.1 | awk '/^Version:/ {print $$2}')
392
 
    else
393
 
      glibc_version := $(shell dpkg -s libc6 | awk '/^Version:/ {print $$2}')
394
 
    endif
395
 
    with_ldbl128 := $(shell dpkg --compare-versions $(glibc_version) gt 2.3.99 && echo yes)
396
 
    ifeq ($(with_ldbl128),yes)
397
 
      CONFARGS += --with-long-double-128
398
 
    endif
399
 
  endif
400
 
endif
401
 
 
402
 
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 kfreebsd-i386 kfreebsd-amd64))
403
 
  ifeq ($(distribution),Ubuntu)
404
 
    CONFARGS += --with-arch-32=i686
405
 
  else
406
 
    CONFARGS += --with-arch-32=i586
407
 
  endif
408
 
endif
409
 
 
410
 
ifneq (,$(filter $(DEB_TARGET_ARCH), hurd-i386))
411
 
  CONFARGS += --with-arch=i586
412
 
endif
413
 
 
414
 
ifeq ($(DEB_TARGET_ARCH),lpia)
415
 
  CONFARGS += --with-arch=pentium-m --with-tune=i586
416
 
endif
417
 
 
418
 
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 hurd-i386 kfreebsd-i386 kfreebsd-amd64))
419
 
  CONFARGS += --with-tune=generic
420
 
endif
421
 
 
422
 
ifneq (,$(findstring mips-linux,$(DEB_TARGET_GNU_TYPE)))
423
 
  CONFARGS += --with-mips-plt
424
 
  CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
425
 
  ifeq ($(biarchn32)-$(biarch64),yes-yes)
426
 
    CONFARGS += --enable-targets=all
427
 
    CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
428
 
  endif
429
 
endif
430
 
 
431
 
ifneq (,$(findstring mipsel-linux,$(DEB_TARGET_GNU_TYPE)))
432
 
  CONFARGS += --with-mips-plt
433
 
  CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
434
 
  ifeq ($(biarchn32)-$(biarch64),yes-yes)
435
 
    CONFARGS += --enable-targets=all
436
 
    CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
437
 
  endif
438
 
endif
439
 
 
440
 
ifneq (,$(findstring s390-linux,$(DEB_TARGET_GNU_TYPE)))
441
 
  ifeq ($(biarch64),yes)
442
 
    CONFARGS += --enable-targets=all
443
 
  endif
444
 
endif
445
 
 
446
 
ifneq (,$(findstring hppa-linux,$(DEB_TARGET_GNU_TYPE)))
447
 
  CONFARGS += --disable-libstdcxx-pch
448
 
endif
449
 
 
450
 
ifeq ($(PKGSOURCE),gcc-snapshot)
451
 
  ifeq ($(findstring --disable-werror, $(CONFARGS)),)
452
 
    CONFARGS += --disable-werror
453
 
  endif
454
 
  CONFARGS += --enable-checking=yes
455
 
else
456
 
  CONFARGS += --enable-checking=release
457
 
endif
458
 
 
459
 
ifneq ($(DEB_CROSS),yes)
460
 
  CONFARGS += \
461
 
        --build=$(DEB_BUILD_GNU_TYPE) \
462
 
        --host=$(DEB_HOST_GNU_TYPE) \
463
 
        --target=$(TARGET_ALIAS)
464
 
else
465
 
  CONFARGS += \
466
 
        --program-prefix=$(TARGET_ALIAS)- \
467
 
        --includedir=/$(PF)/$(DEB_TARGET_GNU_TYPE)/include \
468
 
        --build=$(DEB_BUILD_GNU_TYPE) \
469
 
        --host=$(DEB_HOST_GNU_TYPE) \
470
 
        --target=$(TARGET_ALIAS)
471
 
  ifndef DEB_STAGE
472
 
  CONFARGS += \
473
 
        --with-headers=/$(PF)/$(DEB_TARGET_GNU_TYPE)/include \
474
 
        --with-libs=/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib
475
 
  endif
476
 
  SET_CROSS_LIB_PATH = LD_LIBRARY_PATH=/lib:/usr/lib:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}/$(PF)/$(DEB_TARGET_GNU_TYPE)/lib$${DIRNAME}
477
 
endif
478
 
 
479
 
ifeq ($(with_bootstrap),off)
480
 
  bootstrap_target =
481
 
else ifeq ($(with_bootstrap),)
482
 
  # no profiledbootstrap on the following architectures
483
 
  # - m68k: we're happy that it builds at all
484
 
  no_profiled_bs_archs := alpha arm hppa m68k
485
 
  ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),$(no_profiled_bs_archs)))
486
 
    bootstrap_target = bootstrap-lean
487
 
  else
488
 
    bootstrap_target = profiledbootstrap
489
 
  endif
490
 
  ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
491
 
    bootstrap_target = bootstrap-lean
492
 
  endif
493
 
  ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
494
 
    bootstrap_target = bootstrap-lean
495
 
  endif
496
 
  ifeq ($(PKGSOURCE),gcc-snapshot)
497
 
    bootstrap_target = bootstrap-lean
498
 
  endif
499
 
 
500
 
  # disable profiled bootstrap on slow archs, get to testing first ...
501
 
  ifeq ($(distribution),Debian)
502
 
    ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel armhf mips mipsel sparc))
503
 
      bootstrap_target = bootstrap-lean
504
 
    endif
505
 
  endif
506
 
  ifeq ($(distribution),Ubuntu)
507
 
    ifneq (,$(filter $(DEB_TARGET_ARCH), sparc))
508
 
      bootstrap_target = bootstrap-lean
509
 
    endif
510
 
  endif
511
 
endif
512
 
      bootstrap_target = bootstrap-lean
513
 
 
514
 
DEJAGNU_TIMEOUT=300
515
 
# Increase the timeout for one testrun on slow architectures
516
 
ifeq ($(distribution),Debian)
517
 
  ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf hppa m68k sparc))
518
 
    DEJAGNU_TIMEOUT=600
519
 
  else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
520
 
    DEJAGNU_TIMEOUT=180
521
 
  endif
522
 
  ifeq ($(DEB_TARGET_GNU_SYSTEM),gnu)
523
 
    DEJAGNU_TIMEOUT=900
524
 
  endif
525
 
else ifeq ($(distribution),Ubuntu)
526
 
  ifneq (,$(findstring $(DEB_TARGET_ARCH),armel armhf hppa ia64 sparc))
527
 
    DEJAGNU_TIMEOUT=600
528
 
  else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
529
 
    DEJAGNU_TIMEOUT=180
530
 
  endif
531
 
endif
532
 
 
533
 
DEJAGNU_RUNS =
534
 
ifneq ($(PKGSOURCE),gcc-snapshot)
535
 
ifeq ($(with_ssp),yes)
536
 
  ifneq ($(PKGSOURCE),gcc-snapshot)
537
 
    DEJAGNU_RUNS += $(if $(filter yes,$(with_ssp_default)),-fno-stack-protector,-fstack-protector)
538
 
  endif
539
 
  # FIXME Ubuntu armel buildd hangs
540
 
  ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
541
 
    DEJAGNU_RUNS =
542
 
  endif
543
 
  ifeq ($(distribution),Ubuntu)
544
 
    # the buildds are just slow ... don't check the non-default
545
 
    ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),ia64 powerpc sparc))
546
 
      DEJAGNU_RUNS =
547
 
    endif
548
 
  endif
549
 
endif
550
 
endif
551
 
 
552
 
ifeq ($(distribution),Ubuntu)
553
 
  ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
554
 
    ifeq ($(with_arm_thumb),yes)
555
 
#      DEJAGNU_RUNS += -marm
556
 
    else
557
 
      DEJAGNU_RUNS += -mthumb
558
 
    endif
559
 
  endif
560
 
endif
561
 
 
562
 
ifeq ($(with_32bit_check),yes)
563
 
  DEJAGNU_RUNS += -m32
564
 
endif
565
 
ifeq ($(with_64bit_check),yes)
566
 
  ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),mips mipsel))
567
 
    DEJAGNU_RUNS += -mabi=64
568
 
  else
569
 
    DEJAGNU_RUNS += -m64
570
 
  endif
571
 
endif
572
 
ifeq ($(with_n32bit_check),yes)
573
 
  DEJAGNU_RUNS += -mabi=n32
574
 
endif
575
 
 
576
 
# gdc is not multilib'd
577
 
ifneq (,$(findstring gdc, $(PKGSOURCE)))
578
 
  DEJAGNU_RUNS =
579
 
endif
580
 
 
581
 
# neither is gnat
582
 
ifneq (,$(findstring gnat, $(PKGSOURCE)))
583
 
  DEJAGNU_RUNS =
584
 
endif
585
 
 
586
 
ifneq (,$(DEJAGNU_RUNS))
587
 
  RUNTESTFLAGS = RUNTESTFLAGS="--target_board=unix\{,$(subst $(SPACE),$(COMMA),$(strip $(DEJAGNU_RUNS)))\}"
588
 
endif
589
 
 
590
 
# PF is the installation prefix for the package without the leading slash.
591
 
# It's "usr" for gcc releases.
592
 
ifneq (,$(PF))
593
 
  # use value set in the environment
594
 
else ifeq ($(PKGSOURCE),gcc-snapshot)
595
 
  PF            = usr/lib/gcc-snapshot
596
 
else
597
 
  PF            = usr
598
 
endif
599
 
 
600
 
# PFL is the installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
601
 
ifeq ($(DEB_CROSS),yes)
602
 
  PFL           = $(PF)/$(DEB_TARGET_GNU_TYPE)
603
 
else
604
 
  PFL           = $(PF)
605
 
endif
606
 
 
607
 
# RPF is the base prefix or installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
608
 
ifeq ($(DEB_CROSS),yes)
609
 
  RPF           = $(PF)/$(DEB_TARGET_GNU_TYPE)
610
 
else
611
 
  RPF           =
612
 
endif
613
 
 
614
 
ifeq ($(with_multiarch_lib),yes)
615
 
  libdir        = lib/$(DEB_HOST_MULTIARCH)
616
 
else
617
 
  libdir        = lib
618
 
endif
619
 
# /usr/libexec doesn't follow the FHS
620
 
ifeq ($(PKGSOURCE),gcc-snapshot)
621
 
  libexecdir    = $(PF)/libexec
622
 
  spulibexecdir = $(PF)/libexec
623
 
else
624
 
  libexecdir    = $(PF)/$(libdir)
625
 
  spulibexecdir = $(PF)/$(libdir)
626
 
endif
627
 
buildlibdir     = $(builddir)/$(TARGET_ALIAS)
628
 
 
629
 
ifeq ($(with_common_gcclibdir),yes)
630
 
  gcc_lib_dir   = $(PF)/$(libdir)/gcc/$(TARGET_ALIAS)/$(BASE_VERSION)
631
 
  gcc_lexec_dir = $(libexecdir)/gcc/$(TARGET_ALIAS)/$(BASE_VERSION)
632
 
  gcc_spu_lib_dir       = $(PF)/spu/lib/gcc/spu/$(BASE_VERSION)
633
 
  gcc_spu_lexec_dir     = $(spulibexecdir)/gcc/spu/$(BASE_VERSION)
634
 
else
635
 
  gcc_lib_dir   = $(PF)/$(libdir)/gcc/$(TARGET_ALIAS)/$(GCC_VERSION)
636
 
  gcc_lexec_dir = $(libexecdir)/gcc/$(TARGET_ALIAS)/$(GCC_VERSION)
637
 
  gcc_spu_lib_dir       = $(PF)/spu/lib/gcc/spu/$(GCC_VERSION)
638
 
  gcc_spu_lexec_dir     = $(spulibexecdir)/gcc/spu/$(GCC_VERSION)
639
 
endif
640
 
 
641
 
lib32           = $(PF)/lib32
642
 
lib64           = lib64
643
 
libn32          = lib32
644
 
 
645
 
p_l= $(1)$(cross_lib_arch)
646
 
p_d= $(1)-dbg$(cross_lib_arch)
647
 
d_l= debian/$(p_l)
648
 
d_d= debian/$(p_d)
649
 
 
650
 
ifeq ($(DEB_CROSS),yes)
651
 
  usr_lib = $(PFL)/lib
652
 
else
653
 
  usr_lib = $(PFL)/$(libdir)
654
 
endif
655
 
usr_lib32 = $(PFL)/lib32
656
 
usr_libn32 = $(PFL)/lib32
657
 
usr_lib64 = $(PFL)/lib64
658
 
 
659
 
gcc_lib_dir32 = $(gcc_lib_dir)/$(biarch32subdir)
660
 
gcc_lib_dirn32 = $(gcc_lib_dir)/$(biarchn32subdir)
661
 
gcc_lib_dir64 = $(gcc_lib_dir)/$(biarch64subdir)
662
 
 
663
 
libgcc_dir = $(RPF)/$(libdir)
664
 
# yes, really; lib32gcc_s ends up in usr
665
 
libgcc_dir32 = $(PFL)/lib32
666
 
libgcc_dirn32 = $(RPF)/lib32
667
 
libgcc_dir64 = $(RPF)/lib64
668
 
 
669
 
# install_gcc_lib(lib,soname,flavour,package)
670
 
define install_gcc_lib
671
 
        mv $(d)/$(usr_lib$(3))/$(1)*.a debian/$(4)/$(gcc_lib_dir$(3))/
672
 
        rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so}
673
 
        dh_link -p$(4) \
674
 
          /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(1).so
675
 
 
676
 
endef
677
 
 
678
 
checkdirs = $(builddir)
679
 
ifeq ($(with_separate_libgcj),yes)
680
 
  ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
681
 
    ifneq ($(with_standalone_gcj),yes)
682
 
      checkdirs = $(buildlibdir)/libffi $(buildlibdir)/libjava
683
 
    endif
684
 
  endif
685
 
endif
686
 
ifeq ($(with_separate_gnat),yes)
687
 
  ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
688
 
    checkdirs = $(builddir)/gcc
689
 
  endif
690
 
endif
691
 
 
692
 
ifneq ($(DEB_CROSS),yes)
693
 
  ifneq ($(PKGSOURCE),gcc-snapshot)
694
 
    cxx_inc_dir = $(PF)/include/c++/$(BASE_VERSION)
695
 
  else
696
 
    cxx_inc_dir = $(PF)/include/c++/$(GCC_VERSION)
697
 
  endif
698
 
else
699
 
  cxx_inc_dir   = $(PF)/$(TARGET_ALIAS)/include/c++/$(GCC_VERSION)
700
 
endif
701
 
 
702
 
default: build
703
 
 
704
 
configure: $(configure_dependencies)
705
 
 
706
 
$(configure_dummy_stamp):
707
 
        touch $(configure_dummy_stamp)
708
 
 
709
 
$(configure_stamp):
710
 
        dh_testdir
711
 
        : # give information about the build process
712
 
        @echo "------------------------ Build process variables ------------------------"
713
 
        @echo "Number of parallel processes used for the build: $(USE_CPUS)"
714
 
        @echo "Package source: $(PKGSOURCE)"
715
 
        @echo "GCC version: $(GCC_VERSION)"
716
 
        @echo "Base Debian version: $(BASE_VERSION)"
717
 
        @echo -e "Configured with: $(subst ___, ,$(foreach i,$(CONFARGS),$(i)\n\t))"
718
 
ifeq ($(DEB_CROSS),yes)
719
 
        @echo "Building cross compiler for $(DEB_TARGET_ARCH)"
720
 
endif
721
 
        @echo "Using shell $(SHELL)"
722
 
        @echo "Architecture: $(DEB_TARGET_ARCH) (GNU: $(TARGET_ALIAS))"
723
 
        @echo "CPPFLAGS: $(CPPFLAGS)"
724
 
        @echo "CFLAGS: $(CFLAGS)"
725
 
        @echo "LDFLAGS: $(LDFLAGS)"
726
 
        @echo "BOOT_CFLAGS: $(BOOT_CFLAGS)"
727
 
        @echo "DEBIAN_BUILDARCH: $(DEBIAN_BUILDARCH)"
728
 
        @echo "Install prefix: /$(PF)"
729
 
ifeq ($(biarchn32)-$(biarch64),yes-yes)
730
 
        @echo "Will build the triarch compilers (o32/n32/64, defaulting to o32)"
731
 
else
732
 
  ifeq ($(biarch64),yes)
733
 
        @echo "Will build the biarch compilers (32/64, defaulting to 32bit)"
734
 
  else
735
 
    ifeq ($(biarch32),yes)
736
 
        @echo "Will build the biarch compilers (64/32, defaulting to 64bit)"
737
 
    else
738
 
        @echo "Will not build the biarch compilers"
739
 
    endif
740
 
  endif
741
 
endif
742
 
 
743
 
ifeq ($(with_cxx),yes)
744
 
        @echo "Will build the C++ compiler"
745
 
else
746
 
        @echo "Will not build the C++ compiler: $(with_cxx)"
747
 
endif
748
 
ifeq ($(with_objc),yes)
749
 
        @echo "Will build the ObjC compiler."
750
 
    ifeq ($(with_objc_gc),yes)
751
 
        @echo "Will build the extra ObjC runtime for garbage collection."
752
 
    else
753
 
        @echo "Will not build the extra ObjC runtime for garbage collection."
754
 
    endif
755
 
else
756
 
        @echo "Will not build the ObjC compiler: $(with_objc)"
757
 
endif
758
 
ifeq ($(with_objcxx),yes)
759
 
        @echo "Will build the Obj-C++ compiler"
760
 
else
761
 
        @echo "Will not build the Obj-C++ compiler: $(with_objcxx)"
762
 
endif
763
 
ifeq ($(with_fortran),yes)
764
 
        @echo "Will build the Fortran 95 compiler."
765
 
else
766
 
        @echo "Will not build the Fortran 95 compiler: $(with_fortran)"
767
 
endif
768
 
ifeq ($(with_java),yes)
769
 
        @echo "Will build the Java compiler."
770
 
else
771
 
        @echo "Will not build the Java compiler: $(with_java)"
772
 
endif
773
 
ifeq ($(with_ada),yes)
774
 
        @echo "Will build the Ada compiler."
775
 
  ifeq ($(with_libgnat),yes)
776
 
        @echo "Will build the shared Ada libraries."
777
 
  else
778
 
        @echo "Will not build the shared Ada libraries."
779
 
  endif
780
 
else
781
 
        @echo "Will not build the Ada compiler: $(with_ada)"
782
 
endif
783
 
ifeq ($(with_go),yes)
784
 
        @echo "Will build the Go compiler."
785
 
else
786
 
        @echo "Will not build the Go compiler: $(with_go)"
787
 
endif
788
 
ifeq ($(with_d),yes)
789
 
        @echo "Will build the D compiler"
790
 
else
791
 
        @echo "Will not build the D compiler: $(with_d)"
792
 
endif
793
 
ifeq ($(with_ssp),yes)
794
 
        @echo "Will build with SSP support."
795
 
else
796
 
        @echo "Will build without SSP support: $(with_ssp)"
797
 
endif
798
 
ifeq ($(with_check),yes)
799
 
        @echo "Will run the testsuite."
800
 
  ifeq ($(biarch64),yes)
801
 
    ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),mips mipsel))
802
 
        @echo 'Will run the testsuite with -mabi=64: $(with_64bit_check)'
803
 
    else
804
 
        @echo 'Will run the testsuite with -m64: $(with_64bit_check)'
805
 
    endif
806
 
  endif
807
 
  ifeq ($(biarch32),yes)
808
 
        @echo 'Will run the testsuite with -m32: $(with_32bit_check)'
809
 
  endif
810
 
  ifeq ($(biarchn32),yes)
811
 
        @echo 'Will run the testsuite with -mabi=n32: $(with_n32bit_check)'
812
 
  endif
813
 
else
814
 
        @echo "Will not run the testsuite: $(with_check)"
815
 
endif
816
 
ifeq ($(with_nls),yes)
817
 
        @echo "Will enable national language support."
818
 
else
819
 
        @echo "Will disable national language support: $(with_nls)"
820
 
endif
821
 
        @echo "-----------------------------------------------------------------------------"
822
 
        @echo ""
823
 
ifeq ($(with_check),yes)
824
 
        @if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \
825
 
          : ; \
826
 
        else \
827
 
          echo "expect is failing on your system with the above error, which means the GCC"; \
828
 
          echo "testsuite will fail.  Please resolve the above issues and retry the build."; \
829
 
          echo "-----------------------------------------------------------------------------"; \
830
 
          exit 1; \
831
 
        fi
832
 
endif
833
 
        rm -f $(configure_stamp) $(build_stamp)
834
 
        cp $(patch_stamp) debian/README.Debian.$(DEB_TARGET_ARCH)
835
 
 
836
 
        rm -rf $(builddir)
837
 
        mkdir $(builddir)
838
 
 
839
 
        : # configure
840
 
        cd $(builddir) \
841
 
          && $(SET_PATH) \
842
 
                CC="$(CC)" \
843
 
                $(SET_SHELL) \
844
 
        LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc/ada/rts \
845
 
                ../src/configure $(subst ___, ,$(CONFARGS))
846
 
 
847
 
        touch $(configure_stamp)
848
 
 
849
 
build: $(build_dependencies)
850
 
 
851
 
$(build_dummy_stamp):
852
 
        touch $(build_dummy_stamp)
853
 
 
854
 
$(build_locale_stamp):
855
 
ifeq ($(locale_data)-$(with_cxx),generate-yes)
856
 
        : # build locales needed by libstdc++ testsuite
857
 
        rm -rf locales
858
 
        mkdir locales
859
 
        - sh debian/locale-gen
860
 
endif
861
 
        touch $(build_locale_stamp)
862
 
 
863
 
 
864
 
$(build_stamp): $(configure_stamp) $(build_locale_stamp)
865
 
        dh_testdir
866
 
        rm -f bootstrap-protocol
867
 
# DEB_CROSS is never set if REVERSE_CROSS is set and vice-versa.
868
 
# DEB_CROSS build
869
 
ifeq ($(DEB_CROSS),yes)
870
 
        : # build cross compiler for $(TARGET_ALIAS)
871
 
        ( \
872
 
          set +e; \
873
 
          $(SET_PATH) \
874
 
          $(SET_LOCPATH) \
875
 
            $(MAKE) -C $(builddir) $(NJOBS) \
876
 
                CC="$(CC)" \
877
 
                $(CFLAGS_TO_PASS) \
878
 
                $(LDFLAGS_TO_PASS) \
879
 
                ; \
880
 
          echo $$? > status; \
881
 
        ) 2>&1 | tee bootstrap-protocol
882
 
        s=`cat status`; rm -f status; test $$s -eq 0
883
 
else
884
 
  # REVERSE_CROSS build
885
 
  ifeq ($(REVERSE_CROSS),yes)
886
 
        : # build cross compiler for $(TARGET_ALIAS)
887
 
        ( \
888
 
          set +e; \
889
 
          $(SET_PATH) \
890
 
          $(SET_LOCPATH) \
891
 
            $(MAKE) -C $(builddir) $(NJOBS) \
892
 
                CC="$(CC)" \
893
 
                $(CFLAGS_TO_PASS) \
894
 
                $(LDFLAGS_TO_PASS) \
895
 
                ; \
896
 
          echo $$? > status; \
897
 
        ) 2>&1 | tee bootstrap-protocol
898
 
        s=`cat status`; rm -f status; test $$s -eq 0
899
 
else
900
 
  # Native build
901
 
  ifeq ($(with_java),yes)
902
 
        mkdir -p bin
903
 
        ln -sf /usr/bin/fastjar bin/jar
904
 
    ifeq ($(with_native_ecj),yes)
905
 
        : # prepare the standalone ecj jar
906
 
        cp /usr/share/java/ecj.jar $(srcdir)/ecj-standalone.jar
907
 
        zip -d $(srcdir)/ecj-standalone.jar 'org/eclipse/jdt/core/JDTCompilerAdapter*'
908
 
    endif
909
 
    ifeq ($(with_java_maintainer_mode),yes)
910
 
        ( \
911
 
          echo '#!/bin/sh'; \
912
 
          echo 'exec gij-4.3 -cp /usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.GCCMain "$$@"'; \
913
 
        ) > bin/ecj1
914
 
        chmod +x bin/ecj1
915
 
        : # If we don't have gjavah in PATH, try to build it with the old gij
916
 
        mkdir -p bin
917
 
        if [ -x /usr/bin/gjavah-4.3 ]; then \
918
 
          ln -sf /usr/bin/gjavah-4.3 bin/gjavah; \
919
 
        elif [ -x bin/gjavah ]; then \
920
 
          : ; \
921
 
        else \
922
 
          mkdir -p $(builddir)/java_hacks; \
923
 
          cd $(builddir)/java_hacks; \
924
 
          cp -a $(srcdir)/libjava/classpath/tools/external external; \
925
 
          mkdir -p gnu/classpath/tools; \
926
 
          cp -a $(srcdir)/libjava/classpath/tools/gnu/classpath/tools/{common,javah,getopt} \
927
 
            gnu/classpath/tools/; \
928
 
          cp -a $(srcdir)/libjava/classpath/resource/gnu/classpath/tools/common/Messages.properties \
929
 
            gnu/classpath/tools/common; \
930
 
          cd external/asm; \
931
 
          for i in `find . -name \*.java`; do gcj-4.3 --encoding ISO-8859-1 -C $$i -I.; done; \
932
 
          cd ../..; \
933
 
          for i in `find gnu -name \*.java`; do gcj-4.3 -C $$i -I. -Iexternal/asm/; done; \
934
 
          gcj-4.3 -findirect-dispatch -O2 -fmain=gnu.classpath.tools.javah.Main \
935
 
            -I. -Iexternal/asm/ `find . -name \*.class` -o $(PWD)/bin/gjavah.real; \
936
 
          ( \
937
 
            echo '#!/bin/sh'; \
938
 
            echo 'export CLASSPATH='`pwd`'$${CLASSPATH:+:$$CLASSPATH}'; \
939
 
            echo 'exec $(PWD)/bin/gjavah.real "$$@"'; \
940
 
          ) > $(PWD)/bin/gjavah; \
941
 
          chmod +x $(PWD)/bin/gjavah; \
942
 
        fi
943
 
    endif
944
 
  endif
945
 
        : # build native compiler
946
 
        ( \
947
 
          set +e; \
948
 
          $(SET_PATH) \
949
 
          $(SET_SHELL) \
950
 
          $(SET_LOCPATH) \
951
 
            $(MAKE) -C $(builddir) $(NJOBS) $(bootstrap_target) \
952
 
                CC="$(CC)" \
953
 
                $(CFLAGS_TO_PASS) \
954
 
                $(STAGE1_CFLAGS_TO_PASS) \
955
 
                $(LDFLAGS_TO_PASS) \
956
 
                ; \
957
 
          echo $$? > status; \
958
 
        ) 2>&1 | tee bootstrap-protocol
959
 
        s=`cat status`; rm -f status; test $$s -eq 0
960
 
endif
961
 
endif
962
 
        -chmod 755 $(srcdir)/contrib/warn_summary
963
 
        if [ -x $(srcdir)/contrib/warn_summary ]; then \
964
 
          rm -f bootstrap-summary; \
965
 
          $(srcdir)/contrib/warn_summary bootstrap-protocol \
966
 
            > bootstrap-summary; \
967
 
        fi
968
 
 
969
 
        touch $(build_stamp)
970
 
 
971
 
ifeq ($(versioned_packages),yes)
972
 
  hppa64_configure_flags += --program-suffix=-$(BASE_VERSION)
973
 
endif
974
 
 
975
 
ifeq ($(DEB_CROSS),yes)
976
 
  CC_for_hppa64_cross = $(CC)
977
 
else
978
 
  CC_for_hppa64_cross = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
979
 
endif
980
 
 
981
 
$(configure_hppa64_stamp): $(build_stamp)
982
 
        dh_testdir
983
 
        rm -f $(configure_hppa64_stamp) $(build_hppa64_stamp)
984
 
        rm -rf $(builddir_hppa64)
985
 
        mkdir $(builddir_hppa64)
986
 
        : # configure
987
 
        cd $(builddir_hppa64) && \
988
 
          $(SET_PATH) \
989
 
          $(SET_SHELL) \
990
 
          CC="$(CC_for_hppa64_cross)" \
991
 
             ../src/configure \
992
 
                --enable-languages=c \
993
 
                --prefix=/$(PF) \
994
 
                --libexecdir=/$(libexecdir) \
995
 
                --enable-multiarch \
996
 
                $(MULTIARCH_CONFARG) \
997
 
                --disable-shared \
998
 
                --disable-nls \
999
 
                --disable-threads \
1000
 
                --disable-libgomp \
1001
 
                --disable-libmudflap \
1002
 
                --disable-libssp \
1003
 
                --with-system-zlib \
1004
 
                --with-as=/usr/bin/hppa64-linux-gnu-as \
1005
 
                --with-ld=/usr/bin/hppa64-linux-gnu-ld \
1006
 
                --includedir=/usr/hppa64-linux-gnu/include \
1007
 
                --build=$(DEB_BUILD_GNU_TYPE) \
1008
 
                --host=$(DEB_HOST_GNU_TYPE) \
1009
 
                --target=hppa64-linux-gnu
1010
 
        touch $(configure_hppa64_stamp)
1011
 
 
1012
 
$(build_hppa64_stamp): $(configure_hppa64_stamp)
1013
 
          $(SET_PATH) \
1014
 
          $(SET_SHELL) \
1015
 
          $(SET_LOCPATH) \
1016
 
          LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc \
1017
 
            $(MAKE) -C $(builddir_hppa64) $(NJOBS) \
1018
 
                CC="$(CC_for_hppa64_cross)" \
1019
 
                $(CFLAGS_TO_PASS) \
1020
 
                $(LDFLAGS_TO_PASS)
1021
 
        touch $(build_hppa64_stamp)
1022
 
 
1023
 
$(configure_neon_stamp): $(build_stamp)
1024
 
        dh_testdir
1025
 
        rm -f $(configure_neon_stamp) $(build_neon_stamp)
1026
 
        rm -rf $(builddir_neon)
1027
 
        mkdir $(builddir_neon)
1028
 
        : # configure
1029
 
        cd $(builddir_neon) && \
1030
 
          $(SET_PATH) \
1031
 
          $(SET_SHELL) \
1032
 
          CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1033
 
             ../src/configure \
1034
 
                --disable-bootstrap \
1035
 
                --enable-languages=c,c++,objc,fortran \
1036
 
                --prefix=/$(PF) \
1037
 
                --libexecdir=/$(libexecdir) \
1038
 
                --program-suffix=-$(BASE_VERSION) \
1039
 
                --enable-multiarch \
1040
 
                $(MULTIARCH_CONFARG) \
1041
 
                --disable-nls \
1042
 
                --disable-libmudflap \
1043
 
                --with-arch=armv7-a --with-tune=cortex-a8 \
1044
 
                --with-float=$(float_abi) --with-fpu=neon \
1045
 
                --host=arm-linux-gnueabi \
1046
 
                --build=arm-linux-gnueabi \
1047
 
                --target=arm-linux-gnueabi
1048
 
        touch $(configure_neon_stamp)
1049
 
 
1050
 
$(build_neon_stamp): $(configure_neon_stamp)
1051
 
          $(SET_PATH) \
1052
 
          $(SET_SHELL) \
1053
 
          $(SET_LOCPATH) \
1054
 
            $(MAKE) -C $(builddir_neon) $(NJOBS) \
1055
 
                CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1056
 
                $(CFLAGS_TO_PASS) \
1057
 
                $(LDFLAGS_TO_PASS)
1058
 
        touch $(build_neon_stamp)
1059
 
 
1060
 
$(configure_ia6432_stamp): $(build_stamp)
1061
 
        dh_testdir
1062
 
        rm -f $(configure_ia6432_stamp) $(build_ia6432_stamp)
1063
 
        rm -rf $(builddir_ia6432)
1064
 
        mkdir $(builddir_ia6432)
1065
 
        : # configure
1066
 
        cd $(builddir_ia6432) && \
1067
 
          $(SET_PATH) \
1068
 
          $(SET_SHELL) \
1069
 
          CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1070
 
             ../src/configure \
1071
 
                --enable-languages=c \
1072
 
                --prefix=/$(PF) \
1073
 
                --libexecdir=/$(libexecdir) \
1074
 
                --enable-multiarch \
1075
 
                $(MULTIARCH_CONFARG) \
1076
 
                --disable-nls \
1077
 
                --disable-libmudflap \
1078
 
                --program-suffix=-$(BASE_VERSION) \
1079
 
                --host=ia64-linux-gnu \
1080
 
                --build=ia64-linux-gnu \
1081
 
                --target=i486-linux-gnu
1082
 
        touch $(configure_ia6432_stamp)
1083
 
 
1084
 
$(build_ia6432_stamp): $(configure_ia6432_stamp)
1085
 
          $(SET_PATH) \
1086
 
          $(SET_SHELL) \
1087
 
            $(MAKE) -C $(builddir_ia6432) $(NJOBS) \
1088
 
                CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1089
 
                $(CFLAGS_TO_PASS) \
1090
 
                $(LDFLAGS_TO_PASS)
1091
 
        touch $(build_ia6432_stamp)
1092
 
 
1093
 
spu_configure_args = \
1094
 
        --enable-languages=c,c++,fortran \
1095
 
        --prefix=/$(PF) \
1096
 
        --libexecdir=/$(spulibexecdir) \
1097
 
        --disable-shared \
1098
 
        --disable-nls \
1099
 
        --disable-threads \
1100
 
        --enable-checking=release \
1101
 
        --disable-libssp \
1102
 
        --with-system-zlib \
1103
 
        --with-newlib \
1104
 
        --program-prefix=spu- \
1105
 
        --with-as=/usr/bin/spu-as \
1106
 
        --with-ar=/usr/bin/spu-ar \
1107
 
        --with-ld=/usr/bin/spu-ld
1108
 
 
1109
 
# FIXME: --with-sysroot=/usr/spu breaks libgfortran build
1110
 
#ifeq ($(PKGSOURCE),gcc-snapshot)
1111
 
#  spu_configure_args += \
1112
 
#       --with-sysroot=/usr/spu
1113
 
#else
1114
 
  spu_configure_args += \
1115
 
        --includedir=/usr/spu/include \
1116
 
        --libdir=/usr/spu/lib
1117
 
#endif
1118
 
 
1119
 
spu_configure_args += \
1120
 
        --host=$(DEB_HOST_GNU_TYPE) \
1121
 
        --build=$(DEB_BUILD_GNU_TYPE) \
1122
 
        --target=spu
1123
 
 
1124
 
$(configure_spu_stamp): $(src_spu_stamp) $(build_stamp)
1125
 
        dh_testdir
1126
 
        rm -f $(configure_spu_stamp) $(build_spu_stamp)
1127
 
        rm -rf $(builddir_spu)
1128
 
        mkdir $(builddir_spu)
1129
 
        : # configure
1130
 
        cd $(builddir_spu) && \
1131
 
          $(SET_PATH) \
1132
 
          $(SET_SHELL) \
1133
 
          CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1134
 
             ../src-spu/configure $(spu_configure_args)
1135
 
        touch $(configure_spu_stamp)
1136
 
 
1137
 
$(build_spu_stamp): $(configure_spu_stamp)
1138
 
          $(SET_PATH) \
1139
 
          $(SET_SHELL) \
1140
 
          $(SET_LOCPATH) \
1141
 
            $(MAKE) -C $(builddir_spu) $(NJOBS) \
1142
 
                CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1143
 
                $(CFLAGS_TO_PASS) \
1144
 
                $(LDFLAGS_TO_PASS)
1145
 
        touch $(build_spu_stamp)
1146
 
 
1147
 
 
1148
 
MANUALS = \
1149
 
        $(srcdir)/gcc/doc/cpp.texi \
1150
 
        $(srcdir)/gcc/doc/cppinternals.texi \
1151
 
        $(srcdir)/gcc/doc/gcc.texi \
1152
 
        $(srcdir)/gcc/doc/gccint.texi
1153
 
ifeq ($(with_fortran),yes)
1154
 
  MANUALS += $(srcdir)/gcc/fortran/gfortran.texi
1155
 
endif
1156
 
ifeq ($(with_java),yes)
1157
 
  MANUALS += $(srcdir)/gcc/java/gcj.texi
1158
 
endif
1159
 
ifeq ($(with_ada),yes)
1160
 
  MANUALS += \
1161
 
        $(builddir)/gcc/doc/gnat_ugn.texi \
1162
 
        $(srcdir)/gcc/ada/gnat_rm.texi \
1163
 
        $(srcdir)/gcc/ada/gnat-style.texi
1164
 
endif
1165
 
ifeq ($(with_gomp),yes)
1166
 
  MANUALS += $(srcdir)/libgomp/libgomp.texi
1167
 
endif
1168
 
 
1169
 
html-docs: $(build_html_stamp)
1170
 
#$(build_html_stamp): html-texi2html
1171
 
#$(build_html_stamp): html-makeinfo
1172
 
$(build_html_stamp): html-makeinfo-nosplit
1173
 
 
1174
 
html-texi2html:
1175
 
        rm -rf html $(builddir)/gcc/html
1176
 
        mkdir $(builddir)/gcc/html
1177
 
        ln -s $(builddir)/gcc/html html
1178
 
        cd $(builddir)/gcc; \
1179
 
        for manual in $(MANUALS); do \
1180
 
          outname=`basename $${manual} .texi`; \
1181
 
          echo "generating $$outname ..."; \
1182
 
          texi2html -number -split chapter \
1183
 
                -I $(srcdir)/gcc/doc/include \
1184
 
                -I $(srcdir)/gcc/p/doc \
1185
 
                -I $(srcdir)/gcc/p/doc/generated \
1186
 
                -I `dirname $${manual}` \
1187
 
                -I $(builddir)/gcc \
1188
 
                -subdir html \
1189
 
                $${manual}; \
1190
 
        done
1191
 
 
1192
 
html-makeinfo:
1193
 
        rm -rf html
1194
 
        mkdir html
1195
 
        cd $(builddir)/gcc; \
1196
 
        for manual in $(MANUALS); do \
1197
 
          manual=`find $(srcdir) -name $${file}.texi`; \
1198
 
          outname=`basename $${manual} .texi`; \
1199
 
          echo "generating $$outname ..."; \
1200
 
          if [ "$${manual}" ]; then \
1201
 
            makeinfo --html --number-sections \
1202
 
                -I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1203
 
                -I $(srcdir)/gcc/p/doc \
1204
 
                -I $(srcdir)/gcc/p/doc/generated \
1205
 
                -I $(builddir)/gcc \
1206
 
                -o $${outname} \
1207
 
                $${manual}; \
1208
 
          fi; \
1209
 
        done
1210
 
 
1211
 
html-makeinfo-nosplit:
1212
 
        rm -rf html
1213
 
        mkdir html
1214
 
        cd $(builddir)/gcc; \
1215
 
        for manual in $(MANUALS); do \
1216
 
          outname=`basename $${manual} .texi`.html; \
1217
 
          echo "generating $$outname ..."; \
1218
 
          makeinfo --html --number-sections --no-split \
1219
 
                -I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1220
 
                -I $(srcdir)/gcc/p/doc \
1221
 
                -I $(srcdir)/gcc/p/doc/generated \
1222
 
                -I $(builddir)/gcc \
1223
 
                -o $(PWD)/html/$${outname} \
1224
 
                $${manual}; \
1225
 
        done
1226
 
 
1227
 
# start the script only on architectures known to have slow autobuilders ...
1228
 
logwatch_archs := alpha arm m68k mips mipsel sparc
1229
 
ifeq ($(DEB_HOST_GNU_CPU), $(findstring $(DEB_HOST_GNU_CPU),$(logwatch_archs)))
1230
 
  start_logwatch = yes
1231
 
endif
1232
 
ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
1233
 
  start_logwatch = yes
1234
 
endif
1235
 
 
1236
 
stamps/mauve-build: stamps/build
1237
 
        rm -rf mauve
1238
 
        mkdir -p mauve
1239
 
ifeq ($(with_mauve_check),yes)
1240
 
        tar xf $(wildcard /usr/src/mauve*.tar.*)
1241
 
        cd mauve \
1242
 
            && aclocal \
1243
 
            && automake \
1244
 
            && autoconf2.59 \
1245
 
            && PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
1246
 
        PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH $(MAKE) -C mauve
1247
 
endif
1248
 
        touch $@
1249
 
 
1250
 
stamps/mauve-check: stamps/build stamps/mauve-build
1251
 
ifeq ($(with_mauve_check),yes)
1252
 
        -cd mauve && \
1253
 
            JAVA_HOME=$(CURDIR)/$(sdkimg) \
1254
 
            PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH \
1255
 
                xvfb-run -s "-extension GLX" java Harness \
1256
 
                    -vm $(CURDIR)/$(sdkimg)/bin/java \
1257
 
                    -file $(CURDIR)/debian/mauve_tests \
1258
 
                    -timeout 30000 2>&1 \
1259
 
                | tee mauve_output
1260
 
        @sleep 5
1261
 
else
1262
 
        echo "mauve testsuite not run for this build" > mauve/mauve_output
1263
 
endif
1264
 
        touch $@
1265
 
 
1266
 
check: $(check_stamp) # $(if $(filter yes, $(with_java)),stamps/05-build-mauve-stamp) #$(check_inst_stamp)
1267
 
$(check_stamp): $(build_stamp) $(build_locale_stamp)
1268
 
        rm -f test-protocol
1269
 
 
1270
 
        -chmod 755 $(srcdir)/contrib/test_summary
1271
 
ifneq ($(with_common_libs),yes)
1272
 
        : # libstdc++6 built from newer gcc-4.x source, run testsuite against the installed lib
1273
 
 
1274
 
        sed 's/-L[^ ]*//g' $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags \
1275
 
          > $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags.installed
1276
 
        -$(ULIMIT_M); \
1277
 
            set +e; \
1278
 
            for d in $(buildlibdir)/libstdc++-v3/testsuite; do \
1279
 
              echo "Running testsuite in $$d ..."; \
1280
 
              TEST_INSTALLED=1 \
1281
 
              $(SET_SHELL) \
1282
 
              $(SET_LOCPATH) \
1283
 
              $(SET_PATH) \
1284
 
              DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1285
 
              DEB_GCC_NO_O3=1 \
1286
 
                $(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1287
 
            done 2>&1 | tee test-protocol2
1288
 
 
1289
 
        BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1290
 
          $(srcdir)/contrib/test_summary -m "$(S_EMAIL)" > raw-test-summary
1291
 
        -( \
1292
 
          sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary; \
1293
 
          awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF; \
1294
 
        ) > libstdc++-test-summary
1295
 
        echo 'BEGIN installed libstdc++-v3 test-summary'
1296
 
        cat libstdc++-test-summary
1297
 
        echo 'END installed libstdc++-v3 test-summary'
1298
 
        find $(buildlibdir)/libstdc++-v3/testsuite -name '*.log' -o -name '*.sum' \
1299
 
          | xargs -r rm -f
1300
 
endif
1301
 
 
1302
 
ifeq ($(start_logwatch),yes)
1303
 
        : # start logwatch script for regular output during test runs
1304
 
        chmod +x debian/logwatch.sh
1305
 
        -debian/logwatch.sh -t 900 -p $(builddir)/logwatch.pid \
1306
 
                -m '\ntestsuite still running ...\n' \
1307
 
                test-protocol \
1308
 
                $(builddir)/gcc/testsuite/gcc/gcc.log \
1309
 
                $(builddir)/gcc/testsuite/g++/g++.log \
1310
 
                $(builddir)/gcc/testsuite/gfortran/gfortran.log \
1311
 
                $(builddir)/gcc/testsuite/objc/objc.log \
1312
 
                $(builddir)/gcc/testsuite/obj-c++/obj-c++.log \
1313
 
                $(builddir)/gcc/testsuite/gnat/gnat.log \
1314
 
                $(builddir)/gcc/testsuite/ada/acats/acats.log \
1315
 
                $(builddir)/gcc/testsuite/gfortran/gfortran.log \
1316
 
                $(builddir)/gcc/p/test/test_log \
1317
 
                $(buildlibdir)/libstdc++-v3/testsuite/libstdc++-v3.log \
1318
 
                $(buildlibdir)/libjava/testsuite/libjava.log \
1319
 
                $(buildlibdir)/libmudflap/testsuite/libmudflap.log \
1320
 
                $(buildlibdir)/libgomp/testsuite/libgomp.log \
1321
 
                $(buildlibdir)/libffi/testsuite/libffi.log \
1322
 
                &
1323
 
endif
1324
 
 
1325
 
ifeq ($(with_ada),yes)
1326
 
        chmod +x debian/acats-killer.sh
1327
 
        -debian/acats-killer.sh -p $(builddir)/acats-killer.pid \
1328
 
                $(builddir)/gcc/testsuite/ada/acats/acats.log \
1329
 
                $(builddir)/gcc/testsuite/g++.log \
1330
 
                &
1331
 
endif
1332
 
 
1333
 
        -$(ULIMIT_M); \
1334
 
            set +e; \
1335
 
            for d in $(checkdirs); do \
1336
 
              echo "Running testsuite in $$d ..."; \
1337
 
              $(SET_SHELL) \
1338
 
              $(SET_LOCPATH) \
1339
 
              $(SET_PATH) \
1340
 
              EXTRA_TEST_PFLAGS=-g0 \
1341
 
              DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1342
 
              DEB_GCC_NO_O3=1 \
1343
 
                $(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1344
 
            done 2>&1 | tee test-protocol
1345
 
 
1346
 
        -ps aux | fgrep logwatch | fgrep -v fgrep
1347
 
        -if [ -f $(builddir)/logwatch.pid ]; then \
1348
 
          kill -1 `cat $(builddir)/logwatch.pid`; \
1349
 
          sleep 1; \
1350
 
          kill -9 `cat $(builddir)/logwatch.pid`; \
1351
 
          rm -f $(builddir)/logwatch.pid; \
1352
 
        fi
1353
 
        -ps aux | fgrep logwatch | fgrep -v fgrep
1354
 
 
1355
 
ifeq ($(with_ada),yes)
1356
 
        -if [ -f $(builddir)/acats-killer.pid ]; then \
1357
 
          kill -1 `cat $(builddir)/acats-killer.pid`; \
1358
 
          sleep 1; \
1359
 
          kill -9 `cat $(builddir)/acats-killer.pid`; \
1360
 
          rm -f $(builddir)/acats-killer.pid; \
1361
 
        fi
1362
 
endif
1363
 
 
1364
 
        : # running the libjava testsuite alone is missing this information
1365
 
        $(builddir)/gcc/xgcc -B$(builddir)/gcc/ -v > $(builddir)/compiler_version.sum 2>&1
1366
 
 
1367
 
        if [ -x $(srcdir)/contrib/test_summary ]; then \
1368
 
          rm -f test-summary; \
1369
 
          ( \
1370
 
            cd $(builddir); \
1371
 
            echo '' > ts-include; \
1372
 
            echo '' >> ts-include; \
1373
 
            if [ -f $(builddir)/gcc/.bad_compare ]; then \
1374
 
              echo 'Bootstrap comparison failure:' >> ts-include; \
1375
 
              cat $(builddir)/gcc/.bad_compare >> ts-include; \
1376
 
              echo '' >> ts-include; \
1377
 
              echo '' >> ts-include; \
1378
 
            fi; \
1379
 
            echo "Build Dependencies:" >> ts-include; \
1380
 
            dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1381
 
                libgmp3-dev libmpfr-dev libmpc-dev libppl0.10-dev libcloog-ppl-dev \
1382
 
                | fgrep -v '<none>' >> ts-include; \
1383
 
            echo '' >> ts-include; \
1384
 
            cat ../$(patch_stamp) >> ts-include; \
1385
 
            BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1386
 
              $(srcdir)/contrib/test_summary \
1387
 
                -i ts-include -m "$(S_EMAIL)" \
1388
 
          ) > raw-test-summary; \
1389
 
          if [ -n "$(testsuite_tarball)" ]; then \
1390
 
            echo "Test suite used: $(testsuite_srcdir)" > test-summary; \
1391
 
            echo "  Do not interpret the results on its own" >> test-summary; \
1392
 
            echo "  but compare them with the results from" >> test-summary; \
1393
 
            echo "  the gcc-snapshot package." >> test-summary; \
1394
 
          fi; \
1395
 
          sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary \
1396
 
                >> test-summary; \
1397
 
          awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF >> test-summary; \
1398
 
          if [ -f bootstrap-summary -a "$(bootstrap_target)" != profiledbootstrap ]; then \
1399
 
            echo '' >> test-summary; \
1400
 
            cat bootstrap-summary >> test-summary; \
1401
 
          fi; \
1402
 
          echo 'BEGIN test-summary'; \
1403
 
          cat test-summary; \
1404
 
          echo 'END test-summary'; \
1405
 
        fi
1406
 
 
1407
 
        touch $(check_stamp)
1408
 
 
1409
 
$(check_inst_stamp): $(check_stamp)
1410
 
        rm -f test-inst-protocol
1411
 
 
1412
 
ifeq ($(start_logwatch),yes)
1413
 
        : # start logwatch script for regular output during test runs
1414
 
        chmod +x debian/logwatch.sh
1415
 
        -debian/logwatch.sh -t 900 -p $(builddir)/logwatch-inst.pid \
1416
 
                -m '\ntestsuite (3.3) still running ...\n' \
1417
 
                test-inst-protocol \
1418
 
                check-inst/{gcc,g++,g77,objc}.log \
1419
 
                &
1420
 
endif
1421
 
 
1422
 
        rm -rf check-inst
1423
 
        mkdir check-inst
1424
 
 
1425
 
        echo "Running testsuite ..."
1426
 
        -$(ULIMIT_M) ; \
1427
 
            $(SET_SHELL) \
1428
 
            $(SET_LOCPATH) \
1429
 
            EXTRA_TEST_PFLAGS=-g0 \
1430
 
            DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1431
 
          cd check-inst && $(srcdir)/contrib/test_installed \
1432
 
            --with-gcc=gcc-3.3 --with-g++=g++-3.3 --with-g77=g77-3.3 \
1433
 
                2>&1 | tee test-inst-protocol
1434
 
 
1435
 
        -ps aux | fgrep logwatch | fgrep -v fgrep
1436
 
        if [ -f $(builddir)/logwatch-inst.pid ]; then \
1437
 
          kill -1 `cat $(builddir)/logwatch-inst.pid`; \
1438
 
        else \
1439
 
          true; \
1440
 
        fi
1441
 
        -ps aux | fgrep logwatch | fgrep -v fgrep
1442
 
 
1443
 
        -chmod 755 $(srcdir)/contrib/test_summary
1444
 
        if [ -x $(srcdir)/contrib/test_summary ]; then \
1445
 
          rm -f test-inst-summary; \
1446
 
          ( \
1447
 
            cd check-inst; \
1448
 
            echo '' > ts-include; \
1449
 
            echo '' >> ts-include; \
1450
 
            echo "Build Dependencies:" >> ts-include; \
1451
 
            dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1452
 
                libgmp3-dev libmpfr-dev libmpc-dev libppl0.10-dev libcloog-ppl-dev \
1453
 
                | fgrep -v '<none>' >> ts-include; \
1454
 
            echo '' >> ts-include; \
1455
 
            echo 'Results for the installed GCC-3.3 compilers' >> ts-include; \
1456
 
            $(srcdir)/contrib/test_summary \
1457
 
                -i ts-include -m "$(S_EMAIL)" \
1458
 
          ) > raw-test-inst-summary; \
1459
 
          sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-inst-summary \
1460
 
                >> test-inst-summary; \
1461
 
          awk '/^cat/, /^EOF/' raw-test-inst-summary \
1462
 
                | grep -v EOF >> test-inst-summary; \
1463
 
          echo 'BEGIN test-installed-summary'; \
1464
 
          cat test-inst-summary; \
1465
 
          echo 'END test-installed-summary'; \
1466
 
        fi
1467
 
 
1468
 
        chmod 755 debian/reduce-test-diff.awk
1469
 
        if diff -u test-inst-summary test-summary \
1470
 
                | debian/reduce-test-diff.awk > diff-summary; \
1471
 
        then \
1472
 
          mv -f diff-summary testsuite-comparision; \
1473
 
        else \
1474
 
          ( \
1475
 
            echo "WARNING: New failures in gcc-3.4 compared to gcc-3.3"; \
1476
 
            echo ''; \
1477
 
            cat diff-summary; \
1478
 
          ) > testsuite-comparision; \
1479
 
          rm -f diff-summary; \
1480
 
        fi
1481
 
        touch $(check_inst_stamp)
1482
 
 
1483
 
clean: debian/control
1484
 
        dh_testdir
1485
 
        rm -f pxxx status
1486
 
        rm -f *-summary *-protocol testsuite-comparision summary-diff
1487
 
        if [ -f $(srcdir)/gcc/p/config-lang.in.debian ]; then \
1488
 
          mv -f $(srcdir)/gcc/p/config-lang.in.debian $(srcdir)/gcc/p/config-lang.in; \
1489
 
        else true; fi
1490
 
        rm -f $(srcdir)/gcc/po/*.gmo
1491
 
        rm -f debian/lib{gcc,gcj,objc,stdc++}{-v3,[0-9]}*.{{pre,post}{inst,rm},shlibs}
1492
 
        fs=`echo debian/*BV* debian/*GCJ* debian/*CXX* debian/*LC* debian/*MF* | sort -u`; \
1493
 
        for f in $$fs; do \
1494
 
          [ -f $$f ] || continue; \
1495
 
          f2=$$(echo $$f \
1496
 
                | sed 's/BV/$(BASE_VERSION)/;s/CXX/$(CXX_SONAME)/;s/LGCJ/$(PKG_LIBGCJ_EXT)/;s/GCJ/$(PKG_GCJ_EXT)/;s/LC/$(GCC_SONAME)/;s/MF/$(MUDFLAP_SONAME)/;s/-CRB/$(cross_bin_arch)/;s/\.in$$//'); \
1497
 
          rm -f $$f2; \
1498
 
        done
1499
 
        rm -f debian/shlibs.local debian/substvars.local
1500
 
        rm -f debian/*.debhelper
1501
 
        -[ -d debian/bugs ] && $(MAKE) -C debian/bugs clean
1502
 
        rm -f debian/README.libstdc++-baseline debian/README.Bugs debian/README.Debian.$(DEB_TARGET_ARCH)
1503
 
        rm -f debian/lib*gcj-bc.shlibs
1504
 
        rm -rf bin locales share
1505
 
        rm -rf check-inst
1506
 
        rm -rf .pc
1507
 
        dh_clean
1508
 
 
1509
 
# -----------------------------------------------------------------------------
1510
 
# some abbrevations for the package names and directories;
1511
 
# p_XXX is the package name, d_XXX is the package directory
1512
 
# these macros are only used in the binary-* targets.
1513
 
 
1514
 
ifeq ($(versioned_packages),yes)
1515
 
  pkg_ver := -$(BASE_VERSION)
1516
 
endif
1517
 
 
1518
 
ifneq ($(DEB_CROSS),yes)
1519
 
  p_base = gcc$(pkg_ver)-base
1520
 
  p_gcc  = gcc$(pkg_ver)
1521
 
  p_cpp  = cpp$(pkg_ver)
1522
 
  p_cppd = cpp$(pkg_ver)-doc
1523
 
  p_cxx  = g++$(pkg_ver)
1524
 
  p_doc  = gcc$(pkg_ver)-doc
1525
 
  p_lgcc = libgcc$(GCC_SONAME)
1526
 
else
1527
 
  # only triggered if DEB_CROSS set
1528
 
  p_base = gcc$(pkg_ver)$(cross_bin_arch)-base
1529
 
  p_cpp  = cpp$(pkg_ver)$(cross_bin_arch)
1530
 
  p_gcc  = gcc$(pkg_ver)$(cross_bin_arch)
1531
 
  p_cxx  = g++$(pkg_ver)$(cross_bin_arch)
1532
 
endif
1533
 
p_hppa64 = gcc$(pkg_ver)-hppa64
1534
 
 
1535
 
d       = debian/tmp
1536
 
d_base  = debian/$(p_base)
1537
 
d_gcc   = debian/$(p_gcc)
1538
 
d_cpp   = debian/$(p_cpp)
1539
 
d_cppd  = debian/$(p_cppd)
1540
 
d_cxx   = debian/$(p_cxx)
1541
 
d_doc   = debian/$(p_doc)
1542
 
d_lgcc  = debian/$(p_lgcc)
1543
 
d_hppa64= debian/$(p_hppa64)
1544
 
 
1545
 
d_spu   = debian/tmp-spu
1546
 
d_neon   = debian/tmp-neon
1547
 
 
1548
 
common_substvars = \
1549
 
        $(shell awk "{printf \"'-V%s' \", \$$0}" debian/substvars.local)
1550
 
 
1551
 
ifeq ($(DEB_CROSS),yes)
1552
 
  lib_binaries := indep_binaries
1553
 
else
1554
 
  lib_binaries := arch_binaries
1555
 
endif
1556
 
 
1557
 
# ---------------------------------------------------------------------------
1558
 
 
1559
 
ifeq ($(PKGSOURCE),gcc-snapshot)
1560
 
  include debian/rules.d/binary-snapshot.mk
1561
 
else
1562
 
 
1563
 
ifneq ($(DEB_CROSS),yes)
1564
 
ifeq ($(with_source),yes)
1565
 
  include debian/rules.d/binary-source.mk
1566
 
endif
1567
 
endif
1568
 
 
1569
 
ifneq ($(BACKPORT),true)
1570
 
ifeq ($(with_gccxbase),yes)
1571
 
  include debian/rules.d/binary-base.mk
1572
 
endif
1573
 
 
1574
 
ifeq ($(with_gccbase),yes)
1575
 
  include debian/rules.d/binary-base.mk
1576
 
endif
1577
 
 
1578
 
ifneq ($(DEB_STAGE),stage1)
1579
 
  include debian/rules.d/binary-libgcc.mk
1580
 
endif
1581
 
 
1582
 
ifeq ($(with_libqmath),yes)
1583
 
  include debian/rules.d/binary-libquadmath.mk
1584
 
endif
1585
 
 
1586
 
ifeq ($(with_libgmath),yes)
1587
 
  include debian/rules.d/binary-libgccmath.mk
1588
 
endif
1589
 
 
1590
 
ifeq ($(with_libgomp),yes)
1591
 
  include debian/rules.d/binary-libgomp.mk
1592
 
endif
1593
 
 
1594
 
ifeq ($(with_cdev),yes)
1595
 
  include debian/rules.d/binary-cpp.mk
1596
 
endif
1597
 
 
1598
 
ifeq ($(with_fixincl),yes)
1599
 
  include debian/rules.d/binary-fixincl.mk
1600
 
endif
1601
 
 
1602
 
ifeq ($(with_mudflap),yes)
1603
 
  include debian/rules.d/binary-libmudflap.mk
1604
 
endif
1605
 
 
1606
 
ifeq ($(with_libssp),yes)
1607
 
  include debian/rules.d/binary-libssp.mk
1608
 
endif
1609
 
 
1610
 
ifeq ($(with_objcxx),yes)
1611
 
  include debian/rules.d/binary-objcxx.mk
1612
 
endif
1613
 
 
1614
 
ifeq ($(with_objc),yes)
1615
 
  include debian/rules.d/binary-objc.mk
1616
 
endif
1617
 
ifeq ($(with_libobjc),yes)
1618
 
  include debian/rules.d/binary-libobjc.mk
1619
 
endif
1620
 
 
1621
 
ifeq ($(with_go),yes)
1622
 
  include debian/rules.d/binary-go.mk
1623
 
endif
1624
 
 
1625
 
# include before cxx
1626
 
ifeq ($(with_java),yes)
1627
 
  include debian/rules.d/binary-java.mk
1628
 
endif
1629
 
 
1630
 
ifeq ($(with_cxxdev),yes)
1631
 
  include debian/rules.d/binary-cxx.mk
1632
 
endif
1633
 
ifeq ($(with_cxx),yes)
1634
 
  include debian/rules.d/binary-libstdcxx.mk
1635
 
endif
1636
 
 
1637
 
ifeq ($(with_f77),yes)
1638
 
  include debian/rules.d/binary-f77.mk
1639
 
endif
1640
 
 
1641
 
ifeq ($(with_fortran),yes)
1642
 
  include debian/rules.d/binary-fortran.mk
1643
 
endif
1644
 
 
1645
 
ifeq ($(with_ada),yes)
1646
 
  include debian/rules.d/binary-ada.mk
1647
 
endif
1648
 
 
1649
 
ifeq ($(with_d),yes)
1650
 
  include debian/rules.d/binary-d.mk
1651
 
endif
1652
 
 
1653
 
ifeq ($(with_libnof),yes)
1654
 
  ifeq ($(DEB_TARGET_GNU_CPU),powerpc)
1655
 
    include debian/rules.d/binary-nof.mk
1656
 
  endif
1657
 
endif
1658
 
 
1659
 
# gcc must be moved/built after g77 and g++
1660
 
ifeq ($(with_cdev),yes)
1661
 
  include debian/rules.d/binary-gcc.mk
1662
 
endif
1663
 
 
1664
 
ifeq ($(with_hppa64),yes)
1665
 
  include debian/rules.d/binary-hppa64.mk
1666
 
endif
1667
 
 
1668
 
ifeq ($(with_neon),yes)
1669
 
  include debian/rules.d/binary-neon.mk
1670
 
endif
1671
 
 
1672
 
ifeq ($(with_spu),yes)
1673
 
  include debian/rules.d/binary-spu.mk
1674
 
endif
1675
 
endif
1676
 
 
1677
 
endif # ($(PKGSOURCE),gcc-snapshot)
1678
 
 
1679
 
# ----------------------------------------------------------------------
1680
 
install: $(install_dependencies)
1681
 
 
1682
 
$(install_dummy_stamp): $(build_dummy_stamp)
1683
 
        touch $(install_dummy_stamp)
1684
 
 
1685
 
$(install_snap_stamp): $(build_dependencies)
1686
 
        dh_testdir
1687
 
        dh_testroot
1688
 
        dh_clean -k
1689
 
 
1690
 
        : # Install directories
1691
 
        rm -rf $(d)
1692
 
        mkdir -p $(d)/$(PF)
1693
 
 
1694
 
ifeq ($(with_hppa64),yes)
1695
 
        : # Install hppa64
1696
 
        $(SET_PATH) \
1697
 
            $(MAKE) -C $(builddir_hppa64) \
1698
 
                CC="$(CC)" \
1699
 
                $(CFLAGS_TO_PASS) \
1700
 
                $(LDFLAGS_TO_PASS) \
1701
 
                DESTDIR=$(PWD)/$(d) \
1702
 
                    install
1703
 
 
1704
 
        ls -l $(d)/$(PF)/bin
1705
 
        if [ ! -x $(d)/$(PF)/bin/hppa64-linux-gnu-gcc ]; then \
1706
 
          mv $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4* $(d)/$(PF)/bin/hppa64-linux-gnu-gcc; \
1707
 
        else \
1708
 
          rm -f $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4*; \
1709
 
        fi
1710
 
 
1711
 
        : # remove files not needed from the hppa64 build
1712
 
        rm -rf $(d)/$(PF)/share/info
1713
 
        rm -rf $(d)/$(PF)/share/man
1714
 
        rm -f $(d)/$(PF)/$(libdir)/libiberty.a
1715
 
        rm -f $(d)/$(PF)/bin/*{gcov,gccbug,gcc}
1716
 
 
1717
 
        rm -rf $(d)/$(PF)/hppa64-linux-gnu/include
1718
 
        rm -rf $(d)/$(PF)/hppa64-linux-gnu/lib
1719
 
        set -e; \
1720
 
          cd $(d)/$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/include-fixed; \
1721
 
          for i in *; do \
1722
 
            case "$$i" in \
1723
 
              README|features.h|syslimits.h|limits.h) ;; \
1724
 
              linux|$(TARGET_ALIAS)) ;; \
1725
 
              $(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1726
 
              *) echo "remove include-fixed/$$i"; rm -rf $$i; \
1727
 
            esac; \
1728
 
          done
1729
 
endif
1730
 
 
1731
 
ifeq ($(with_spu),yes)
1732
 
        : # Install spu
1733
 
        $(SET_PATH) \
1734
 
            $(MAKE) -C $(builddir_spu) \
1735
 
                CC="$(CC)" \
1736
 
                $(CFLAGS_TO_PASS) \
1737
 
                $(LDFLAGS_TO_PASS) \
1738
 
                DESTDIR=$(PWD)/$(d) \
1739
 
                    install
1740
 
 
1741
 
        ls -l $(d)/$(PF)/bin
1742
 
        if [ ! -x $(d)/$(PF)/bin/spu-gcc ]; then \
1743
 
          mv $(d)/$(PF)/bin/spu-gcc-4* $(d)/$(PF)/bin/spu-gcc; \
1744
 
        else \
1745
 
          rm -f $(d)/$(PF)/bin/spu-gcc-4*; \
1746
 
        fi
1747
 
        if [ ! -x $(d)/$(PF)/bin/spu-g++ ]; then \
1748
 
          mv $(d)/$(PF)/bin/spu-g++-4* $(d)/$(PF)/bin/spu-g++; \
1749
 
        else \
1750
 
          rm -f $(d)/$(PF)/bin/spu-g++-4*; \
1751
 
        fi
1752
 
ifneq (,$(findstring fortran, $(spu_configure_args)))
1753
 
        if [ ! -x $(d)/$(PF)/bin/spu-gfortran ]; then \
1754
 
          mv $(d)/$(PF)/bin/spu-gfortran-4* $(d)/$(PF)/bin/spu-gfortran; \
1755
 
        else \
1756
 
          rm -f $(d)/$(PF)/bin/spu-gfortran-4*; \
1757
 
        fi
1758
 
endif
1759
 
        rm -f $(d)/$(PF)/bin/spu-c++*
1760
 
 
1761
 
        : # remove files not needed from the spu build
1762
 
        rm -rf $(d)/$(PF)/info $(d)/$(PF)/share/info
1763
 
        rm -rf $(d)/$(PF)/man $(d)/$(PF)/share/man
1764
 
        rm -rf $(d)/$(PF)/$(libdir)/gcc/spu/$(GCC_VERSION)/plugin
1765
 
        rm -f $(d)/$(PF)/$(libdir)/libiberty.a
1766
 
        rm -f $(d)/$(PF)/bin/*{gcov,gccbug,gcc}
1767
 
 
1768
 
# FIXME
1769
 
#       rm -rf $(d)/$(PF)/spu/include
1770
 
#       rm -rf $(d)/$(PF)/spu/lib
1771
 
        -set -e; \
1772
 
          cd $(d)/$(PF)/$(libdir)/gcc/spu/$(GCC_VERSION)/include-fixed; \
1773
 
          for i in *; do \
1774
 
            case "$$i" in \
1775
 
              README|features.h|syslimits.h|limits.h) ;; \
1776
 
              linux|$(TARGET_ALIAS)) ;; \
1777
 
              $(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1778
 
              *) echo "remove include-fixed/$$i"; rm -rf $$i; \
1779
 
            esac; \
1780
 
          done
1781
 
endif
1782
 
 
1783
 
        : # Work around PR lto/41569
1784
 
        ln -sf gcc $(builddir)/prev-gcc
1785
 
 
1786
 
        : # Install everything
1787
 
        $(SET_PATH) \
1788
 
        $(SET_SHELL) \
1789
 
          $(MAKE) -C $(builddir) \
1790
 
            $(CFLAGS_TO_PASS) \
1791
 
            $(LDFLAGS_TO_PASS) \
1792
 
            DESTDIR=$(PWD)/$(d) \
1793
 
            infodir=/$(PF)/share/info \
1794
 
            mandir=/$(PF)/share/man \
1795
 
                install
1796
 
 
1797
 
        ls -l $(d)/$(PF)/bin
1798
 
        if [ ! -x $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc ]; then \
1799
 
          mv $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4* $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc; \
1800
 
        else \
1801
 
          rm -f $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4*; \
1802
 
        fi
1803
 
        set -e; \
1804
 
          cd $(d)/$(gcc_lib_dir)/include-fixed; \
1805
 
          for i in *; do \
1806
 
            case "$$i" in \
1807
 
              README|features.h|syslimits.h|limits.h) ;; \
1808
 
              linux|$(TARGET_ALIAS)) ;; \
1809
 
              $(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1810
 
              *) echo "remove include-fixed/$$i"; rm -rf $$i; \
1811
 
            esac; \
1812
 
          done
1813
 
 
1814
 
ifeq ($(biarch64)-$(with_cxx),yes-yes)
1815
 
  ifneq (,$(filter libstdc++-v3, $(biarch_multidir_names)))
1816
 
        : # fix biarch C++ header installation
1817
 
    ifeq ($(DEB_TARGET_ARCH),i386)
1818
 
        mv $(d)/$(cxx_inc_dir)/x86_64-linux-gnu/64 \
1819
 
          $(d)/$(cxx_inc_dir)/i486-linux-gnu/
1820
 
        rmdir $(d)/$(cxx_inc_dir)/x86_64-linux-gnu
1821
 
    endif
1822
 
    ifeq ($(DEB_TARGET_ARCH),powerpc)
1823
 
        mv $(d)/$(cxx_inc_dir)/powerpc64-linux-gnu/64 \
1824
 
          $(d)/$(cxx_inc_dir)/powerpc-linux-gnu/
1825
 
        rmdir $(d)/$(cxx_inc_dir)/powerpc64-linux-gnu
1826
 
    endif
1827
 
    ifeq ($(DEB_TARGET_ARCH),s390)
1828
 
        mv $(d)/$(cxx_inc_dir)/s390x-linux-gnu/64 \
1829
 
          $(d)/$(cxx_inc_dir)/s390-linux-gnu/
1830
 
        rmdir $(d)/$(cxx_inc_dir)/s390x-linux-gnu
1831
 
    endif
1832
 
  endif
1833
 
endif
1834
 
 
1835
 
# FIXME: libjava/classpath not correctly patched
1836
 
ifeq ($(with_java),yes)
1837
 
        -if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
1838
 
          ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1839
 
          mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
1840
 
            $(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
1841
 
          rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1842
 
        fi
1843
 
 
1844
 
        ln -sf libgcj.so.$(GCJ_SONAME).0.0 $(d)/$(PF)/lib/libgcj_bc.so.1.0.0
1845
 
 
1846
 
        install -m 755 $(d)/$(PF)/lib/libgcj_bc.so.1 \
1847
 
                $(d)/$(gcc_lib_dir)/libgcj_bc.so
1848
 
        $(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic -xc /dev/null \
1849
 
                -o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
1850
 
        $(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic \
1851
 
                $(srcdir)/libjava/libgcj_bc.c \
1852
 
                -o $(d)/$(gcc_lib_dir)/libgcj_bc.so \
1853
 
                -Wl,-soname,libgcj_bc.so.1 $(builddir)/libgcj.so -shared-libgcc
1854
 
endif
1855
 
 
1856
 
        -ls -l $(d)/usr
1857
 
        if [ -d $(d)/usr/man/man1 ]; then \
1858
 
          mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \
1859
 
        fi
1860
 
 
1861
 
        chmod 755 debian/dh_*
1862
 
        touch $(install_snap_stamp)
1863
 
 
1864
 
$(install_stamp): $(build_stamp)
1865
 
        dh_testdir
1866
 
        dh_testroot
1867
 
        dh_clean -k -N$(p_hppa64)
1868
 
 
1869
 
        if [ -f $(binary_stamp)-hppa64 ]; then \
1870
 
          mv $(binary_stamp)-hppa64 saved-stamp-hppa64; \
1871
 
        fi
1872
 
        if [ -f $(binary_stamp)-spu ]; then \
1873
 
          mv $(binary_stamp)-spu saved-stamp-spu; \
1874
 
        fi
1875
 
        rm -f $(binary_stamp)*
1876
 
        if [ -f saved-stamp-hppa64 ]; then \
1877
 
          mv saved-stamp-hppa64 $(binary_stamp)-hppa64; \
1878
 
        fi
1879
 
        if [ -f saved-stamp-spu ]; then \
1880
 
          mv saved-stamp-spu $(binary_stamp)-spu; \
1881
 
        fi
1882
 
 
1883
 
        : # Install directories
1884
 
        rm -rf $(d)
1885
 
        mkdir -p $(d)/$(libdir) $(d)/$(PF) $(d)/$(PF)/$(libdir)/debug
1886
 
ifeq ($(biarch32),yes)
1887
 
        mkdir -p $(d)/$(PF)/lib32/debug
1888
 
endif
1889
 
ifeq ($(biarch64),yes)
1890
 
        mkdir -p $(d)/$(PF)/lib64/debug
1891
 
endif
1892
 
ifeq ($(biarchn32),yes)
1893
 
        mkdir -p $(d)/$(PF)/$(libn32)/debug
1894
 
endif
1895
 
 
1896
 
ifneq (,$(filter $(DEB_TARGET_GNU_CPU),x86_64 sparc64))
1897
 
        : # link lib to lib64 and $(PF)/lib to $(PF)/lib64
1898
 
        : # (this works when CONFARGS contains '--disable-multilib')
1899
 
        ln -s $(libdir) $(d)/lib64
1900
 
        mkdir -p $(d)/$(PF)/$(libdir)
1901
 
        ln -s $(libdir) $(d)/$(PF)/lib64
1902
 
endif
1903
 
 
1904
 
        : # Work around PR lto/41569
1905
 
        ln -sf gcc $(builddir)/prev-gcc
1906
 
 
1907
 
        : # Install everything
1908
 
        $(SET_PATH) \
1909
 
        $(SET_SHELL) \
1910
 
          $(MAKE) -C $(builddir) \
1911
 
            $(CFLAGS_TO_PASS) \
1912
 
            $(LDFLAGS_TO_PASS) \
1913
 
            DESTDIR=$(PWD)/$(d) \
1914
 
            infodir=/$(PF)/share/info \
1915
 
            mandir=/$(PF)/share/man \
1916
 
                install
1917
 
 
1918
 
ifeq ($(with_common_gcclibdir),yes)
1919
 
        mv $(d)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_lib_dir)) \
1920
 
                $(d)/$(gcc_lib_dir)
1921
 
        if [ -d $(d)/$(PF)/share/gcc-$(GCC_VERSION) ] ; then \
1922
 
                mv $(d)/$(PF)/share/gcc-$(GCC_VERSION) $(d)/$(PF)/share/gcc-$(BASE_VERSION); \
1923
 
        fi
1924
 
  ifneq ($(gcc_lib_dir),$(gcc_lexec_dir))
1925
 
        mv $(d)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_lexec_dir)) \
1926
 
                $(d)/$(gcc_lexec_dir)
1927
 
  endif
1928
 
  ifeq ($(with_d),yes)
1929
 
        mv $(d)/$(PF)/include/d/$(GCC_VERSION) \
1930
 
                $(d)/$(PF)/include/d/$(BASE_VERSION)
1931
 
  endif
1932
 
endif
1933
 
 
1934
 
ifeq ($(biarch64)-$(with_cxx),yes-yes)
1935
 
  ifneq (,$(filter libstdc++-v3, $(biarch_multidir_names)))
1936
 
    ifeq ($(DEB_TARGET_ARCH),i386)
1937
 
        : # fix biarch C++ header installation
1938
 
        mv $(d)/$(cxx_inc_dir)/x86_64-linux-gnu/64 \
1939
 
          $(d)/$(cxx_inc_dir)/i486-linux-gnu/
1940
 
        rmdir $(d)/$(cxx_inc_dir)/x86_64-linux-gnu
1941
 
    endif
1942
 
    ifeq ($(DEB_TARGET_ARCH),powerpc)
1943
 
        : # fix biarch C++ header installation
1944
 
        mv $(d)/$(cxx_inc_dir)/powerpc64-linux-gnu/64 \
1945
 
          $(d)/$(cxx_inc_dir)/powerpc-linux-gnu/
1946
 
        rmdir $(d)/$(cxx_inc_dir)/powerpc64-linux-gnu
1947
 
    endif
1948
 
  endif
1949
 
endif
1950
 
 
1951
 
# FIXME: libjava/classpath not correctly patched
1952
 
ifeq ($(with_java),yes)
1953
 
        -if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
1954
 
          ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1955
 
          mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
1956
 
            $(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
1957
 
          rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1958
 
        fi
1959
 
endif
1960
 
 
1961
 
        : # remove rpath settings from binaries and shared libs
1962
 
        for i in $$(chrpath -k $(d)/$(PF)/bin/* $(d)/$(PF)/lib*/lib*.so.* \
1963
 
                        $(d)/$(PF)/lib*/gcj$(pkg_ver)*/lib*.so.* \
1964
 
                        2>/dev/null | awk -F: '/RPATH=/ {print $$1}'); \
1965
 
        do \
1966
 
          case "$$i" in ecj1|*gij-*|*libjawt*|*libjvm*) continue; esac; \
1967
 
          [ -h $$i ] && continue; \
1968
 
          chrpath --delete $$i; \
1969
 
          echo "removed RPATH: $$i"; \
1970
 
        done
1971
 
 
1972
 
        : # remove '*.la' and '*.lai' files, not shipped in any package.
1973
 
        find $(d) -name '*.la' -o -name '*.lai' | xargs -r rm -f
1974
 
 
1975
 
ifneq ($(with_libgnat),yes)
1976
 
        rm -f $(d)/$(gcc_lib_dir)/adalib/lib*.so*
1977
 
endif
1978
 
 
1979
 
ifeq ($(GFDL_INVARIANT_FREE),yes)
1980
 
        for i in gcc gcov; do \
1981
 
          I=`echo $$i | tr a-z A-Z`; \
1982
 
          sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
1983
 
            debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
1984
 
        done
1985
 
 
1986
 
  ifeq ($(with_fortran),yes)
1987
 
        for i in g77; do \
1988
 
          I=`echo $$i | tr a-z A-Z`; \
1989
 
          sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
1990
 
            debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
1991
 
        done
1992
 
  endif
1993
 
  ifeq ($(with_java),yes)
1994
 
        for i in gcj gcjh gij jv-convert jv-scan jcf-dump grmic grmiregistry; \
1995
 
        do \
1996
 
          I=`echo $$i | tr a-z A-Z`; \
1997
 
          sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
1998
 
            debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
1999
 
        done
2000
 
  endif
2001
 
endif
2002
 
 
2003
 
#  ifeq ($(with_ada),yes)
2004
 
#       : # rename files (versioned ada binaries)
2005
 
#       for i in ; do \
2006
 
#         mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2007
 
#         mv $(d)/$(PF)/share/man/man1/$$i.1 \
2008
 
#               $(d)/$(PF)/share/man/man1/$$i-$(GNAT_VERSION).1; \
2009
 
#       done
2010
 
#       for i in $(GNAT_TOOLS); do \
2011
 
#         mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2012
 
#       done
2013
 
#  endif
2014
 
 
2015
 
ifeq ($(DEB_CROSS),yes)
2016
 
  ifeq ($(DEB_TARGET_ARCH)-$(biarch64),s390-yes)
2017
 
        : # s390 64bit stuff happens to be in s390x-linux-gnu/lib64/
2018
 
        mkdir -p $(d)/$(PF)/s390-linux-gnu/lib64
2019
 
        cp -a $(d)/$(PF)/s390x-linux-gnu/lib64/* $(d)/$(PF)/s390-linux-gnu/lib64/
2020
 
  endif
2021
 
  ifeq ($(DEB_TARGET_ARCH)-$(biarch64),powerpc-yes)
2022
 
        : # ppc 64bit build slaps libgcc and libstdc++ to powerpc64-linux-gnu
2023
 
        cp -a $(d)/$(PF)/powerpc64-linux-gnu/lib64/* $(d)/$(PF)/powerpc-linux-gnu/lib64/
2024
 
  endif
2025
 
endif
2026
 
 
2027
 
        chmod 755 debian/dh_*
2028
 
 
2029
 
#       tar cf tmp.tar debian/tmp
2030
 
 
2031
 
        touch $(install_stamp)
2032
 
 
2033
 
$(install_hppa64_stamp): $(build_hppa64_stamp)
2034
 
        dh_testdir
2035
 
        dh_testroot
2036
 
        rm -rf $(d_hppa64)
2037
 
        mkdir -p $(d_hppa64)/$(PF)
2038
 
 
2039
 
        $(SET_PATH) \
2040
 
            $(MAKE) -C $(builddir_hppa64) \
2041
 
                CC="$(CC)" \
2042
 
                $(CFLAGS_TO_PASS) \
2043
 
                $(LDFLAGS_TO_PASS) \
2044
 
                DESTDIR=$(PWD)/$(d_hppa64) \
2045
 
                    install
2046
 
 
2047
 
ifeq ($(versioned_packages),yes)
2048
 
        mv $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-gcc-$(GCC_VERSION) \
2049
 
                $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-gcc$(pkg_ver)
2050
 
        mv $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp \
2051
 
                $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp$(pkg_ver)
2052
 
endif
2053
 
 
2054
 
ifneq ($(PKGSOURCE),gcc-snapshot)
2055
 
        : # remove files not needed
2056
 
        rm -rf $(d_hppa64)/$(PF)/info $(d_hppa64)/$(PF)/share/info
2057
 
        rm -rf $(d_hppa64)/$(PF)/man $(d_hppa64)/$(PF)/share/man
2058
 
        rm -rf $(d_hppa64)/$(PF)/$(libdir)/gcc/spu/$(GCC_VERSION)/plugin
2059
 
        rm -f $(d_hppa64)/$(PF)/$(libdir)/libiberty.a
2060
 
        rm -f $(d_hppa64)/$(PF)/bin/*{gcov,gccbug,gcc}
2061
 
 
2062
 
        rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/include
2063
 
        rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/lib
2064
 
        rm -rf $(d_hppa64)//$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/install-tools
2065
 
endif
2066
 
 
2067
 
        touch $(install_hppa64_stamp)
2068
 
 
2069
 
$(install_neon_stamp): $(build_neon_stamp)
2070
 
        dh_testdir
2071
 
        dh_testroot
2072
 
        rm -rf $(d_neon)
2073
 
        mkdir -p $(d_neon)/$(PF)
2074
 
 
2075
 
        $(SET_PATH) \
2076
 
            $(MAKE) -C $(builddir_neon) \
2077
 
                CC="$(CC)" \
2078
 
                $(CFLAGS_TO_PASS) \
2079
 
                $(LDFLAGS_TO_PASS) \
2080
 
                DESTDIR=$(PWD)/$(d_neon) \
2081
 
                    install
2082
 
        touch $(install_neon_stamp)
2083
 
 
2084
 
$(install_spu_stamp): $(build_spu_stamp)
2085
 
        dh_testdir
2086
 
        dh_testroot
2087
 
        rm -rf $(d_spu)
2088
 
        mkdir -p $(d_spu)/$(PF)
2089
 
 
2090
 
        $(SET_PATH) \
2091
 
            $(MAKE) -C $(builddir_spu) \
2092
 
                CC="$(CC)" \
2093
 
                $(CFLAGS_TO_PASS) \
2094
 
                $(LDFLAGS_TO_PASS) \
2095
 
                DESTDIR=$(PWD)/$(d_spu) \
2096
 
                    install
2097
 
 
2098
 
ifeq ($(with_common_gcclibdir),yes)
2099
 
        mv $(d_spu)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_spu_lib_dir)) \
2100
 
                $(d_spu)/$(gcc_spu_lib_dir)
2101
 
  ifneq ($(gcc_spu_lib_dir),$(gcc_spu_lexec_dir))
2102
 
        mv $(d_spu)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_spu_lexec_dir)) \
2103
 
                $(d_spu)/$(gcc_spu_lexec_dir)
2104
 
  endif
2105
 
endif
2106
 
 
2107
 
ifeq ($(versioned_packages),yes)
2108
 
        mv $(d_spu)/$(PF)/bin/spu-cpp \
2109
 
                $(d_spu)/$(PF)/bin/spu-cpp$(pkg_ver)
2110
 
        mv $(d_spu)/$(PF)/bin/spu-gcc-$(GCC_VERSION) \
2111
 
                $(d_spu)/$(PF)/bin/spu-gcc$(pkg_ver)
2112
 
        mv $(d_spu)/$(PF)/bin/spu-g++ \
2113
 
                $(d_spu)/$(PF)/bin/spu-g++$(pkg_ver)
2114
 
  ifneq (,$(findstring fortran, $(spu_configure_args)))
2115
 
        mv $(d_spu)/$(PF)/bin/spu-gfortran \
2116
 
                $(d_spu)/$(PF)/bin/spu-gfortran$(pkg_ver)
2117
 
  endif
2118
 
        rm -f $(d_spu)/$(PF)/bin/spu-c++*
2119
 
 
2120
 
  ifneq ($(GFDL_INVARIANT_FREE),yes)
2121
 
        for i in spu-cpp spu-gcc spu-g++ spu-gcov spu-gfortran; do \
2122
 
          mv $(d_spu)/$(PF)/share/man/man1/$$i.1 $(d_spu)/$(PF)/share/man/man1/$$i-$(BASE_VERSION).1; \
2123
 
        done
2124
 
  endif
2125
 
endif
2126
 
 
2127
 
ifneq ($(PKGSOURCE),gcc-snapshot)
2128
 
        : # remove files not needed
2129
 
        rm -rf $(d_spu)/$(PF)/info
2130
 
#       rm -rf $(d_spu)/$(PF)/man
2131
 
        rm -f $(d_spu)/$(PF)/$(libdir)/libiberty.a
2132
 
        rm -f $(d_spu)/$(PF)/bin/*{gcov,gccbug,gcc}
2133
 
 
2134
 
#       rm -rf $(d_spu)/$(PF)/spu/include
2135
 
#       rm -rf $(d_spu)/$(PF)/spu/lib
2136
 
endif
2137
 
 
2138
 
        touch $(install_spu_stamp)
2139
 
 
2140
 
# ----------------------------------------------------------------------
2141
 
# Build architecture-dependent files here.
2142
 
#binary-arch: build install $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2143
 
binary-arch: $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2144
 
ifeq ($(with_check),yes)
2145
 
        @echo Done
2146
 
#       : # Send Email about sucessfull build.
2147
 
#       # cat raw-test-summary | sh; echo "Sent mail to $(S_EMAIL)"
2148
 
endif
2149
 
 
2150
 
# ----------------------------------------------------------------------
2151
 
# Build architecture-independent files here.
2152
 
#binary-indep: build install $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2153
 
binary-indep: $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2154
 
 
2155
 
source diff:
2156
 
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
2157
 
 
2158
 
binary: binary-indep binary-arch
2159
 
.PHONY: build clean binary-indep binary-arch binary