diff options
| author | Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com> | 2023-11-28 12:34:51 +0100 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2023-12-11 13:33:53 +0200 |
| commit | f49ccd9cefcc2cd93543a0619f54d10f86c61468 (patch) | |
| tree | 03c6ddf9917414920828f7718598359fe0faefa2 /gnu/packages | |
| parent | 9095e10620c775145666f88ff4b0bfdc06645665 (diff) | |
gnu: cross-gcc: Handle target include paths.
* gnu/packages/cross-base.scm (cross-gcc-search-paths): New procedure.
(cross-gcc)[search-paths]: Convert to and use cross-gcc-search-paths
procedure.
Change-Id: Id306782eaf928d05cd005b9539087ed631506b5b
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/cross-base.scm | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 777b5d87619..0561fd2df81 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm | |||
| @@ -249,6 +249,31 @@ base compiler and using LIBC (which may be either a libc package or #f.)" | |||
| 249 | "-DTOOLDIR_BASE_PREFIX=\\\"../../../../\\\"")) | 249 | "-DTOOLDIR_BASE_PREFIX=\\\"../../../../\\\"")) |
| 250 | #t)) | 250 | #t)) |
| 251 | 251 | ||
| 252 | (define (cross-gcc-search-paths target) | ||
| 253 | "Return list of GCC search path specifications needed for TARGET." | ||
| 254 | (cons (search-path-specification | ||
| 255 | (variable "CROSS_LIBRARY_PATH") | ||
| 256 | (files `("lib" "lib64" | ||
| 257 | ,@(list (string-append target "/lib") | ||
| 258 | (string-append target "/lib64"))))) | ||
| 259 | |||
| 260 | (map (lambda (variable) | ||
| 261 | (search-path-specification | ||
| 262 | (variable variable) | ||
| 263 | |||
| 264 | ;; Add 'include/c++' here so that <cstdlib>'s | ||
| 265 | ;; "#include_next <stdlib.h>" finds GCC's | ||
| 266 | ;; <stdlib.h>, not libc's. | ||
| 267 | (files (match variable | ||
| 268 | ("CROSS_CPLUS_INCLUDE_PATH" | ||
| 269 | `("include/c++" "include" | ||
| 270 | ,@(list (string-append target "/include/c++") | ||
| 271 | (string-append target "/include")))) | ||
| 272 | (_ | ||
| 273 | `("include" | ||
| 274 | ,(string-append target "/include"))))))) | ||
| 275 | %gcc-cross-include-paths))) | ||
| 276 | |||
| 252 | (define* (cross-gcc target | 277 | (define* (cross-gcc target |
| 253 | #:key | 278 | #:key |
| 254 | (xgcc %xgcc) | 279 | (xgcc %xgcc) |
| @@ -341,22 +366,7 @@ target that libc." | |||
| 341 | (inputs '()) | 366 | (inputs '()) |
| 342 | 367 | ||
| 343 | ;; Only search target inputs, not host inputs. | 368 | ;; Only search target inputs, not host inputs. |
| 344 | (search-paths (cons (search-path-specification | 369 | (search-paths (cross-gcc-search-paths target)) |
| 345 | (variable "CROSS_LIBRARY_PATH") | ||
| 346 | (files '("lib" "lib64"))) | ||
| 347 | (map (lambda (variable) | ||
| 348 | (search-path-specification | ||
| 349 | (variable variable) | ||
| 350 | |||
| 351 | ;; Add 'include/c++' here so that <cstdlib>'s | ||
| 352 | ;; "#include_next <stdlib.h>" finds GCC's | ||
| 353 | ;; <stdlib.h>, not libc's. | ||
| 354 | (files (match variable | ||
| 355 | ("CROSS_CPLUS_INCLUDE_PATH" | ||
| 356 | '("include/c++" "include")) | ||
| 357 | (_ | ||
| 358 | '("include")))))) | ||
| 359 | %gcc-cross-include-paths))) | ||
| 360 | (native-search-paths '()))) | 370 | (native-search-paths '()))) |
| 361 | 371 | ||
| 362 | (define* (cross-kernel-headers . args) | 372 | (define* (cross-kernel-headers . args) |
