build: Cater for bootstrap build.

* build-aux/build.sh.in: Build bin/mes.  Update scripts and users.
* build-aux/bootstrap.sh.in: Update.
* build-aux/install.sh.in: Install all built bin/mes-* flavours.
* configure: Drop SEED, support --bootstrap.
* configure.sh: Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2019-11-03 22:15:11 +01:00
parent 350fa7f0de
commit d55ca711f1
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
42 changed files with 81 additions and 104 deletions

28
.gitignore vendored
View File

@ -85,34 +85,6 @@
!/scaffold/tests/*.exit
!/scaffold/tests/*.stdout
/src/mes.mes.symbols.h
/src/gc.mes.h
/src/hash.mes.h
/src/lib.mes.h
/src/math.mes.h
/src/mes.mes.h
/src/module.mes.h
/src/posix.mes.h
/src/reader.mes.h
/src/strings.mes.h
/src/struct.mes.h
/src/vector.mes.h
/src/gc.mes.i
/src/hash.mes.i
/src/lib.mes.i
/src/math.mes.i
/src/mes.mes.i
/src/module.mes.i
/src/posix.mes.i
/src/reader.mes.i
/src/strings.mes.i
/src/struct.mes.i
/src/vector.mes.i
/src/mes
/src/x86-mes-mes
/src/x86_64-mes-mes
/.config.make
/.store
/.tarball-version

View File

@ -97,7 +97,7 @@ build:
src/${program_prefix}mes: build
clean:
rm -f *.o *.s src/mes
rm -f *.o *.s bin/mes bin/mes-gcc bin/mes-mescc
rm -f mes.{aux,cp,cps,fn,info,log,tmp,toc,vr,vrs}
rm -f .log build.log
rm -f 0exit-42 0hello-mes exit-42 body-exit-42 body-hello-mes hello-mes
@ -112,6 +112,7 @@ clean:
rm -rf mescc-lib/*.o mescc-lib/*.s mescc-lib/*.a mescc-lib/*-mes
rm -f mescc-lib/libc+gnu.c
rm -f mescc-lib/.log mescc-lib/build.log
rm -rf mescc/bin
rm -f scaffold/boot/*.log scaffold/boot/*.trs
rm -f test-suite.log tests/*.log tests/*.trs
rm -f scaffold/*.s scaffold/*.o

View File

@ -96,8 +96,10 @@ for c in $mes_SOURCES; do
fi
objects="$objects $o"
done
echo " CCLD src/mes"
$CC -nostdlib -o src/mes -L mescc-lib mescc-lib/crt1.o $objects -lc
echo " CCLD bin/mes-mescc"
mkdir -p bin
$CC -nostdlib -o bin/mes-mescc -L mescc-lib mescc-lib/crt1.o $objects -lc
cp bin/mes-mescc bin/mes
(
mkdir -p gcc-lib

View File

@ -53,4 +53,5 @@ done
if test $mes_libc = system; then
LIBS=-lmes
fi
link src/mes
link bin/mes-$compiler
cp bin/mes-$compiler bin/mes

View File

@ -43,7 +43,9 @@ if $courageous; then
set +e
fi
${SHELL} ${srcdest}build-aux/build-scaffold.sh
if test "$compiler" != bootstrap; then
${SHELL} ${srcdest}build-aux/build-scaffold.sh
fi
if test -n "$GUILE" -a "$GUILE" != true; then
${SHELL} ${srcdest}build-aux/build-guile.sh
@ -73,6 +75,7 @@ fi
compiler=gcc ${SHELL} ${srcdest}build-aux/build-source-lib.sh
)
(
if test $compiler = gcc; then
AM_LDFLAGS="$AM_LDFLAGS
@ -86,7 +89,9 @@ fi
-I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu
"
${SHELL} ${srcdest}build-aux/build-mes.sh
if test "$compiler" != bootstrap; then
${SHELL} ${srcdest}build-aux/build-mes.sh
fi
)
(
@ -118,5 +123,7 @@ fi
${SHELL} ${srcdest}build-aux/build-source-lib.sh
if $bootstrap; then
${SHELL} ${srcdest}build-aux/build-mes.sh
cp -f bin/mes-mescc ../bin
cp -f bin/mes ../bin
fi
)

View File

@ -35,7 +35,6 @@ LDFLAGS:=@LDFLAGS@
MAKEINFO:=@MAKEINFO@
M1:=@M1@
MES_FOR_BUILD:=@MES_FOR_BUILD@
MES_SEED:=@MES_SEED@
NYACC:=@NYACC@
PACKAGE:=@PACKAGE@
PACKAGE_NAME:=@PACKAGE_NAME@
@ -53,7 +52,7 @@ arch:=@arch@
build:=@build@
host:=@host@
bootstrap:=
bootstrap:=@bootstrap@
compiler:=@compiler@
courageous:=@courageous@
mes_system:=@mes_system@

View File

@ -36,7 +36,6 @@ LDFLAGS=${LDFLAGS-"@LDFLAGS@"}
MAKEINFO="@MAKEINFO@"
M1="@M1@"
MES_FOR_BUILD="@MES_FOR_BUILD@"
MES_SEED="@MES_SEED@"
NYACC="@NYACC@"
PACKAGE="@PACKAGE@"
PACKAGE_NAME="@PACKAGE_NAME@"

View File

@ -83,10 +83,6 @@ ifdef MES_FOR_BUILD
export MES_FOR_BUILD
endif
ifdef MES_SEED
export MES_SEED
endif
ifdef MESCC
export MESCC
endif

View File

@ -43,7 +43,13 @@ fi
DESTDIR=${DESTDIR-}
mkdir -p ${DESTDIR}${bindir}
cp $_v src/mes ${DESTDIR}${bindir}/mes
cp $_v bin/mes ${DESTDIR}${bindir}/mes
if test -f bin/mes-gcc; then
cp $_v bin/mes-gcc ${DESTDIR}${bindir}/mes-gcc
fi
if test -f bin/mes-mescc; then
cp $_v bin/mes-mescc ${DESTDIR}${bindir}/mes-mescc
fi
cp $_v scripts/mesar ${DESTDIR}${bindir}/mesar
cp $_v scripts/mescc.scm ${DESTDIR}${bindir}/mescc.scm
cp $_v scripts/mescc ${DESTDIR}${bindir}/mescc

View File

@ -36,10 +36,10 @@ if [ -n "$srcdest" ]; then
fi
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
PATH="$abs_top_builddir/scripts:$abs_top_builddir/scripts:$abs_top_builddir/src:$abs_top_builddir/build-aux:$PATH"
PATH="$abs_top_builddir/scripts:$abs_top_builddir/scripts:$abs_top_builddir/bin:$abs_top_builddir/build-aux:$PATH"
export PATH
MES=${MES-${abs_top_builddir}/src/${program_prefix}mes}
MES=${MES-${abs_top_builddir}/bin/${program_prefix}mes}
export MES
bindir=${abs_top_builddir}/scripts

34
configure vendored
View File

@ -378,10 +378,11 @@ Ignored for Debian:
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
CPPFLAGS C preprocessor flags
LDFLAGS C linker flags
GUILE guile command
GUILD guild command
MES_FOR_BUILD build system MES [can be mes or guile]
MES_SEED location of mes-seed
" PACKAGE VERSION (getenv "prefix")))
(define (main args)
@ -435,12 +436,7 @@ Some influential environment variables:
(when %verbose?
(stderr "configure args=~s\n" args))
(for-each (lambda (v) (apply setenv (string-split v #\=))) vars)
(let* ((mes-seed (or (getenv "MES_SEED")
(string-append srcdest "../mes-seed")))
(mes-seed (and mes-seed
(file-exists? (string-append mes-seed "/x86-mes/mes.S"))
mes-seed))
(tinycc-prefix (or (getenv "TINYCC_PREFIX")
(let* ((tinycc-prefix (or (getenv "TINYCC_PREFIX")
(string-append srcdest "../tinycc-prefix")))
(cross? (not (equal? host-type build-type)))
(gcc (or (getenv "CC") (if cross? (string-append host-type "-" "gcc") "gcc")))
@ -575,7 +571,7 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@build@" . ,build-type)
("@host@" . ,host-type)
("@bootstrap@" . ,(if with-courage? "true" "false"))
("@bootstrap@" . ,(if with-bootstrap? "true" "false"))
("@courageous@" . ,(if with-courage? "true" "false"))
("@compiler@" . ,compiler)
("@mes_bits@" . ,mes-bits)
@ -621,7 +617,6 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@MAKEINFO@" . ,(or (file-name "makeinfo" deps) ""))
("@MES_FOR_BUILD@" . ,(or (file-name "mes" deps)
guile))
("@MES_SEED@" . ,(or mes-seed ""))
("@PERL@" . ,(or (file-name "perl" deps) ""))
("#SCHEME=\"@SCHEME@\"" . ,(if with-cheating? (string-append "\nSCHEME=\"" guile "\"") ""))
("@SCHEME@" . ,(if with-cheating? guile ""))
@ -639,9 +634,8 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
(cons (string-append "@" (variable-name o) "@") (or (format #f "~a" (dependency-file-name o)) "")))
deps))))
(when (and (not cc)
(not mes-seed))
(format (current-error-port) "must supply C compiler or MES_SEED/x86-mes/mes.S\n")
(unless cc
(format (current-error-port) "must supply a C compiler")
(exit 2))
(for-each (lambda (o)
(let* ((src (string-append srcdest o))
@ -689,13 +683,15 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
(let ((make (and=> (file-name "make" deps) basename)))
(display (string-append "
GNU Mes is configured for
compiler: " compiler "
cpu: " mes-cpu "
bits: " mes-bits "
libc: " mes-libc "
kernel: " mes-kernel "
system: " mes-system "
tools: " (if numbered-arch? "numbered" "named") " arch
compiler: " compiler "
cpu: " mes-cpu "
bits: " mes-bits "
libc: " mes-libc "
kernel: " mes-kernel "
system: " mes-system "
tools: " (if numbered-arch? "numbered" "named") " arch
bootstrap: " (if with-bootstrap? "yes" "no") "
courageous: " (if with-courage? "yes" "no") "
Run:
" (or make "./build.sh") " to build mes

View File

@ -82,8 +82,6 @@ GIT=${GIT-$(command -v git)} || true
PERL=${PERL-$(command -v perl)} || true
SHELL=${BASH-$SHELL}
MES_SEED=${MES_SEED-../mes-seed}
if test "$srcdir" = .; then
top_builddir=.
else
@ -169,8 +167,6 @@ subst () {
-e s,"@M1@,$M1,"\
-e s,"@M1FLAGS@,$M1FLAGS,"\
-e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\
-e s,"@MES_SEED@,$MES_SEED,"\
-e s,"@MES_SEED@,$MES_SEED,"\
-e s,"@numbered_arch@,$numbered_arch,"\
-e s,"@SHELL@,$SHELL,"\
$1 > $2
@ -264,13 +260,15 @@ EOF
cat <<EOF
GNU Mes is configured for
compiler: $compiler
cpu: $mes_cpu
bits: $mes_bits
libc: $mes_libc
kernel: $mes_kernel
system: $mes_system
tools: $mes_tools arch
compiler: $compiler
cpu: $mes_cpu
bits: $mes_bits
libc: $mes_libc
kernel: $mes_kernel
system: $mes_system
tools: $mes_tools arch
courageous: $courageous
bootstrap: yes
Run:
sh bootstrap.sh to bootstrap build mes

View File

@ -521,7 +521,7 @@ build-aux/check-boot.sh
Run a single Mes boot test
@example
MES_BOOT=scaffold/boot/00-zero.scm src/mes
MES_BOOT=scaffold/boot/00-zero.scm bin/mes
@end example
Run a single Mes Scheme test

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests catch)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests catch)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests closure)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests closure)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests cwv)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests cwv)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,5 +1,5 @@
#! /bin/sh
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests display)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests display)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests fluids)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests fluids)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,5 +1,5 @@
#! /bin/sh
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests getopt-long)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests getopt-long)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests guile)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests guile)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let-syntax)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let-syntax)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -2,7 +2,7 @@
# -*-scheme-*-
if [ "$MES" != guile ]; then
export MES_BOOT=boot-02.scm
MES=${MES-$(dirname $0)/../src/mes}
MES=${MES-$(dirname $0)/../bin/mes}
$MES < $0
exit $?
else

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests match)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests match)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests math)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests math)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests module)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests module)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests optargs)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests optargs)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests peg)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests peg)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,7 +1,7 @@
#! /bin/sh
# -*-scheme-*-
if [ "$MES" != guile ]; then
MES=${MES-$(dirname $0)/../src/mes}
MES=${MES-$(dirname $0)/../bin/mes}
MES_BOOT=boot-02.scm exec $MES < $0
exit $?
fi

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests pmatch)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests pmatch)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-13)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-13)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
MES_ARENA=${MES_ARENA-10000000} exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests psyntax)' -s "$0" "$@"
MES_ARENA=${MES_ARENA-10000000} exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests psyntax)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -23,7 +23,7 @@
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
if [ "$MES" != guile ]; then
MES=${MES-$(dirname $0)/../src/mes}
MES=${MES-$(dirname $0)/../bin/mes}
MES_BOOT=boot-02.scm exec $MES < $0
fi

View File

@ -2,7 +2,7 @@
# -*-scheme-*-
if [ "$MES" != guile ]; then
export MES_BOOT=boot-02.scm
MES=${MES-$(dirname $0)/../src/mes}
MES=${MES-$(dirname $0)/../bin/mes}
$MES < $0
exit $?
fi

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-1)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-1)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-13)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-13)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-14)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-14)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-16)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-16)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-43)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-43)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-9)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-9)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests syntax)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests syntax)' -s "$0" "$@"
!#
;;; -*-scheme-*-

View File

@ -1,6 +1,6 @@
#! /bin/sh
# -*-scheme-*-
exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests vector)' -s "$0" "$@"
exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests vector)' -s "$0" "$@"
!#
;;; -*-scheme-*-