build: Support building with Gash.

* build-aux/install.sh: Replace variables with substitution.
* build-aux/bootstrap.sh: New file.
* configure: Substitute it.
* configure.sh: Likewise.  Be friendly to Gash.
* .gitignore: Ignore it.
This commit is contained in:
Jan Nieuwenhuizen 2018-11-24 21:07:31 +01:00
parent 6b841a0cab
commit 8f8852ccff
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
7 changed files with 145 additions and 65 deletions

1
.gitignore vendored
View file

@ -110,6 +110,7 @@
/config.status /config.status
/pre-inst-env /pre-inst-env
/bootstrap.sh
/build.sh /build.sh
/check.sh /check.sh
/install.sh /install.sh

82
build-aux/bootstrap.sh.in Normal file
View file

@ -0,0 +1,82 @@
#! @SHELL@
set -e
if [ "$V" = 1 -o "$V" = 2 ]; then
set -x
fi
MES_ARENA=${MES_ARENA-100000000}
MES_MAX_ARENA=${MES_MAX_ARENA-100000000}
MES_STACK=${MES_STACK-500000}
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/gc.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/hash.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/lib.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/math.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/mes.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/module.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/posix.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/reader.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/strings.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/struct.c
@GUILE@ -e '(mes-snarf)' build-aux/mes-snarf.scm --mes src/vector.c
hex2 --LittleEndian --Architecture 1 --BaseAddress 0x1000000 -f lib/x86-mes/elf32-0header.hex2 -f lib/x86-mes/elf32-body-exit-42.hex2 -f lib/x86-mes/elf-0footer.hex2 --exec_enable -o lib/x86-mes/0exit-42
hex2 --LittleEndian --Architecture 1 --BaseAddress 0x1000000 -f lib/x86-mes/elf32-header.hex2 -f lib/x86-mes/elf32-body-exit-42.hex2 -f lib/x86-mes/elf32-footer-single-main.hex2 --exec_enable -o lib/x86-mes/exit-42
M1 --LittleEndian --Architecture 1 -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/crt1.S -o lib/x86-mes/crt1.o
M1 --LittleEndian --Architecture 1 -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/libc.S -o lib/x86-mes/libc.o
M1 --LittleEndian --Architecture 1 -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/mes.S -o src/mes.o
blood-elf -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/mes.S -f @MES_SEED@/x86-mes/libc.S -o src/mes.S.blood-elf
M1 --LittleEndian --Architecture 1 -f src/mes.S.blood-elf -o src/mes.o.blood-elf
hex2 --LittleEndian --Architecture 1 --BaseAddress 0x1000000 -f lib/x86-mes/elf32-header.hex2 -f lib/x86-mes/crt1.o -f lib/x86-mes/libc.o -f src/mes.o -f src/mes.o.blood-elf --exec_enable -o src/mes
M1 --LittleEndian --Architecture 1 -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/libc+tcc.S -o lib/x86-mes/libc+tcc.o
M1 --LittleEndian --Architecture 1 -f lib/x86-mes/x86.M1 -f @MES_SEED@/x86-mes/libc+gnu.S -o lib/x86-mes/libc+gnu.o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o lib/linux/x86-mes/crt1.o lib/linux/x86-mes/crt1.c
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o lib/libc-mini.x86-mes-o lib/libc-mini.c
mv lib/libc-mini.x86-mes-S lib/x86-mes/libc-mini.S
mv lib/libc-mini.x86-mes-o lib/x86-mes/libc-mini.o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o lib/libc.x86-mes-o lib/libc.c
mv lib/libc.x86-mes-S lib/x86-mes/libc.S
mv lib/libc.x86-mes-o lib/x86-mes/libc.o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o lib/libc+tcc.x86-mes-o lib/libc+tcc.c
mv lib/libc+tcc.x86-mes-S lib/x86-mes/libc+tcc.S
mv lib/libc+tcc.x86-mes-o lib/x86-mes/libc+tcc.o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o lib/libc+gnu.x86-mes-o lib/libc+gnu.c
mv lib/libc+gnu.x86-mes-S lib/x86-mes/libc+gnu.S
mv lib/libc+gnu.x86-mes-o lib/x86-mes/libc+gnu.o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/main.x86-mes-o scaffold/main.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-main scaffold/main.x86-mes-o
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/hello.x86-mes-o scaffold/hello.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-hello scaffold/hello.x86-mes-o -l c-mini
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/argv.x86-mes-o scaffold/argv.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-argv scaffold/argv.x86-mes-o -l c-mini
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/malloc.x86-mes-o scaffold/malloc.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-malloc scaffold/malloc.x86-mes-o -l c
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/micro-mes.x86-mes-o scaffold/micro-mes.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-micro-mes scaffold/micro-mes.x86-mes-o -l c
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/tiny-mes.x86-mes-o scaffold/tiny-mes.c
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o scaffold/x86-mes-tiny-mes scaffold/tiny-mes.x86-mes-o -l c
@GUILE@ -e main -L module scripts/mescc.scm -c -D 'VERSION="@VERSION@"' -D 'MODULEDIR="@moduledir@"' -D 'PREFIX="@prefix@"' -I . -I lib -I include -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o src/mes.x86-mes-o src/mes.c
cp src/mes.x86-mes-S src/mes.S
@GUILE@ -e main -L module scripts/mescc.scm -v -g -L lib/linux/x86-mes -L lib/linux -L lib/x86-mes -L lib -L @MES_SEED@ -o src/x86-mes-mes src/mes.x86-mes-o -l c
cp src/x86-mes-mes src/mes

