File: rules.conf

package info (click to toggle)
gcc-3.3 1%3A3.3.6ds1-32
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 25,816 kB
  • sloc: sh: 10,372; makefile: 1,050; perl: 155; awk: 23; cpp: 14
file content (250 lines) | stat: -rw-r--r-- 8,547 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# -*- makefile -*-
# rules.conf
#	- used to build debian/control and debian/rules.parameters
#	- assumes unpacked sources

include debian/rules.defs

# The binutils version needed.
# The oldest suitable versions for the various platforms can be found in
# INSTALL/specific.html ; we take a tighter dependency if possible to be on
# the safe side (something like newest( version in stable, versions for the
# various platforms in INSTALL/specific.html) ).
BINUTILSV = 2.15-7
ifdef DEB_CROSS
BINUTILS_BUILD_DEP = binutils$(TS) (>= $(BINUTILSV))
else
BINUTILS_BUILD_DEP = binutils (>= $(BINUTILSV)) | binutils-multiarch (>= $(BINUTILSV))
endif

# libc-dev dependencies
libc_ver := 2.3.2.ds1-16
ifeq ($(distribution),Ubuntu)
  libc_ver := 2.3.5-1ubuntu4
endif
ifeq ($(findstring linux,$(DEB_TARGET_GNU_SYSTEM)),linux)
  ifeq ($(DEB_TARGET_ARCH), $(findstring $(DEB_TARGET_ARCH),alpha ia64))
    LIBC_DEP = libc6.1-dev$(LS) (>= $(libc_ver))
  else
    LIBC_DEP = libc6-dev$(LS) (>= $(libc_ver))
  endif
else
  ifeq ($(DEB_TARGET_GNU_SYSTEM),gnu)
    LIBC_DEP = libc0.3-dev$(LS)
  endif
  ifeq ($(DEB_TARGET_GNU_SYSTEM),kfreebsd-gnu)
    LIBC_DEP = libc0.1-dev$(LS)
  endif
  ifeq ($(DEB_TARGET_GNU_SYSTEM),knetbsd-gnu)
    LIBC_DEP = libc0.1-dev$(LS)
  endif
  ifeq ($(DEB_TARGET_GNU_SYSTEM),netbsd-elf-gnu)
    LIBC_DEP = libc12-dev$(LS)
  endif
endif

LIBC_BUILD_DEP = libc6.1-dev (>= $(libc_ver)) [alpha ia64] | libc0.3-dev [hurd-i386] | libc0.1-dev [kfreebsd-i386] | libc12-dev (>= 2.0.ds1-1) [netbsd-i386] | libc6-dev (>= $(libc_ver))
LIBC_BIARCH_BUILD_DEP = libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390],

ifdef DEB_CROSS
  # When building a cross compiler, the libc-dev build dependancy must be
  # sensitive to the target architecture; the host architecture is irrelevant.
  LIBC_BUILD_DEP = $(LIBC_DEP)
  LIBC_BIARCH_BUILD_DEP =
endif

SOURCE_VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$NF}')
DEB_VERSION := $(shell echo $(SOURCE_VERSION) | sed 's/ds[0-9]*//')
DEB_VERSION_NOREL := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//')
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed 's/.*:\([1-9]\.[0-9]\).*-.*/\1/')

# The version number can be found in gcc/version.c e.g.
# char *version_string = "2.95 19990710 (prerelease)";
VER := $(strip $(shell grep version_string $(srcdir)/gcc/version.c \
			| sed -e 's/^.*= *"//' -e 's/ .*$$//' -e 's/".*$$//'))
# The numeric part of the gcc version number (x.yy.zz)
VERNO := $(strip $(shell echo $(VER) | sed -e 's/gcc-//'))
NEXTVERNO := $(shell echo $(VERNO) | \
		awk -F. '{OFS="."; if (NF==2) $$3=1; else $$NF += 1; print}')
# first version with a new path component in gcc_lib_dir (i.e. GCC_VERSION
# or TARGET_ALIAS changes)
BREAKS_VERSION = 1:3.3.6-7
GPC_DATE := $(shell sed -n 's/^.define GPC_VERSION_STRING "\(.*\)"/\1/p' $(srcdir)/gcc/p/version.h || true)
DEB_GPC_VERSION := $(shell echo $(DEB_VERSION) \
			   | sed 's/.*:\(.*\)-\(.*\)/2:\1.$(GPC_DATE)-\2/')
