From c1d91c722d6821e5cad27fd09317c92c47f93297 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 20 Jun 2017 19:06:19 +0200 Subject: [PATCH] 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. --- module/language/c99/compiler.mes | 3 ++- module/language/c99/compiler.scm | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index 970430eb..979c1b8b 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -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" diff --git a/module/language/c99/compiler.scm b/module/language/c99/compiler.scm index c643b100..32dd3df9 100644 --- a/module/language/c99/compiler.scm +++ b/module/language/c99/compiler.scm @@ -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)