5 # Returns the c++-standard-library to be put onto the image.
7 if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
8 # the libstdc++.so for our legacy compiler (needs to be built)
9 return libstdc++.r4.so ;
12 # libstdc++.so for other architectures comes with the gcc_syslibs
13 # package, so there's no library to put onto the image directly.
18 rule TargetLibstdc++ asPath
20 # TargetLibstdc++ [ <asPath> ]
22 # Returns the c++-standard-library for the target.
23 # Invoking with <asPath> = true will return the full library path.
25 if $(TARGET_PLATFORM) = haiku {
26 if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
27 # the libstdc++.so for our legacy compiler (needs to be built)
28 return libstdc++.r4.so ;
30 # return libstdc++.so from the gcc_syslibs build feature.
36 BuildFeatureAttribute gcc_syslibs : libstdc++.so : $(flags)
39 if $(TARGET_PLATFORM) = libbe_test {
40 # Use the existing host library
43 # TODO: return libstdc++.so for non-Haiku target platform if needed
48 rule TargetLibsupc++ asPath
50 # TargetLibsupc++ [ <asPath> ]
52 # Returns the c++-support-library for the target.
53 # Invoking with <asPath> = true will return the full library path.
55 if $(TARGET_PLATFORM) = haiku {
56 if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
57 # there is no libsupc++.so for the legacy compiler
60 # return libstdc++.so (which includes libsupc++) from the gcc_syslibs
67 BuildFeatureAttribute gcc_syslibs : libstdc++.so : $(flags)
70 # TODO: return libsupc++.so for non-Haiku target platform if needed
75 rule TargetStaticLibsupc++ asPath
77 # TargetStaticLibsupc++ [ <asPath> ]
79 # Returns the static c++-support-library for the target.
80 # Invoking with <asPath> = true will return the full library path.
82 if $(TARGET_PLATFORM) = haiku {
83 # return libsupc++.a from the gcc_syslibs_devel build feature.
89 BuildFeatureAttribute gcc_syslibs_devel : libsupc++.a : $(flags)
92 # TODO: return libsupc++.a for non-Haiku target platform if needed
97 rule TargetKernelLibsupc++ asPath
99 # TargetKernelLibsupc++ [ <asPath> ]
101 # Returns the static kernel c++-support-library for the target.
102 # Invoking with <asPath> = true will return the full library path.
104 if $(TARGET_PLATFORM) = haiku {
105 # return libsupc++-kernel.a from the gcc_syslibs_devel build feature.
107 if $(asPath) = true {
111 BuildFeatureAttribute gcc_syslibs_devel
112 : libsupc++-kernel.a : $(flags)
115 # There is no libsupc++-kernel.a for non-Haiku target platform
120 rule TargetBootLibsupc++ asPath
122 # TargetBootLibsupc++ [ <asPath> ]
124 # Returns the static bootloader c++-support-library for the target.
125 # Invoking with <asPath> = true will return the full library path.
127 if $(TARGET_PLATFORM) = haiku {
128 if $(TARGET_PACKAGING_ARCH) = x86_64 {
129 # we need to use the 32-bit libsupc++.a built by the cross-compiler
130 return $(TARGET_BOOT_LIBSUPC++) ;
132 # TODO: ideally, we would build this as part of gcc_syslibs_devel,
133 # but that isn't currently possible, as that would require
134 # 32-bit support (libraries and glue-code) on x86_64-Haiku.
136 # no special boot version of libsupc++.a needed, so we return
137 # libsupc++-kernel.a from the gcc_syslibs_devel build feature.
139 if $(asPath) = true {
143 BuildFeatureAttribute gcc_syslibs_devel
144 : libsupc++-kernel.a : $(flags)
147 # There is no libsupc++-boot.a for non-Haiku target platform
152 rule TargetLibgcc asPath
154 # TargetLibgcc [ <asPath> ]
156 # Returns the default libgcc(s) for the target. On x86_gcc2, this is the
157 # static libgcc, on everything else this will return the shared libgcc_s
158 # followed by the static libgcc (both are needed as they do not contain
159 # the same set of symbols).
160 # Invoking with <asPath> = true will return the full library path.
162 if $(TARGET_PLATFORM) = haiku {
164 if $(asPath) = true {
167 if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
168 # return libgcc.a from the gcc_syslibs_devel build feature.
170 BuildFeatureAttribute gcc_syslibs_devel : libgcc.a : $(flags)
173 # return libgcc_s.so from the gcc_syslibs build feature and libgcc.a
174 # from the gcc_syslibs_devel build feature.
176 BuildFeatureAttribute gcc_syslibs : libgcc_s.so : $(flags)
178 BuildFeatureAttribute gcc_syslibs_devel : libgcc.a : $(flags)
182 # TODO: return libgcc for non-Haiku target platform if needed
187 rule TargetStaticLibgcc asPath
189 # TargetStaticLibgcc [ <asPath> ]
191 # Returns the static libgcc for the target.
192 # Invoking with <asPath> = true will return the full library path.
194 if $(TARGET_PLATFORM) = haiku {
195 # return libgcc.a from the gcc_syslibs_devel build feature.
197 if $(asPath) = true {
201 BuildFeatureAttribute gcc_syslibs_devel : libgcc.a : $(flags)
204 # TODO: return libgcc.a for non-Haiku target platform if needed
209 rule TargetKernelLibgcc asPath
211 # TargetKernelLibgcc [ <asPath> ]
213 # Returns the static kernel libgcc for the target.
214 # Invoking with <asPath> = true will return the full library path.
216 if $(TARGET_PLATFORM) = haiku {
217 # return libgcc-kernel.a from the gcc_syslibs_devel build feature.
219 if $(asPath) = true {
223 BuildFeatureAttribute gcc_syslibs_devel
224 : libgcc-kernel.a : $(flags)
227 # there is no libgcc-kernel.a for non-Haiku target platform
232 rule TargetBootLibgcc asPath
234 # TargetBootLibgcc [ <asPath> ]
236 # Returns the static bootloader libgcc for the target.
237 # Invoking with <asPath> = true will return the full library path.
239 if $(TARGET_PLATFORM) = haiku {
240 if $(TARGET_PACKAGING_ARCH) = x86_64 {
241 # we need to use the 32-bit libgcc.a built by the cross-compiler
242 return $(TARGET_BOOT_LIBGCC) ;
244 # TODO: ideally, we would build this as part of gcc_syslibs_devel,
245 # but that isn't currently possible, as that would require
246 # 32-bit support (libraries and glue-code) on x86_64-Haiku.
248 # no special boot version of libgcc needed, so we return
249 # libgcc-kernel.a from the gcc_syslibs_devel build feature.
251 if $(asPath) = true {
255 BuildFeatureAttribute gcc_syslibs_devel
256 : libgcc-kernel.a : $(flags)
259 # there is no libgcc-boot.a for non-Haiku target platform
264 rule TargetStaticLibgcceh asPath
266 # TargetStaticLibgcceh [ <asPath> ]
268 # Returns the static libgcc_eh for the target.
269 # Invoking with <asPath> = true will return the full library path.
271 if $(TARGET_PLATFORM) = haiku {
272 # return libgcc.a from the gcc_syslibs_devel build feature.
274 if $(asPath) = true {
278 BuildFeatureAttribute gcc_syslibs_devel : libgcc_eh.a : $(flags)
281 # TODO: return libgcc_eh.a for non-Haiku target platform if needed
286 rule TargetKernelLibgcceh asPath
288 # TargetKernelLibgcceh [ <asPath> ]
290 # Returns the static kernel libgcc_eh for the target.
291 # Invoking with <asPath> = true will return the full library path.
293 if $(TARGET_PLATFORM) = haiku {
294 # return libgcc_eh-kernel.a from the gcc_syslibs_devel build feature.
296 if $(asPath) = true {
300 BuildFeatureAttribute gcc_syslibs_devel
301 : libgcc_eh-kernel.a : $(flags)
304 # there is no libgcc_eh-kernel.a for non-Haiku target platform
309 rule C++HeaderDirectories architecture
311 # C++HeaderDirectories
313 # Returns the c++ header directories to use for the given architecture.
315 local c++HeaderDirs ;
316 if $(architecture) = x86_gcc2 {
317 c++HeaderDirs = [ FDirName $(HAIKU_TOP) headers cpp ] ;
318 } else if $(PLATFORM) = bootstrap_stage0 {
319 # Currently, no c++-headers are needed for stage0 of the boostrap.
322 BuildFeatureAttribute gcc_syslibs_devel : c++-headers : path
327 [ FDirName $(baseDir) $(HAIKU_GCC_MACHINE_$(architecture)) ]
328 [ FDirName $(baseDir) backward ]
329 [ FDirName $(baseDir) ext ]
334 return $(c++HeaderDirs) ;
337 rule GccHeaderDirectories architecture
339 # GccHeaderDirectories
341 # Returns the gcc header directories to use for the given architecture.
343 local gccHeaderDirs ;
344 if $(architecture) = x86_gcc2 {
345 gccHeaderDirs = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ;
346 } else if $(PLATFORM) = bootstrap_stage0 {
348 [ FDirName $(HAIKU_GCC_LIB_DIR_$(architecture)) include ]
349 [ FDirName $(HAIKU_GCC_LIB_DIR_$(architecture)) include-fixed ]
353 BuildFeatureAttribute gcc_syslibs_devel : gcc-headers : path
357 [ FDirName $(baseDir) include ]
358 [ FDirName $(baseDir) include-fixed ]
363 return $(gccHeaderDirs) ;