build: Fixes.
* build-aux/trace.sh: Import from Mes. * build-aux/build-guile.sh: Update from Mes. * makefile: Avoid endless reconfigure.
This commit is contained in:
parent
f27cb9a192
commit
d626cdb136
|
@ -10,28 +10,19 @@
|
||||||
# the Free Software Foundation; either version 3 of the License, or (at
|
# the Free Software Foundation; either version 3 of the License, or (at
|
||||||
# your option) any later version.
|
# your option) any later version.
|
||||||
#
|
#
|
||||||
# Gash is distributed in the hope that it will be useful, but
|
# Gash is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
# GNU General Public License for more details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
# along with Gash. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if [ -n "$BUILD_DEBUG" ]; then
|
srcdir=${srcdir-.}
|
||||||
set -x
|
. ${srcdest}build-aux/trace.sh
|
||||||
fi
|
|
||||||
|
|
||||||
export GUILE
|
export GUILE
|
||||||
export GUILE_AUTO_COMPILE
|
export GUILE_AUTO_COMPILE
|
||||||
export GUILE_LOAD_PATH
|
|
||||||
export GUILE_LOAD_COMPILED_PATH
|
|
||||||
|
|
||||||
GUILE_LOAD_PATH=$HOME/src/geesh:$GUILE_LOAD_PATH
|
|
||||||
GUILE_LOAD_COMPILED_PATH=$HOME/src/geesh:$GUILE_LOAD_COMPILED_PATH
|
|
||||||
|
|
||||||
GUILE_LOAD_PATH=$(pwd):$GUILE_LOAD_PATH
|
|
||||||
GUILE_LOAD_COMPILED_PATH=$(pwd):$GUILE_LOAD_COMPILED_PATH
|
|
||||||
GUILE=${GUILE-$(command -v guile)}
|
GUILE=${GUILE-$(command -v guile)}
|
||||||
GUILE_TOOLS=${GUILE_TOOLS-$(command -v guile-tools)}
|
GUILE_TOOLS=${GUILE_TOOLS-$(command -v guile-tools)}
|
||||||
GUILE_AUTO_COMPILE=0
|
GUILE_AUTO_COMPILE=0
|
||||||
|
@ -39,68 +30,79 @@ GUILE_AUTO_COMPILE=0
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCM_FILES="
|
SCM_FILES="
|
||||||
gash/bournish-commands.scm
|
${srcdest}gash/bournish-commands.scm
|
||||||
gash/guix-utils.scm
|
${srcdest}gash/guix-utils.scm
|
||||||
gash/builtins.scm
|
${srcdest}gash/builtins.scm
|
||||||
gash/compress.scm
|
${srcdest}gash/compress.scm
|
||||||
gash/config.scm
|
${srcdest}gash/config.scm
|
||||||
gash/environment.scm
|
${srcdest}gash/environment.scm
|
||||||
gash/geesh.scm
|
${srcdest}gash/geesh.scm
|
||||||
gash/gash.scm
|
${srcdest}gash/gash.scm
|
||||||
gash/io.scm
|
${srcdest}gash/io.scm
|
||||||
gash/job.scm
|
${srcdest}gash/job.scm
|
||||||
gash/lzw.scm
|
${srcdest}gash/lzw.scm
|
||||||
gash/peg.scm
|
${srcdest}gash/peg.scm
|
||||||
gash/pipe.scm
|
${srcdest}gash/pipe.scm
|
||||||
gash/readline.scm
|
${srcdest}gash/readline.scm
|
||||||
gash/script.scm
|
${srcdest}gash/script.scm
|
||||||
gash/shell-utils.scm
|
${srcdest}gash/shell-utils.scm
|
||||||
gash/ustar.scm
|
${srcdest}gash/ustar.scm
|
||||||
gash/util.scm
|
${srcdest}gash/util.scm
|
||||||
|
|
||||||
|
${srcdest}gash/commands/cat.scm
|
||||||
|
${srcdest}gash/commands/compress.scm
|
||||||
|
${srcdest}gash/commands/cp.scm
|
||||||
|
${srcdest}gash/commands/find.scm
|
||||||
|
${srcdest}gash/commands/grep.scm
|
||||||
|
${srcdest}gash/commands/ls.scm
|
||||||
|
${srcdest}gash/commands/reboot.scm
|
||||||
|
${srcdest}gash/commands/rm.scm
|
||||||
|
${srcdest}gash/commands/sed.scm
|
||||||
|
${srcdest}gash/commands/tar.scm
|
||||||
|
${srcdest}gash/commands/wc.scm
|
||||||
|
${srcdest}gash/commands/which.scm
|
||||||
|
|
||||||
gash/commands/cat.scm
|
|
||||||
gash/commands/compress.scm
|
|
||||||
gash/commands/cp.scm
|
|
||||||
gash/commands/find.scm
|
|
||||||
gash/commands/grep.scm
|
|
||||||
gash/commands/ls.scm
|
|
||||||
gash/commands/reboot.scm
|
|
||||||
gash/commands/sed.scm
|
|
||||||
gash/commands/tar.scm
|
|
||||||
gash/commands/wc.scm
|
|
||||||
gash/commands/which.scm
|
|
||||||
"
|
"
|
||||||
|
|
||||||
export srcdir=.
|
|
||||||
export host=$($GUILE -c "(display %host-type)")
|
|
||||||
|
|
||||||
for i in $SCM_FILES; do
|
|
||||||
go=${i%%.scm}.go
|
|
||||||
if [ $i -nt $go ]; then
|
|
||||||
echo " GUILEC $i"
|
|
||||||
$GUILE_TOOLS compile -L bin -L gash -o $go $i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
SCRIPTS="
|
SCRIPTS="
|
||||||
bin/cat
|
${srcdest}bin/cat
|
||||||
bin/compress
|
${srcdest}bin/compress
|
||||||
bin/cp
|
${srcdest}bin/cp
|
||||||
bin/find
|
${srcdest}bin/find
|
||||||
bin/gash
|
${srcdest}bin/gash
|
||||||
bin/grep
|
${srcdest}bin/grep
|
||||||
bin/ls
|
${srcdest}bin/ls
|
||||||
bin/reboot
|
${srcdest}bin/reboot
|
||||||
bin/sed
|
${srcdest}bin/sed
|
||||||
bin/tar
|
${srcdest}bin/tar
|
||||||
bin/wc
|
${srcdest}bin/wc
|
||||||
bin/which
|
${srcdest}bin/which
|
||||||
"
|
"
|
||||||
|
|
||||||
for i in $SCRIPTS; do
|
export host=$($GUILE -c "(display %host-type)")
|
||||||
|
|
||||||
|
abs=$srcdest
|
||||||
|
if [ "$GUILE_EFFECTIVE_VERSION" = "2.0" ]; then
|
||||||
|
srcdest=$abs_top_srcdir/
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
"
|
||||||
|
|
||||||
|
for i in $SCM_FILES $SCRIPTS; do
|
||||||
|
b=$(basename $i)
|
||||||
go=${i%%.scm}.go
|
go=${i%%.scm}.go
|
||||||
if [ $i -nt $go ]; then
|
if [ $i -nt $go ]; then
|
||||||
echo " GUILEC $i"
|
trace "GUILEC $b" $GUILE_TOOLS compile -L ${srcdir} $WARNINGS -o $go $i
|
||||||
$GUILE_TOOLS compile -L guile -L scripts -o $go $i
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
if [ -z "$V" -o "$V0" = 0 ]; then
|
||||||
|
trace () {
|
||||||
|
echo " $1"
|
||||||
|
shift
|
||||||
|
eval "$@" $LOG
|
||||||
|
}
|
||||||
|
LOG=" >>build.log 2>&1"
|
||||||
|
fi
|
||||||
|
if [ "$V" = 1 ]; then
|
||||||
|
trace () {
|
||||||
|
shift
|
||||||
|
echo "$@"
|
||||||
|
eval "$@ $LOG"
|
||||||
|
}
|
||||||
|
LOG=" >>build.log 2>&1"
|
||||||
|
fi
|
||||||
|
if [ "$V" = 2 ]; then
|
||||||
|
set -x
|
||||||
|
trace () {
|
||||||
|
shift
|
||||||
|
eval "$@"
|
||||||
|
}
|
||||||
|
fi
|
9
makefile
9
makefile
|
@ -5,15 +5,18 @@ default: all
|
||||||
|
|
||||||
.config.make: makefile
|
.config.make: makefile
|
||||||
|
|
||||||
bin/gash: bin/gash.in | do-configure
|
bin/gash: bin/gash.in
|
||||||
bin/tar: bin/tar.in | do-configure
|
$(MAKE) do-configure
|
||||||
|
|
||||||
|
gash/config.scm:
|
||||||
|
$(MAKE) do-configure
|
||||||
|
|
||||||
do-configure:
|
do-configure:
|
||||||
./configure --prefix=$(prefix)
|
./configure --prefix=$(prefix)
|
||||||
|
|
||||||
all: all-go
|
all: all-go
|
||||||
|
|
||||||
all-go: | do-configure
|
all-go: | gash/config.scm
|
||||||
build-aux/build-guile.sh
|
build-aux/build-guile.sh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in New Issue