# semiautomatic ...
DEB_SOVERSION := 1:$(VERNO)-1
DEB_SOVERSION := $(DEB_VERSION)
DEB_SOVERSION := 1:3.3.4-1
DEB_STDCXX_SOVERSION := $(DEB_SOVERSION)
DEB_FFI_SOVERSION := $(DEB_SOVERSION)
DEB_OBJC_SOVERSION := 1:3.3.4-4
DEB_GCC_SOVERSION := 1:3.3.4-3

# manual ...
GCC_SONAME := 1

CXX_SONAME := $(strip $(shell awk -F= \
			'/^libtool_VERSION/ {split($$2,v,":"); print v[1]}' \
			$(srcdir)/libstdc++-v3/configure.in))

OBJC_SONAME := $(strip $(shell awk '/^LIBOBJC_VERSION/ \
					{split($$3,v,":"); print v[1]}' \
				$(srcdir)/libobjc/Makefile.in))

F77_SONAME := $(strip $(shell awk -F= \
			'/^VERSION_MAJOR/ {split($$2,v,":"); print v[1]}' \
				$(srcdir)/libf2c/Makefile.in))

GCJ_SONAME := $(strip $(shell tail -1 $(srcdir)/libjava/libtool-version \
				  | awk -F: '{ print $$1 }' ))

FFI_SONAME := $(strip $(shell tail -1 $(srcdir)/libffi/libtool-version \
				  | awk -F: '{ print $$1 }' ))

GNAT_SONAME := $(strip $(shell \
		grep '[^_]Library_Version.*:' $(srcdir)/gcc/ada/gnatvsn.ads \
		  | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))

GNAT_VERSION := $(BASE_VERSION)

GPC_BASE_VERSION := 2.1

pkg_ver := -$(BASE_VERSION)
gpc_pkg_ver := -$(GPC_BASE_VERSION)$(pkg_ver)

ctrl_flags = \
	-DLIBGCC_CV=$(DEB_GCC_SOVERSION) \
	-DCV=$(DEB_VERSION) \
	-DSOFT_CV=$(DEB_VERSION_NOREL) \
	-DNV=1:$(NEXTVERNO) \
	-DBREAKV=$(BREAKS_VERSION) \
	-DGPC_CV=$(DEB_GPC_VERSION) \
	-DBINUTILSV=$(BINUTILSV) \
	-DSRCNAME=$(PKGSOURCE) \
	-D__$(DEB_TARGET_GNU_CPU)__ \
	-DARCH=$(DEB_TARGET_GNU_CPU)
ifeq ($(with_objc)-$(with_objc_gc),yes-yes)
  ctrl_flags +=	-DOBJC_GC
endif

ctrl_flags += \
	-DLIBC_DEP="$(LIBC_DEP)" \
	-DLIBC_BIARCH_BUILD_DEP="$(LIBC_BIARCH_BUILD_DEP)" \
	-DBINUTILS_BUILD_DEP="$(BINUTILS_BUILD_DEP)" \
	-DLIBC_BUILD_DEP="$(LIBC_BUILD_DEP)" \
	-DTP=$(TP) \
	-DTS=$(TS) \
	-DLS=$(LS)

ifdef DEB_CROSS
  ifeq ($(DEB_TARGET_ARCH),sparc)
    TARGETBD = , libc6-dev-sparc64-sparc-cross
  endif
  ifeq ($(DEB_TARGET_ARCH),s390)
    TARGETBD = , libc6-dev-s390x-s390-cross
  endif
  ifeq ($(DEB_TARGET_ARCH),ia64)
    TARGETBD = , libunwind7-dev-ia64-cross (>= 0.98.3-3)
  endif
  ctrl_flags += \
	-DTARGET=$(DEB_TARGET_ARCH) \
	-DTARGETBD="$(TARGETBD)"
else
  # add '-DPRI=optional' to ctrl_flags if this is not the default compiler
  ctrl_flags += \
	-DPRI=optional
endif

ifeq ($(with_base_only),yes)
  ctrl_flags += \
	-DBASE_ONLY=yes
endif

control: control-file parameters-file versioned-files

ifdef DEB_CROSS
  languages = c c++
  addons = libgcc lib64gcc libcxx lib64cxx cdev c++dev
else
  languages = c c++
  addons = libcxx #libgcc cdev c++dev libnof libs lib64cxx libnof 
  #languages += ada f77 java objc pascal treelang
  #addons += fastjar fdev fixincl javadev libg2c libffi libgcj libobjc \
  #	   lib64ffi lib64gcj lib64objc lib64g2c objcdev proto libgnat \
  #	   lib64gcc
endif

ifneq ($(GFDL_INVARIANT_FREE),yes)
  addons += gfdldoc
