From f49ccd9cefcc2cd93543a0619f54d10f86c61468 Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Tue, 28 Nov 2023 12:34:51 +0100 Subject: 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 --- gnu/packages/cross-base.scm | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 777b5d8761..0561fd2df8 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.)" "-DTOOLDIR_BASE_PREFIX=\\\"../../../../\\\"")) #t)) +(define (cross-gcc-search-paths target) + "Return list of GCC search path specifications needed for TARGET." + (cons (search-path-specification + (variable "CROSS_LIBRARY_PATH") + (files `("lib" "lib64" + ,@(list (string-append target "/lib") + (string-append target "/lib64"))))) + + (map (lambda (variable) + (search-path-specification + (variable variable) + + ;; Add 'include/c++' here so that 's + ;; "#include_next " finds GCC's + ;; , not libc's. + (files (match variable + ("CROSS_CPLUS_INCLUDE_PATH" + `("include/c++" "include" + ,@(list (string-append target "/include/c++") + (string-append target "/include")))) + (_ + `("include" + ,(string-append target "/include"))))))) + %gcc-cross-include-paths))) + (define* (cross-gcc target #:key (xgcc %xgcc) @@ -341,22 +366,7 @@ target that libc." (inputs '()) ;; Only search target inputs, not host inputs. - (search-paths (cons (search-path-specification - (variable "CROSS_LIBRARY_PATH") - (files '("lib" "lib64"))) - (map (lambda (variable) - (search-path-specification - (variable variable) - - ;; Add 'include/c++' here so that 's - ;; "#include_next " finds GCC's - ;; , not libc's. - (files (match variable - ("CROSS_CPLUS_INCLUDE_PATH" - '("include/c++" "include")) - (_ - '("include")))))) - %gcc-cross-include-paths))) + (search-paths (cross-gcc-search-paths target)) (native-search-paths '()))) (define* (cross-kernel-headers . args) -- cgit v1.2.3