View file

@ -21,49 +21,33 @@
set -e set -e
. ./config.status . ./config.status
. ${srcdest}build-aux/config.sh
. ${srcdest}build-aux/trace.sh
SHELL=${SHELL-$(command -v sh)} mes_prefix=@prefix@/share/mes
# use bash or lose if pipes fail # use bash or lose if pipes fail
[ -n "$BASH" ] && set -o pipefail if [ "$(basename $SHELL)" == bash ]; then
set -o pipefail
MES_PREFIX=${MES_PREFIX-$prefix/share/mes}
GUILE=${GUILE-$(command -v guile)} || true
if [ -z "$GUILE" -o "$GUILE" = true ]; then
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
else
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')}
fi fi
bindir=$(eval echo ${bindir-$prefix/bin})
datadir=$(eval echo ${datadir-$prefix/share})
docdir=$(eval echo ${docdir-$datadir/doc/mes-$VERSION})
infodir=$(eval echo ${infodir-$datadir/info})
mandir=$(eval echo ${mandir-$datadir/man})
moduledir=$(eval echo ${moduledir-$datadir/mes/module})
guile_site_dir=$(eval echo ${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION})
guile_site_ccache_dir=$(eval echo ${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache})
mkdir -p $DESTDIR$bindir mkdir -p $DESTDIR@bindir@
if [ -f src/x86-mes-mes ]; then if [ -f src/x86-mes-mes ]; then
cp src/x86-mes-mes $DESTDIR$bindir/mes cp src/x86-mes-mes $DESTDIR@bindir@/mes
fi fi
cp scripts/mescc.scm $DESTDIR$bindir/mescc.scm cp scripts/mescc.scm $DESTDIR@bindir@/mescc.scm
cp scripts/mescc $DESTDIR$bindir/mescc cp scripts/mescc $DESTDIR@bindir@/mescc
sed \ sed \
-e "s,^#! /bin/sh,#! $SHELL," \ -e "s,^#! /bin/sh,#! @SHELL@," \
scripts/diff.scm > $DESTDIR$bindir/diff.scm scripts/diff.scm > $DESTDIR@bindir@/diff.scm
chmod -w+x $DESTDIR$bindir/diff.scm chmod -w+x $DESTDIR@bindir@/diff.scm
mkdir -p $docdir mkdir -p $DESTDIR@docdir@
if [ -n "$PERL" -a -n "$GIT" ]\ if [ -n "@PERL@" ]\
&& $PERL -v > /dev/null\ && [ -n "@GIT@" ]\
&& $GIT status > /dev/null; then && @PERL@ -v > /dev/null\
$PERL ${srcdest}build-aux/gitlog-to-changelog --srcdir=. > ChangeLog && @GIT@ status > /dev/null; then
@PERL@ ${srcdest}build-aux/gitlog-to-changelog --srcdir=. > ChangeLog
fi fi
cp\ cp\
@ -74,57 +58,57 @@ cp\
INSTALL\ INSTALL\
NEWS\ NEWS\
README\ README\
$DESTDIR$docdir $DESTDIR@docdir@
if [ -f ChangeLog ]; then if [ -f ChangeLog ]; then
cp ChangeLog $DESTDIR$docdir cp ChangeLog $DESTDIR@docdir@
else else
cp ChangeLog $DESTDIR$docdir cp ChangeLog $DESTDIR@docdir@
fi fi
if [ -f ChangeLog ]; then if [ -f ChangeLog ]; then
cp ChangeLog $docdir cp ChangeLog @docdir@
else else
cp ChangeLog $docdir cp ChangeLog @docdir@
fi fi
mkdir -p $DESTDIR$MES_PREFIX mkdir -p $DESTDIR$mes_prefix
if [ -z "$srcdest" ]; then if [ -z "$srcdest" ]; then
tar -cf- --exclude='*.E' --exclude='*.*-out' include lib | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- --exclude='*.E' --exclude='*.*-out' include lib | tar -xf- -C $DESTDIR$mes_prefix
tar -cf- --exclude='*.go' module | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- --exclude='*.go' module | tar -xf- -C $DESTDIR$mes_prefix
tar -cf- --exclude='*.gcc*' --exclude='*.mes*' scaffold | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- --exclude='*.gcc*' --exclude='*.mes*' scaffold | tar -xf- -C $DESTDIR$mes_prefix
else else
tar -cf- -C ${srcdest} include lib | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- -C ${srcdest} include lib | tar -xf- -C $DESTDIR$mes_prefix
tar -cf- -C lib --exclude='*.E' --exclude='*.*-out' | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- -C lib --exclude='*.E' --exclude='*.*-out' | tar -xf- -C $DESTDIR$mes_prefix
tar -cf- -C ${srcdest} module | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- -C ${srcdest} module | tar -xf- -C $DESTDIR$mes_prefix
tar -cf- -C ${srcdest} scaffold | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- -C ${srcdest} scaffold | tar -xf- -C $DESTDIR$mes_prefix
fi fi
tar -cf- -C ${srcdest}mes module | tar -xf- -C $DESTDIR$MES_PREFIX tar -cf- -C ${srcdest}mes module | tar -xf- -C $DESTDIR$mes_prefix
if [ -f src/mes.x86-mes-S ]; then if [ -f src/mes.x86-mes-S ]; then
cp src/mes.x86-mes-S $DESTDIR$MES_PREFIX/lib/x86-mes/mes.S cp src/mes.x86-mes-S $DESTDIR$mes_prefix/lib/x86-mes/mes.S
fi fi
if [ -f src/mes.x86_64-mes-S ]; then if [ -f src/mes.x86_64-mes-S ]; then
cp src/mes.x86_64-mes-S $DESTDIR$MES_PREFIX/lib/x86_64-mes/mes.S cp src/mes.x86_64-mes-S $DESTDIR$mes_prefix/lib/x86_64-mes/mes.S
fi fi
mkdir -p $DESTDIR$guile_site_dir mkdir -p $DESTDIR@guile_site_dir@
mkdir -p $DESTDIR$guile_site_ccache_dir mkdir -p $DESTDIR@guile_site_ccache_dir@
tar -cf- -C ${srcdest}module --exclude='*.go' . | tar -xf- -C $DESTDIR$guile_site_dir tar -cf- -C ${srcdest}module --exclude='*.go' . | tar -xf- -C $DESTDIR@guile_site_dir@
tar -cf- -C module --exclude='*.scm' . | tar -xf- -C $DESTDIR$guile_site_ccache_dir tar -cf- -C module --exclude='*.scm' . | tar -xf- -C $DESTDIR@guile_site_ccache_dir@
if [ -f doc/mes.info ]; then if [ -f doc/mes.info ]; then
mkdir -p $DESTDIR$infodir mkdir -p $DESTDIR@infodir@
tar -cf- doc/mes.info* doc/images | tar -xf- --strip-components=1 -C $DESTDIR$infodir tar -cf- doc/mes.info* doc/images | tar -xf- --strip-components=1 -C $DESTDIR@infodir@
install-info --info-dir=$DESTDIR$infodir doc/mes.info install-info --info-dir=$DESTDIR@infodir@ doc/mes.info
fi fi
if [ -f doc/mes.1 ]; then if [ -f doc/mes.1 ]; then
mkdir -p $DESTDIR$mandir/man1 mkdir -p $DESTDIR@mandir@/man1
cp doc/mes.1 $DESTDIR$mandir/man1/ cp doc/mes.1 $DESTDIR@mandir@/man1/
fi fi
if [ -f doc/mescc.1 ]; then if [ -f doc/mescc.1 ]; then
mkdir -p $DESTDIR$mandir/man1 mkdir -p $DESTDIR@mandir@/man1
cp doc/mescc.1 $DESTDIR$mandir/man1/ cp doc/mescc.1 $DESTDIR@mandir@/man1/
fi fi

