File: 0005-setting-all-the-various-paths-options-for-with_deps_.patch

package info (click to toggle)
cross-gcc 249
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 892 kB
  • sloc: sh: 564; makefile: 196
file content (279 lines) | stat: -rw-r--r-- 8,638 bytes parent folder | download | duplicates (4)
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
From 87c1cb1685b781f8c9497ae1d776f29cf07a1f07 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Sun, 3 May 2015 19:28:33 -0700
Subject: [PATCH 05/11] setting all the various paths, options for
 with_deps_on_target_arch_pkgs

---
 debian/rules.conf             |  7 +++--
 debian/rules.d/binary-base.mk |  3 ++-
 debian/rules.d/binary-cpp.mk  |  9 +++++++
 debian/rules.defs             | 34 ++++++++++++++++++++----
 debian/rules2                 | 49 ++++++++++++++++++++++++++++-------
 5 files changed, 85 insertions(+), 17 deletions(-)

diff --git a/debian/rules.conf b/debian/rules.conf
index ae53170..697e27c 100644
--- a/debian/rules.conf
+++ b/debian/rules.conf
@@ -769,7 +769,9 @@ ifeq ($(DEB_CROSS),yes)
 	-DTARGET=$(DEB_TARGET_ARCH) \
 	-DLIBUNWIND_BUILD_DEP="$(LIBUNWIND_BUILD_DEP)" \
 	-DLIBATOMIC_OPS_BUILD_DEP="$(LIBATOMIC_OPS_BUILD_DEP)"
-  ifeq ($(DEB_STAGE),rtlibs)
+
+  # if either DEB_STAGE=rtlibs or wdotap
+  ifneq (,$(filter rtlibs,$(DEB_STAGE))$(filter yes,$(with_deps_on_target_arch_pkgs)))
     ctrl_flags += -DCROSS_ARCH=$(DEB_TARGET_ARCH)
   endif
 else
@@ -1461,7 +1463,8 @@ parameters-file:
 
 symbols-files: control-file
 ifeq ($(DEB_CROSS),yes)
-  ifneq ($(DEB_STAGE),rtlibs)
+  # if DEB_STAGE!=rtlibs && !wdotap === !(DEB_STAGE==rtlibs || wdotap)
+  ifeq (,$(filter rtlibs,$(DEB_STAGE))$(filter yes,$(with_deps_on_target_arch_pkgs)))
 	test -n "$(LS)"
 	set -e; \
 	for p in $$(dh_listpackages -i | grep '^lib'); do \
diff --git a/debian/rules.d/binary-base.mk b/debian/rules.d/binary-base.mk
index 56f9273..f639502 100644
--- a/debian/rules.d/binary-base.mk
+++ b/debian/rules.d/binary-base.mk
@@ -49,7 +49,8 @@ endif
 	dh_installchangelogs -p$(p_base)
 	dh_compress -p$(p_base)
 	dh_fixperms -p$(p_base)
-ifeq ($(DEB_STAGE)-$(DEB_CROSS),rtlibs-yes)
+# if either DEB_STAGE-DEB_CROSS=rtlibs-yes or wdotap
+ifneq (,$(filter rtlibs-yes,$(DEB_STAGE)-$(DEB_CROSS))$(filter yes,$(with_deps_on_target_arch_pkgs)))
 	$(cross_gencontrol) dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
 else
 	dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
diff --git a/debian/rules.d/binary-cpp.mk b/debian/rules.d/binary-cpp.mk
index 3ebd259..8defa04 100644
--- a/debian/rules.d/binary-cpp.mk
+++ b/debian/rules.d/binary-cpp.mk
@@ -39,6 +39,13 @@ ifeq ($(unprefixed_names),yes)
 	ln -sf $(cmd_prefix)cpp$(pkg_ver).1 \
 	    $(d_cpp)/$(PF)/share/man/man1/cpp$(pkg_ver).1
   endif
+else
+  ifeq ($(with_deps_on_target_arch_pkgs),yes)
+    # Copy docs (including copyright) that would be included in gcc-4.7-base
+	dh_installdocs -p$(p_xbase) debian/README.Debian.$(DEB_TARGET_ARCH)
+	rm -f $(d_xbase)/usr/share/doc/$(p_xbase)/README.Debian
+	dh_installchangelogs -p$(p_xbase)
+  endif
 endif
 
 	mkdir -p $(d_cpp)/usr/share/lintian/overrides
