build: Add config.scm.in.

* gash/config.scm.in:
* configure: Use it to generate gash/config.scm
* .gitignore: Ignore generated file.
* gash/gash.scm (display-version): Use it.
* build-aux/build-guile.sh: Compile it.
This commit is contained in:
Jan Nieuwenhuizen 2018-07-14 14:38:00 +02:00
parent c896015068
commit 512b848b11
4 changed files with 36 additions and 0 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/bin/gash
/.config.make
/doc/version.texi
/gash/config.scm

View File

@ -38,6 +38,7 @@ set -e
SCM_FILES="
gash/bournish-commands.scm
gash/builtins.scm
gash/config.scm
gash/guix-build-utils.scm
gash/gash.scm
gash/io.scm

4
configure vendored
View File

@ -40,6 +40,10 @@ SHELL=$BASH
VERSION=$VERSION
EOF
sed \
-e "s,@VERSION@,$VERSION,"\
gash/config.scm.in > gash/config.scm
cat <<EOF
Run:
make to build gash

30
gash/config.scm.in Normal file
View File

@ -0,0 +1,30 @@
;;; Gash -- Guile As SHell
;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of Gash.
;;;
;;; Gash is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; Gash is distributed in the hope that it will be useful, but WITHOUT ANY
;;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;;; details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
(define-module (gash config)
#:export (%version))
;;; Commentary:
;;;
;;; Compile-time configuration of gash. When adding a substitution variable
;;; here, make sure to have configure substitute it.
;;;
;;; Code:
(define %version
"@VERSION@")