endif

control-file:
	echo "addons: $$addons"; \
	m4 $(ctrl_flags) \
	  -DPV=$(pkg_ver) \
	  -DGPC_PV=$(gpc_pkg_ver) \
	  -DCXX_SO=$(CXX_SONAME) \
	  -DGCC_SO=$(GCC_SONAME) \
	  -DOBJC_SO=$(OBJC_SONAME) \
	  -DG2C_SO=$(F77_SONAME) \
	  -DGCJ_SO=$(GCJ_SONAME) \
	  -DGNAT_SO=$(GNAT_SONAME) \
	  -DGNAT_V=$(GNAT_VERSION) \
	  -DFFI_SO=$(FFI_SONAME) \
	  -Denabled_languages="$(languages) $(addons)" \
	  -Dada_no_archs="$(foreach arch,$(ada_no_archs),!$(arch))" \
	  -Djava_no_archs="$(foreach arch,$(java_no_archs),!$(arch))" \
	  -Dpascal_no_archs="$(foreach arch,$(pascal_no_archs),!$(arch))" \
	  -Dlibgc_no_archs="$(foreach arch,$(libgc_no_archs),!$(arch))" \
	  -Dcheck_no_archs="$(foreach arch,$(check_no_archs),!$(arch))" \
	  -Dlocale_no_archs="$(foreach arch,$(locale_no_archs) $(check_no_archs),!$(arch))" \
		debian/control.m4 > debian/control.tmp2
	uniq debian/control.tmp2 > debian/control.tmp
	rm -f debian/control.tmp2
	[ -e debian/control ] \
	  && cmp -s debian/control debian/control.tmp \
	  && rm -f debian/control.tmp && exit 0; \
	  mv debian/control.tmp debian/control; touch $(control_stamp)

parameters-file:
	rm -f debian/rules.parameters.tmp
	( \
		echo '# configuration parameters taken from upstream source files'; \
		echo 'VER		:= $(VER)'; \
		echo 'BASE_VERSION	:= $(BASE_VERSION)'; \
		echo 'SOURCE_VERSION	:= $(SOURCE_VERSION)'; \
		echo 'DEB_VERSION	:= $(DEB_VERSION)'; \
		echo 'GPC_BASE_VERSION	:= $(GPC_BASE_VERSION)'; \
		echo 'DEB_GPC_VERSION	:= $(DEB_GPC_VERSION)'; \
		echo 'DEB_SOVERSION	:= $(DEB_SOVERSION)'; \
		echo 'DEB_FFI_SOVERSION	:= $(DEB_FFI_SOVERSION)'; \
		echo 'DEB_GCC_SOVERSION	:= $(DEB_GCC_SOVERSION)'; \
		echo 'DEB_OBJC_SOVERSION	:= $(DEB_OBJC_SOVERSION)'; \
		echo 'DEB_STDCXX_SOVERSION	:= $(DEB_STDCXX_SOVERSION)'; \
		echo 'GCC_SONAME	:= $(GCC_SONAME)'; \
		echo 'CXX_SONAME	:= $(CXX_SONAME)'; \
		echo 'F77_SONAME	:= $(F77_SONAME)'; \
		echo 'OBJC_SONAME	:= $(OBJC_SONAME)'; \
		echo 'GCJ_SONAME	:= $(GCJ_SONAME)'; \
		echo 'GNAT_VERSION	:= $(GNAT_VERSION)'; \
		echo 'GNAT_SONAME	:= $(GNAT_SONAME)'; \
		echo 'FFI_SONAME	:= $(FFI_SONAME)'; \
		echo 'LIBC_DEP		:= $(LIBC_DEP)'; \
	) > debian/rules.parameters.tmp
	[ -e debian/rules.parameters ] \
	  && cmp -s debian/rules.parameters debian/rules.parameters.tmp \
	  && rm -f debian/rules.parameters.tmp && exit 0; \
	  mv debian/rules.parameters.tmp debian/rules.parameters; \
	  touch $(control_stamp)

versioned-files:
	for f in debian/*-BV*; do \
	  f2=$$(echo $$f \
		| sed 's/BV/$(BASE_VERSION)/;s/PV/$(GPC_BASE_VERSION)/'); \
	  sed -e 's/@BV@/$(BASE_VERSION)/g' \
	      -e 's/@PV@/$(GPC_BASE_VERSION)/g' \
	      -e 's/@GFDL@/$(if $(filter yes,$(GFDL_INVARIANT_FREE)),#)/g' \
	    $$f > $$f2; \
	  touch -r $$f $$f2; \
	done