@@ -49,7 +56,9 @@ ifeq ($(GFDL_INVARIANT_FREE),yes)
 	  >> $(d_cpp)/usr/share/lintian/overrides/$(p_cpp)
 endif
 
+ifneq ($(DEB_CROSS)-$(with_deps_on_target_arch_pkgs),yes-yes)
 	debian/dh_doclink -p$(p_cpp) $(p_xbase)
+endif
 	debian/dh_rmemptydirs -p$(p_cpp)
 
 	dh_strip -p$(p_cpp) \
diff --git a/debian/rules.defs b/debian/rules.defs
index cf8a858..3fe75cc 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -200,10 +200,16 @@ else
     # cross compiler, sets WITH_SYSROOT on it's own
     DEB_CROSS = yes
     build_type = build-cross
+    ifeq ($(with_deps_on_target_arch_pkgs),yes)
+      with_sysroot = /
+    endif
   else ifeq ($(FORCE_CROSS_LAYOUT),yes)
     # a native build with a cross layout
     DEB_CROSS = yes
     build_type = build-cross
+    ifeq ($(with_deps_on_target_arch_pkgs),yes)
+      with_sysroot = /
+    endif
   else
     # native build
     # first ones are wheezy and maverick
@@ -236,6 +242,13 @@ ifeq ($(DEB_CROSS),yes)
   cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
   cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
 
+  ifeq ($(with_deps_on_target_arch_pkgs),yes)
+    LS :=
+    LS_biarch :=
+    cross_lib_arch :=
+    AQ := :$(TARGET)
+  endif
+
   TARGET_ALIAS := $(DEB_TARGET_ALIAS)
 
   lib_binaries := indep_binaries
@@ -448,7 +461,11 @@ endif
 
 ifeq ($(with_multiarch_lib),yes)
   ifneq ($(single_package),yes)
-    ifneq ($(DEB_CROSS),yes)
+    ifeq ($(DEB_CROSS),yes)
+      ifeq ($(with_deps_on_target_arch_pkgs),yes)
+        with_multiarch_cxxheaders := yes
+      endif
+    else
       with_multiarch_cxxheaders := yes
     endif
   endif
@@ -2124,12 +2141,13 @@ stamp-dir:
 	mkdir -p $(stampdir)
 
 ifeq ($(DEB_CROSS),yes)
-  define cross_mangle_shlibs
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    define cross_mangle_shlibs
 	if [ -f debian/$(1)/DEBIAN/shlibs ]; then \
 	  sed -i s/$(cross_lib_arch)/:$(DEB_TARGET_ARCH)/g debian/$(1)/DEBIAN/shlibs; \
 	fi
-  endef
-  define cross_mangle_substvars
+    endef
+    define cross_mangle_substvars
 	if [ -f debian/$(1).substvars ]; then \
 	  sed -i \
 	    -e 's/:$(DEB_TARGET_ARCH)/$(cross_lib_arch)/g' \
@@ -2138,7 +2156,13 @@ ifeq ($(DEB_CROSS),yes)
 	    $(if $(filter armhf,$(DEB_TARGET_ARCH)),-e 's/:armel/-armel-cross/g') \
 	    debian/$(1).substvars; \
 	fi
-  endef
+    endef
+  else
+    define cross_mangle_shlibs
+    endef
+    define cross_mangle_substvars
+    endef
+  endif
 else
   define cross_mangle_shlibs
   endef
diff --git a/debian/rules2 b/debian/rules2
index c8325af..bb9f35f 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -818,8 +818,11 @@ CONFARGS += \
 
 ifeq ($(DEB_CROSS),yes)
   CONFARGS += \
-	--program-prefix=$(TARGET_ALIAS)- \
+	--program-prefix=$(TARGET_ALIAS)-
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    CONFARGS += \
 	--includedir=/$(PFL)/include
+  endif
 endif
 
 ifeq ($(with_bootstrap),off)
@@ -968,21 +971,33 @@ endif
 
 # PFL is the installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
 ifeq ($(DEB_CROSS),yes)
