configure: Use GUILD_OPTIMIZE=-O1 for Guile-3.

* configure (main): Set guild_optimize to "-O1" for Guile-3.
* build-aux/config.make.in (GUILD_OPTIMIZE): New variable.
* build-aux/export.make (GUILD_OPTIMIZE): Export if set.
* build-aux/config.sh.in (GUILD_OPTIMIZE): New variable.
* build-aux/build-guile.sh: Use it.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-10-07 13:55:06 +02:00
parent fa4147a284
commit a0560aff67
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 12 additions and 1 deletions

View file

@ -62,6 +62,6 @@ for i in $SCM_FILES $SCRIPTS; do
go=${i%%.scm}.go
f=${srcdest}$i
if test $f -nt $go; then
trace "GUILEC $f" $GUILD compile -L ${srcdest}module -L ${srcdest}build-aux -L ${srcdest}scripts -o $go $f
trace "GUILEC $f" $GUILD compile $GUILD_OPTIMIZE -L ${srcdest}module -L ${srcdest}build-aux -L ${srcdest}scripts -o $go $f
fi
done

View file

@ -26,6 +26,7 @@ DIFF:=@DIFF@
DOT:=@DOT@
GIT:=@GIT@
GUILD:=@GUILD@
GUILD_OPTIMIZE:=@GUILD_OPTIMIZE@
GUILE:=@GUILE@
GUILE_EFFECTIVE_VERSION:=@GUILE_EFFECTIVE_VERSION@
GUILE_LOAD_PATH:=@GUILE_LOAD_PATH@

View file

@ -27,6 +27,7 @@ DIFF=${DIFF-@DIFF@}
DOT="@DOT@"
GIT="@GIT@"
GUILD="@GUILD@"
GUILD_OPTIMIZE="${GUILD_OPTIMIZE-@GUILD_OPTIMIZE@}"
GUILE="@GUILE@"
GUILE_EFFECTIVE_VERSION="@GUILE_EFFECTIVE_VERSION@"
GUILE_LOAD_PATH="@GUILE_LOAD_PATH@"

View file

@ -119,6 +119,10 @@ ifdef SHELL
export SHELL
endif
ifdef GUILD_OPTIMIZE
export GUILD_OPTIMIZE
endif
ifdef GUILE_LOAD_PATH
export GUILE_LOAD_PATH
endif

5
configure vendored
View file

@ -388,6 +388,7 @@ Some influential environment variables:
LDFLAGS C linker flags
GUILE guile command
GUILD guild command
GUILD_OPTIMIZE guild compile optimization
GUILE_LOAD_PATH guile load path; where to find Nyacc
MES_FOR_BUILD build system MES [can be mes or guile]
" PACKAGE VERSION (getenv "prefix")))
@ -476,6 +477,9 @@ Some influential environment variables:
(make-dep "help2man" #:version '(1 47) #:optional? #t)
(make-dep "perl" #:version '(5) #:optional? #t))))
(guile (file-name "guile" deps))
;; See https://bugs.gnu.org/43831; use -O1 with Guile-3
(guild-optimize (let ((guile-version (and=> (find-dep "guile" deps) dependency-version-found)))
(and guile-version (tuple< '(2) guile-version) "-O1")))
(deps (if guile (cons (check-program-version (make-dep "nyacc" #:version '(0 99 0) #:commands (list (string-append guile " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'")) #:file-name #t #:version-option #f))
deps)
deps))
@ -626,6 +630,7 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@DIFF@" . ,(or (file-name "diff" deps) (string-append abs-top-builddir "/pre-inst-env diff.scm")))
("@DOT@" . ,(or (file-name "dot" deps) ""))
("@GIT@" . ,(or (file-name "git" deps) ""))
("@GUILD_OPTIMIZE@" . ,(or (getenv "GUILD_OPTIMIZE") guild-optimize ""))
("@GUILE@" . ,guile)
("@GUILE_EFFECTIVE_VERSION@" . ,(effective-version))
("@GUILE_LOAD_PATH@" . ,(string-join guile-load-path ":"))