2018-06-29 17:57:41 +01:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
2018-10-31 18:53:33 +00:00
|
|
|
# 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.
|
2018-06-29 17:57:41 +01:00
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-10-31 18:53:33 +00:00
|
|
|
srcdir=${srcdir-.}
|
|
|
|
. ${srcdest}build-aux/trace.sh
|
2018-06-29 17:57:41 +01:00
|
|
|
|
|
|
|
export GUILE
|
|
|
|
export GUILE_AUTO_COMPILE
|
|
|
|
GUILE=${GUILE-$(command -v guile)}
|
|
|
|
GUILE_TOOLS=${GUILE_TOOLS-$(command -v guile-tools)}
|
|
|
|
GUILE_AUTO_COMPILE=0
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SCM_FILES="
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/bournish-commands.scm
|
|
|
|
${srcdest}gash/guix-utils.scm
|
|
|
|
${srcdest}gash/builtins.scm
|
|
|
|
${srcdest}gash/compress.scm
|
|
|
|
${srcdest}gash/config.scm
|
|
|
|
${srcdest}gash/environment.scm
|
|
|
|
${srcdest}gash/geesh.scm
|
|
|
|
${srcdest}gash/gash.scm
|
|
|
|
${srcdest}gash/io.scm
|
|
|
|
${srcdest}gash/job.scm
|
|
|
|
${srcdest}gash/lzw.scm
|
|
|
|
${srcdest}gash/peg.scm
|
|
|
|
${srcdest}gash/pipe.scm
|
|
|
|
${srcdest}gash/readline.scm
|
|
|
|
${srcdest}gash/script.scm
|
|
|
|
${srcdest}gash/shell-utils.scm
|
|
|
|
${srcdest}gash/ustar.scm
|
|
|
|
${srcdest}gash/util.scm
|
|
|
|
|
2018-11-05 19:45:26 +00:00
|
|
|
${srcdest}gash/commands/basename.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/cat.scm
|
2018-11-01 07:07:22 +00:00
|
|
|
${srcdest}gash/commands/chmod.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/compress.scm
|
|
|
|
${srcdest}gash/commands/cp.scm
|
2018-11-05 19:24:54 +00:00
|
|
|
${srcdest}gash/commands/dirname.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/find.scm
|
|
|
|
${srcdest}gash/commands/grep.scm
|
|
|
|
${srcdest}gash/commands/ls.scm
|
2018-11-04 07:14:05 +00:00
|
|
|
${srcdest}gash/commands/mkdir.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/reboot.scm
|
|
|
|
${srcdest}gash/commands/rm.scm
|
2018-11-04 07:43:04 +00:00
|
|
|
${srcdest}gash/commands/rmdir.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/sed.scm
|
|
|
|
${srcdest}gash/commands/tar.scm
|
2018-11-04 10:28:01 +00:00
|
|
|
${srcdest}gash/commands/touch.scm
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}gash/commands/wc.scm
|
|
|
|
${srcdest}gash/commands/which.scm
|
2018-10-30 18:45:01 +00:00
|
|
|
|
2018-06-29 17:57:41 +01:00
|
|
|
"
|
|
|
|
|
2018-10-31 18:53:33 +00:00
|
|
|
SCRIPTS="
|
2018-11-05 19:45:26 +00:00
|
|
|
${srcdest}bin/basename
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/cat
|
2018-11-01 07:07:22 +00:00
|
|
|
${srcdest}bin/chmod
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/compress
|
|
|
|
${srcdest}bin/cp
|
2018-11-05 19:24:54 +00:00
|
|
|
${srcdest}bin/dirname
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/find
|
|
|
|
${srcdest}bin/gash
|
|
|
|
${srcdest}bin/grep
|
|
|
|
${srcdest}bin/ls
|
2018-11-04 07:14:05 +00:00
|
|
|
${srcdest}bin/mkdir
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/reboot
|
2018-10-31 21:30:49 +00:00
|
|
|
${srcdest}bin/rm
|
2018-11-04 07:43:04 +00:00
|
|
|
${srcdest}bin/rmdir
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/sed
|
|
|
|
${srcdest}bin/tar
|
2018-11-04 10:28:01 +00:00
|
|
|
${srcdest}bin/touch
|
2018-10-31 18:53:33 +00:00
|
|
|
${srcdest}bin/wc
|
|
|
|
${srcdest}bin/which
|
|
|
|
"
|
|
|
|
|
2018-06-29 17:57:41 +01:00
|
|
|
export host=$($GUILE -c "(display %host-type)")
|
|
|
|
|
2018-10-31 18:53:33 +00:00
|
|
|
abs=$srcdest
|
|
|
|
if [ "$GUILE_EFFECTIVE_VERSION" = "2.0" ]; then
|
|
|
|
srcdest=$abs_top_srcdir/
|
|
|
|
fi
|
2018-06-29 17:57:41 +01:00
|
|
|
|
2018-10-31 18:53:33 +00:00
|
|
|
GUILE_AUTO_COMPILE=0
|
|
|
|
WARNINGS="
|
|
|
|
--warn=unsupported-warning
|
|
|
|
--warn=unused-variable
|
|
|
|
--warn=unused-toplevel
|
|
|
|
--warn=unbound-variable
|
|
|
|
--warn=macro-use-before-definition
|
|
|
|
--warn=arity-mismatch
|
|
|
|
--warn=duplicate-case-datum
|
|
|
|
--warn=bad-case-datum
|
|
|
|
--warn=format
|
2018-06-29 17:57:41 +01:00
|
|
|
"
|
|
|
|
|
2018-10-31 18:53:33 +00:00
|
|
|
for i in $SCM_FILES $SCRIPTS; do
|
|
|
|
b=$(basename $i)
|
2018-06-29 17:57:41 +01:00
|
|
|
go=${i%%.scm}.go
|
|
|
|
if [ $i -nt $go ]; then
|
2018-10-31 18:53:33 +00:00
|
|
|
trace "GUILEC $b" $GUILE_TOOLS compile -L ${srcdir} $WARNINGS -o $go $i
|
2018-06-29 17:57:41 +01:00
|
|
|
fi
|
|
|
|
done
|