build: Have configure respect GUILE_LOAD_PATH for mes to find Nyacc.

* configure: Substitute GUILE_LOAD_PATH from %load-path.
* configure.sh: Likewise.
* build-aux/config.make.in: Add GUILE_LOAD_PATH as subtitution variable.
* build-aux/config.sh.in: Likewise.
* mes/module/mes/guile.mes (%load-path): New variable.
This commit is contained in:
Jan Nieuwenhuizen 2019-12-15 10:10:23 +01:00
parent e984f7213f
commit 2f72303e6c
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 10 additions and 1 deletions

View file

@ -28,6 +28,7 @@ GIT:=@GIT@
GUILD:=@GUILD@ GUILD:=@GUILD@
GUILE:=@GUILE@ GUILE:=@GUILE@
GUILE_EFFECTIVE_VERSION:=@GUILE_EFFECTIVE_VERSION@ GUILE_EFFECTIVE_VERSION:=@GUILE_EFFECTIVE_VERSION@
GUILE_LOAD_PATH:=@GUILE_LOAD_PATH@
GUIX:=@GUIX@ GUIX:=@GUIX@
HELP2MAN:=@HELP2MAN@ HELP2MAN:=@HELP2MAN@
HEX2:=@HEX2@ HEX2:=@HEX2@

View file

@ -29,6 +29,7 @@ GIT="@GIT@"
GUILD="@GUILD@" GUILD="@GUILD@"
GUILE="@GUILE@" GUILE="@GUILE@"
GUILE_EFFECTIVE_VERSION="@GUILE_EFFECTIVE_VERSION@" GUILE_EFFECTIVE_VERSION="@GUILE_EFFECTIVE_VERSION@"
GUILE_LOAD_PATH="@GUILE_LOAD_PATH@"
GUIX="@GUIX@" GUIX="@GUIX@"
HELP2MAN="@HELP2MAN@" HELP2MAN="@HELP2MAN@"
HEX2="@HEX2@" HEX2="@HEX2@"

6
configure vendored
View file

@ -388,6 +388,7 @@ Some influential environment variables:
LDFLAGS C linker flags LDFLAGS C linker flags
GUILE guile command GUILE guile command
GUILD guild command GUILD guild command
GUILE_LOAD_PATH guile load path; where to find Nyacc
MES_FOR_BUILD build system MES [can be mes or guile] MES_FOR_BUILD build system MES [can be mes or guile]
" PACKAGE VERSION (getenv "prefix"))) " PACKAGE VERSION (getenv "prefix")))
@ -410,6 +411,8 @@ Some influential environment variables:
(includedir (option-ref options 'includedir "${prefix}/include")) (includedir (option-ref options 'includedir "${prefix}/include"))
(libdir (option-ref options 'libdir "${prefix}/lib")) (libdir (option-ref options 'libdir "${prefix}/lib"))
(pkgdatadir (string-append datadir "/mes")) (pkgdatadir (string-append datadir "/mes"))
(guile-load-path (if (and (pair? %load-path) (equal? (car %load-path) ".")) (cdr %load-path)
%load-path))
(guile-effective-version (effective-version)) (guile-effective-version (effective-version))
(guile-site-dir (if (equal? prefix ".") (canonicalize-path ".") (guile-site-dir (if (equal? prefix ".") (canonicalize-path ".")
(string-append prefix "/share/guile/site/" guile-effective-version))) (string-append prefix "/share/guile/site/" guile-effective-version)))
@ -614,7 +617,6 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@mandir@" . ,mandir) ("@mandir@" . ,mandir)
("@sysconfdir@" . ,sysconfdir) ("@sysconfdir@" . ,sysconfdir)
("@GUILE_EFFECTIVE_VERSION@" . ,(effective-version))
("@colors@" . ,(if disable-colors? "no" "yes")) ("@colors@" . ,(if disable-colors? "no" "yes"))
("@V@" . ,(if disable-silent-rules? "1" "0")) ("@V@" . ,(if disable-silent-rules? "1" "0"))
@ -625,6 +627,8 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@DOT@" . ,(or (file-name "dot" deps) "")) ("@DOT@" . ,(or (file-name "dot" deps) ""))
("@GIT@" . ,(or (file-name "git" deps) "")) ("@GIT@" . ,(or (file-name "git" deps) ""))
("@GUILE@" . ,guile) ("@GUILE@" . ,guile)
("@GUILE_EFFECTIVE_VERSION@" . ,(effective-version))
("@GUILE_LOAD_PATH@" . ,(string-join guile-load-path ":"))
("@GUIX@" . ,(or (file-name "guix" deps) "")) ("@GUIX@" . ,(or (file-name "guix" deps) ""))
("@HELP2MAN@" . ,(or (file-name "help2man" deps) "")) ("@HELP2MAN@" . ,(or (file-name "help2man" deps) ""))
("@MAKEINFO@" . ,(or (file-name "makeinfo" deps) "")) ("@MAKEINFO@" . ,(or (file-name "makeinfo" deps) ""))

View file

@ -151,6 +151,7 @@ subst () {
-e s,"@pkgdatadir@,$pkgdatadir,"\ -e s,"@pkgdatadir@,$pkgdatadir,"\
-e s,"@sysconfdir@,$sysconfdir,"\ -e s,"@sysconfdir@,$sysconfdir,"\
-e s,"@GUILE_EFFECTIVE_VERSION@,$GUILE_EFFECTIVE_VERSION,"\ -e s,"@GUILE_EFFECTIVE_VERSION@,$GUILE_EFFECTIVE_VERSION,"\
-e s,"@GUILE_LOAD_PATH@,$GUILE_LOAD_PATH,"\
-e s,"@V@,$V,"\ -e s,"@V@,$V,"\
-e s,"@AR@,$AR,"\ -e s,"@AR@,$AR,"\
-e s,"@BASH@,$BASH,"\ -e s,"@BASH@,$BASH,"\

View file

@ -32,6 +32,8 @@
(mes-use-module (mes display)) (mes-use-module (mes display))
(mes-use-module (mes simple-format)) (mes-use-module (mes simple-format))
(define %load-path (or (and=> (getenv "GUILE_LOAD_PATH") (lambda (x) (string-split x #\:))) '()))
(define (drain-input port) (read-string)) (define (drain-input port) (read-string))
(define (read-line . rest) (define (read-line . rest)