From 33f37f274749f779b26efe0afd52dd687a89ef27 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 9 Oct 2018 19:22:51 +0200 Subject: [PATCH] build: x86_64 bootstrap build fixes and workaround. * configure: Substitute @arch@ (WAS: ARCH). Update users. * configure.sh: Substitute @arch@. * build-aux/build-mes.sh: Use $GUILE for x86_64 build. * build-aux/install.sh.in: Install mes.S, mes.x86_64-mes-S too. Prune *.E, *.out. --- build-aux/build-mes.sh | 6 +++--- build-aux/build-x86_64-mes.sh | 7 ------- build-aux/build.sh.in | 5 +++-- build-aux/config.sh | 1 + build-aux/export.make | 4 ++-- build-aux/install.sh.in | 9 +++++++-- configure | 3 ++- configure.sh | 2 ++ 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/build-aux/build-mes.sh b/build-aux/build-mes.sh index 2b46c85e..8c301fab 100755 --- a/build-aux/build-mes.sh +++ b/build-aux/build-mes.sh @@ -107,9 +107,9 @@ fi PREPROCESS=1 if [ ! -d "$MES_SEED" ] \ - && [ "$ARCH" = "i386" \ - -o "$ARCH" = "i586" \ - -o "$ARCH" = "i686" ]; then + && [ "$arch" = "i386" \ + -o "$arch" = "i586" \ + -o "$arch" = "i686" ]; then MES_ARENA=100000000 fi diff --git a/build-aux/build-x86_64-mes.sh b/build-aux/build-x86_64-mes.sh index de9fd8ec..67f867fc 100755 --- a/build-aux/build-x86_64-mes.sh +++ b/build-aux/build-x86_64-mes.sh @@ -107,13 +107,6 @@ fi PREPROCESS=1 -if [ ! -d "$MES_SEED" ] \ - && [ "$ARCH" = "i386" \ - -o "$ARCH" = "i586" \ - -o "$ARCH" = "i686" ]; then - MES_ARENA=100000000 -fi - MES_ARENA=100000000 ARCHDIR=1 NOLINK=1 bash ${srcdest}build-aux/cc-x86_64-mes.sh lib/linux/x86_64-mes/crt1 diff --git a/build-aux/build.sh.in b/build-aux/build.sh.in index 5ef1131e..836a6928 100755 --- a/build-aux/build.sh.in +++ b/build-aux/build.sh.in @@ -24,6 +24,7 @@ abs_top_srcdir="@abs_top_srcdir@" abs_top_builddir="@abs_top_builddir@" prefix=${prefix-@prefix@} VERSION=${VERSION-@VERSION@} +arch=${arch-@arch@} . ${srcdest}build-aux/config.sh . ${srcdest}build-aux/trace.sh @@ -53,6 +54,6 @@ if [ -n "$TCC" ]; then fi sh ${srcdest}build-aux/build-mes.sh -if [ "$MES" = guile ]; then - sh ${srcdest}build-aux/build-x86_64-mes.sh +if [ "$arch" = x86_64 -a "$GUILE" ]; then + MES=$GUILE sh ${srcdest}build-aux/build-x86_64-mes.sh fi diff --git a/build-aux/config.sh b/build-aux/config.sh index f1a84886..6a1cbd9a 100644 --- a/build-aux/config.sh +++ b/build-aux/config.sh @@ -58,6 +58,7 @@ export V export abs_top_builddir export abs_top_srcdir +export arch export datadir export moduledir export prefix diff --git a/build-aux/export.make b/build-aux/export.make index 3df66d81..5f34aad1 100644 --- a/build-aux/export.make +++ b/build-aux/export.make @@ -48,8 +48,8 @@ ifdef DESTDIR export DESTDIR endif -ifdef ARCH -export ARCH +ifdef arch +export arch endif ifdef CC diff --git a/build-aux/install.sh.in b/build-aux/install.sh.in index 9a414b30..70a16302 100755 --- a/build-aux/install.sh.in +++ b/build-aux/install.sh.in @@ -94,17 +94,22 @@ fi mkdir -p $DESTDIR$MES_PREFIX if [ -z "$srcdest" ]; then - tar -cf- 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='*.gcc*' --exclude='*.mes*' scaffold | tar -xf- -C $DESTDIR$MES_PREFIX else tar -cf- -C ${srcdest} include lib | tar -xf- -C $DESTDIR$MES_PREFIX - tar -cf- -C lib | 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} scaffold | tar -xf- -C $DESTDIR$MES_PREFIX fi tar -cf- -C ${srcdest}mes module | tar -xf- -C $DESTDIR$MES_PREFIX +cp src/mes.S $DESTDIR$MES_PREFIX/lib/x86-mes/mes.S +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 +fi + mkdir -p $DESTDIR$guile_site_dir mkdir -p $DESTDIR$guile_site_ccache_dir tar -cf- -C ${srcdest}module --exclude='*.go' . | tar -xf- -C $DESTDIR$guile_site_dir diff --git a/configure b/configure index b56310ea..6ad9673b 100755 --- a/configure +++ b/configure @@ -423,7 +423,7 @@ Some influential environment variables: (stdout "PACKAGE:=~a\n" PACKAGE) (stdout "VERSION:=~a\n" VERSION) - (stdout "ARCH:=~a\n" arch) + (stdout "arch:=~a\n" arch) (stdout "build:=~a\n" build-type) (stdout "host:=~a\n" host-type) @@ -481,6 +481,7 @@ Some influential environment variables: ("@guile_site_dir@" . ,guile-site-dir) ("@guile_site_ccache_dir@" . ,guile-site-ccache-dir) ("@VERSION@" . ,VERSION) + ("@arch@" . ,arch) ("mes/module/" . ,(string-append moduledir/))))) (for-each (lambda (o) (let* ((src (string-append srcdest o)) diff --git a/configure.sh b/configure.sh index 97497555..ae6aa726 100755 --- a/configure.sh +++ b/configure.sh @@ -60,6 +60,7 @@ moduledir=$(eval echo ${moduledir-$datadir/mes/module}) moduledir_="$moduledir/" 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}) +arch=$(get_machine || uname -m) subst () { sed \ @@ -74,6 +75,7 @@ subst () { -e s,"@guile_site_dir@,$guile_site_dir,"\ -e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\ -e s,"@VERSION@,$VERSION,"\ + -e s,"@arch@,$arch,"\ -e s,"mes/module/,$moduledir/,"\ $1 > $2 }