-  PFL		= $(PF)/$(DEB_TARGET_GNU_TYPE)
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    PFL		= $(PF)/$(DEB_TARGET_GNU_TYPE)
+  else
+    PFL		= $(PF)
+  endif
 else
   PFL		= $(PF)
 endif
 
 # RPF is the base prefix or installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
 ifeq ($(DEB_CROSS),yes)
-  RPF		= $(PF)/$(DEB_TARGET_GNU_TYPE)
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    RPF		= $(PF)/$(DEB_TARGET_GNU_TYPE)
+  else
+    RPF		=
+  endif
 else
   RPF		=
 endif
 
 ifeq ($(with_multiarch_lib),yes)
   ifeq ($(DEB_CROSS),yes)
-    libdir	= lib
+    ifneq ($(with_deps_on_target_arch_pkgs),yes)
+      libdir	= lib
+    else
+      libdir	= lib/$(DEB_TARGET_MULTIARCH)
+    endif
   else
     libdir	= lib/$(DEB_TARGET_MULTIARCH)
   endif
@@ -1008,7 +1023,9 @@ buildlibdir	= $(builddir)/$(TARGET_ALIAS)
 gcc_subdir_name = gcc
 ifneq ($(single_package),yes)
   ifeq ($(DEB_CROSS),yes)
-    gcc_subdir_name = gcc-cross
+    ifneq ($(with_deps_on_target_arch_pkgs),yes)
+      gcc_subdir_name = gcc-cross
+    endif
   endif
 endif
 
@@ -1030,7 +1047,11 @@ d_l= debian/$(p_l)
 d_d= debian/$(p_d)
 
 ifeq ($(DEB_CROSS),yes)
-  usr_lib = $(PFL)/lib
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    usr_lib = $(PFL)/lib
+  else
+    usr_lib = $(PFL)/$(libdir)
+  endif
 else
   usr_lib = $(PFL)/$(libdir)
 endif
@@ -1952,9 +1973,16 @@ ifneq ($(DEB_CROSS),yes)
   p_doc  = gcc$(pkg_ver)-doc
 else
   # only triggered if DEB_CROSS set
-  p_base = gcc$(pkg_ver)$(cross_bin_arch)-base
-  p_lbase = gcc$(pkg_ver)-cross-base$(GCC_PORTS_BUILD)
-  p_xbase = gcc$(pkg_ver)$(cross_bin_arch)-base
+  ifneq ($(with_deps_on_target_arch_pkgs),yes)
+    p_base = gcc$(pkg_ver)$(cross_bin_arch)-base
+    p_lbase = gcc$(pkg_ver)-cross-base$(GCC_PORTS_BUILD)
+    p_xbase = gcc$(pkg_ver)$(cross_bin_arch)-base
+  else
+    p_base = gcc$(pkg_ver)-base
+    p_lbase = gcc$(pkg_ver)-base$(GCC_PORTS_BUILD)
+    p_xbase = $(p_cpp)
+  endif
+
   p_cpp  = cpp$(pkg_ver)$(cross_bin_arch)
   p_gcc  = gcc$(pkg_ver)$(cross_bin_arch)
   p_cxx  = g++$(pkg_ver)$(cross_bin_arch)
@@ -2650,6 +2678,8 @@ binary-indep: debian/indep_binaries.all
 	fi
 
 ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel mips64 mips64el mipsn32 mipsn32el))
+ifneq ($(with_deps_on_target_arch_pkgs),yes)
+
 	for p in `cat debian/indep_binaries debian/indep_binaries.epoch`; do \
 	  p=$${p#-p*}; \
 	  case "$$p" in \
@@ -2657,6 +2687,7 @@ ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel mips64 mips64el mipsn32 mipsn32
 	    libn32*) echo mangle $$p; sed -i -r '/^(Dep|Rec|Sug)/s/lib64[^,]+(, *|$$)//g;/^(Dep|Rec|Sug)/s/$(p_lgcc)/$(p_ln32gcc)/;/^(Dep|Rec|Sug)/s/ *, *$$//' debian/$$p/DEBIAN/control;; \
 	  esac; \
 	done
+endif
 endif
 
 	dh_installdeb $(foreach p,$(shell echo `cat debian/indep_binaries.all`),-p$(p))
-- 
2.17.1