View file

@ -27,7 +27,7 @@ sh ${srcdest}build-aux/test-cc.sh $1
if [ ! "$mesc_p" ]; then if [ ! "$mesc_p" ]; then
#FIXME: c&p #FIXME: c&p
unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p posix_p unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p posix_p
MES=guile MES=${MES-guile}
mesc_p=1 mesc_p=1
mes_p=1 mes_p=1
mes_arch=x86-mes mes_arch=x86-mes

8
configure vendored
View file

@ -370,7 +370,9 @@ Some influential environment variables:
(docdir (option-ref options 'docdir "${datadir}/doc/mes-${VERSION}")) (docdir (option-ref options 'docdir "${datadir}/doc/mes-${VERSION}"))
(libdir (option-ref options 'libdir "${prefix}/lib")) (libdir (option-ref options 'libdir "${prefix}/lib"))
(moduledir "${datadir}/mes/module") (moduledir "${datadir}/mes/module")
(moduledir/ (gulp-pipe* "echo" prefix "/share/mes/module/")) (moduledir/ (string-append
(gulp-pipe* "echo" prefix)
"/share/mes/module/"))
(guile-effective-version (effective-version)) (guile-effective-version (effective-version))
(guile-site-dir (if (equal? prefix ".") (canonicalize-path ".") (guile-site-dir (if (equal? prefix ".") (canonicalize-path ".")
(string-append prefix "/share/guile/site/" guile-effective-version))) (string-append prefix "/share/guile/site/" guile-effective-version)))
@ -419,6 +421,7 @@ Some influential environment variables:
(make-dep "mes" #:version '(0 18) #:optional? #t) (make-dep "mes" #:version '(0 18) #:optional? #t)
(make-dep "guix" #:version '(0 13) #:optional? #t) (make-dep "guix" #:version '(0 13) #:optional? #t)
(make-dep "ar" #:version '(2 10) #:optional? #t) (make-dep "ar" #:version '(2 10) #:optional? #t)
(make-dep "sh" #:version '(0) #:optional? #t)
(make-dep "bash" #:version '(2 0) #:optional? #t) (make-dep "bash" #:version '(2 0) #:optional? #t)
(make-dep "guild" #:version '(2 0) #:commands '("guild" "guile-tools")) (make-dep "guild" #:version '(2 0) #:commands '("guild" "guile-tools"))
(make-dep "cc" #:commands (list gcc tcc mescc) #:optional? #t) (make-dep "cc" #:commands (list gcc tcc mescc) #:optional? #t)
@ -561,6 +564,7 @@ Some influential environment variables:
guile)) guile))
("@MES_SEED@" . ,(or mes-seed "")) ("@MES_SEED@" . ,(or mes-seed ""))
("@PERL@" . ,(or (file-name "perl" deps) "")) ("@PERL@" . ,(or (file-name "perl" deps) ""))
("@SHELL@" . ,(or (file-name "sh" deps) ""))
("@CFLAGS@" . ,(or (getenv "CFLAGS") "")) ("@CFLAGS@" . ,(or (getenv "CFLAGS") ""))
("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") "")) ("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") ""))
@ -586,6 +590,7 @@ Some influential environment variables:
"build-aux/GNUmakefile.in" "build-aux/GNUmakefile.in"
"build-aux/config.status.in" "build-aux/config.status.in"
"build-aux/build.sh.in" "build-aux/build.sh.in"
"build-aux/bootstrap.sh.in"
"build-aux/check.sh.in" "build-aux/check.sh.in"
"build-aux/install.sh.in" "build-aux/install.sh.in"
"build-aux/pre-inst-env.in" "build-aux/pre-inst-env.in"
@ -598,6 +603,7 @@ Some influential environment variables:
(chmod "scripts/mescc" #o755) (chmod "scripts/mescc" #o755)
(chmod "scripts/mescc.scm" #o755) (chmod "scripts/mescc.scm" #o755)
(chmod "build.sh" #o755) (chmod "build.sh" #o755)
(chmod "bootstrap.sh" #o755)
(chmod "check.sh" #o755) (chmod "check.sh" #o755)
(chmod "install.sh" #o755) (chmod "install.sh" #o755)
(chmod "uninstall.sh" #o755) (chmod "uninstall.sh" #o755)

View file

@ -69,6 +69,7 @@ GUILE=${GUILE-$(command -v guile)} || true
HEX2=${HEX2-$(command -v hex2)} HEX2=${HEX2-$(command -v hex2)}
M1=${M1-$(command -v M1)} M1=${M1-$(command -v M1)}
MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)} MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)}
GIT=${GIT-$(command -v git)} || true
PERL=${PERL-$(command -v perl)} || true PERL=${PERL-$(command -v perl)} || true
MES_SEED=${MES_SEED-../mes-seed} MES_SEED=${MES_SEED-../mes-seed}
@ -134,6 +135,7 @@ subst () {
-e s,"@BASH@,$BASH,"\ -e s,"@BASH@,$BASH,"\
-e s,"@BLOOD_ELF@,$BLOOD_ELF,"\ -e s,"@BLOOD_ELF@,$BLOOD_ELF,"\
-e s,"@CC@,$CC,"\ -e s,"@CC@,$CC,"\
-e s,"@GIT@,$GIT,"\
-e s,"@GUILD@,$GUILD,"\ -e s,"@GUILD@,$GUILD,"\
-e s,"@GUILE@,$GUILE,"\ -e s,"@GUILE@,$GUILE,"\
-e s,"@PERL@,$PERL,"\ -e s,"@PERL@,$PERL,"\
@ -144,6 +146,8 @@ subst () {
-e s,"@M1FLAGS@,$M1FLAGS,"\ -e s,"@M1FLAGS@,$M1FLAGS,"\
-e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\ -e s,"@MES_FOR_BUILD@,$MES_FOR_BUILD,"\
-e s,"@MES_SEED@,$MES_SEED,"\ -e s,"@MES_SEED@,$MES_SEED,"\
-e s,"@MES_SEED@,$MES_SEED,"\
-e s,"@SHELL@,$SHELL,"\
-e s,"mes/module/,$moduledir/,"\ -e s,"mes/module/,$moduledir/,"\
$1 > $2 $1 > $2
} }
@ -170,10 +174,10 @@ if [ "$arch" = i386\
fi fi
# #
if $CC --version | grep gcc 2>/dev/null; then if $CC --version | grep gcc; then #2>/dev/null; then
gcc_p=1 gcc_p=1
compiler=gcc compiler=gcc
elif $CC --version | grep tcc 2>/dev/null; then elif $CC --version | grep tcc; then #2>/dev/null; then
tcc_p=1 tcc_p=1
compiler=tcc compiler=tcc
else else
@ -199,6 +203,8 @@ subst ${srcdest}build-aux/GNUmakefile.in GNUmakefile
subst ${srcdest}build-aux/config.status.in config.status subst ${srcdest}build-aux/config.status.in config.status
subst ${srcdest}build-aux/build.sh.in build.sh subst ${srcdest}build-aux/build.sh.in build.sh
chmod +x build.sh chmod +x build.sh
subst ${srcdest}build-aux/bootstrap.sh.in bootstrap.sh
chmod +x bootstrap.sh
subst ${srcdest}build-aux/check.sh.in check.sh subst ${srcdest}build-aux/check.sh.in check.sh
chmod +x check.sh chmod +x check.sh
subst ${srcdest}build-aux/install.sh.in install.sh subst ${srcdest}build-aux/install.sh.in install.sh

View file

@ -33,9 +33,10 @@ export MES_PREFIX
MES=${MES-src/mes} MES=${MES-src/mes}
exec ${SCHEME-$MES} \ dir=$(dirname $0)
${SCHEME-$MES} \
--no-auto-compile\ --no-auto-compile\
-e main\ -e main\
-L @guile_site_dir@\ -L @guile_site_dir@\
-C @guile_site_ccache_dir@\ -C @guile_site_ccache_dir@\
$(dirname $0)/mescc.scm "$@" $dir/mescc.scm "$@"