search-paths: Add GCC search paths.

* guix/search-paths.scm ($C_INCLUDE_PATH, $CPLUS_INCLUDE_PATH)
($LIBRARY_PATH, %gcc-search-paths): New variables.
This commit is contained in:
Maxim Cournoyer 2023-10-04 23:11:03 -04:00
parent 20df2ee697
commit 2d8aa104aa
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 34 additions and 1 deletions

View File

@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -32,13 +33,18 @@
search-path-specification-file-type
search-path-specification-file-pattern
$PATH
$CPLUS_INCLUDE_PATH
$C_INCLUDE_PATH
$LIBRARY_PATH
$GUIX_EXTENSIONS_PATH
$PATH
$PKG_CONFIG_PATH
$SSL_CERT_DIR
$SSL_CERT_FILE
$TZDIR
%gcc-search-paths
search-path-specification->sexp
sexp->search-path-specification
string-tokenize*
@ -69,6 +75,33 @@
(file-pattern search-path-specification-file-pattern ;#f | string
(default #f)))
(define $C_INCLUDE_PATH
(search-path-specification
(variable "CPLUS_INCLUDE_PATH")
;; Add 'include/c++' here so that <cstdlib>'s "#include_next
;; <stdlib.h>" finds GCC's <stdlib.h>, not libc's.
(files '("include/c++" "include"))))
(define $CPLUS_INCLUDE_PATH
(search-path-specification
(variable "C_INCLUDE_PATH")
(files '("include"))))
(define $LIBRARY_PATH
(search-path-specification
(variable "LIBRARY_PATH")
(files '("lib" "lib64"))))
(define %gcc-search-paths
;; Use the language-specific variables rather than 'CPATH' because they
;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
;; The intent is to allow headers that are in the search path to be
;; treated as "system headers" (headers exempt from warnings) just like
;; the typical /usr/include headers on an FHS system.
(list $C_INCLUDE_PATH
$CPLUS_INCLUDE_PATH
$LIBRARY_PATH))
(define $PATH
;; The 'PATH' variable. This variable is a bit special: it is not attached
;; to any package in particular.