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

« back to all changes in this revision

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