~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/54/546955a10e753704b1e895ce8a04236d24bffbe3.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

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