mescc: Support for non-Guix[SD] builds.

* module/language/c99/compiler.mes (c99-input->full-ast): Cater for
  C_INCLUDE_PATH not set.  Fixes non-Guix[SD] builds.
This commit is contained in:
Jan Nieuwenhuizen 2017-06-20 19:06:19 +02:00
parent 19bed9b466
commit c1d91c722d
2 changed files with 3 additions and 1 deletions

View file

@ -30,6 +30,7 @@
(set-port-encoding! (current-output-port) "ISO-8859-1"))
(guile)
(mes
(mes-use-module (srfi srfi-26))
(mes-use-module (mes pmatch))
(mes-use-module (nyacc lang c99 parser))
(mes-use-module (mes elf-util))
@ -56,7 +57,7 @@
(define* (c99-input->full-ast #:key (defines '()) (includes '()))
(let ((include (if (equal? %prefix "") "mlibc/include" (string-append %prefix "/share/mlibc/include"))))
(parse-c99
#:inc-dirs (append includes (cons* "." "mlibc" "src" "out" "out/src" include (string-split (getenv "C_INCLUDE_PATH") #\:)))
#:inc-dirs (append includes (cons* "." "mlibc" "src" "out" "out/src" include (or (and=> (getenv "C_INCLUDE_PATH") (cut string-split <> #\:)) '())))
#:cpp-defs `(
"POSIX=0"
"_POSIX_SOURCE=0"

View file

@ -24,6 +24,7 @@
(define-module (language c99 compiler)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (system base pmatch)
#:use-module (ice-9 optargs)
#:use-module (ice-9 pretty-print)