build: Resurrect bootstrap.sh.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Jul 2019 10:17:03 +0000 (12:17 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Jul 2019 10:17:03 +0000 (12:17 +0200)
* build-aux/connfigure-lib.sh: Split from build-lib.sh
* build-aux/build-lib.sh: Include it.
* build-aux/bootstrap.sh.in: New file.
* configure.sh: Substitute it.

.gitignore
build-aux/bootstrap.sh.in [new file with mode: 0644]
build-aux/build-lib.sh
build-aux/check-mescc.sh
build-aux/config.make.in
build-aux/config.sh.in
build-aux/configure-lib.sh [new file with mode: 0644]
build-aux/export.make
configure.sh
lib/posix/getcwd.c
scripts/ar.in

index 69991eb1d114ff33253c1f38d1edb99112c7a87b..090230c92e4c6e32fa3891c24a4c3519ec041159 100644 (file)
 
 /config.status
 /pre-inst-env
+/bootstrap.sh
 /build.sh
 /check.sh
 /install.sh
diff --git a/build-aux/bootstrap.sh.in b/build-aux/bootstrap.sh.in
new file mode 100644 (file)
index 0000000..8a3c24c
--- /dev/null
@@ -0,0 +1,83 @@
+#! @SHELL@
+
+# GNU Mes --- Maxwell Equations of Software
+# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+#
+# This file is part of GNU Mes.
+#
+# GNU Mes 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.
+#
+# GNU Mes 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 GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
+
+LANG=
+MES_ARENA=${MES_ARENA-100000000}
+MES_MAX_ARENA=${MES_MAX_ARENA-100000000}
+MES_STACK=${MES_STACK-500000}
+
+. build-aux/configure-lib.sh
+
+CPPFLAGS="-D HAVE_CONFIG_H=1 -I include"
+CFLAGS=""
+mkdir -p mescc-lib
+cp config.sh mescc-lib/config.sh
+cd mescc-lib
+srcdest=../
+CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
+
+mkdir $mes_cpu-mes
+$CC -c $CPPFLAGS $CFLAGS ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
+cp crt1.o $mes_cpu-mes
+cp crt1.s $mes_cpu-mes
+
+objects=
+for c in $libc_mini_SOURCES; do
+    echo "CC         $c"
+    $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
+    o=$(basename $c .c).o
+    objects="$objects $o"
+done
+echo "AR         $mes_cpu-mes/libc-mini.a"
+$AR crD $mes_cpu-mes/libc-mini.a $objects
+
+objects=
+for c in $libc_SOURCES; do
+    echo "CC         $c"
+    $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
+    o=$(basename $c .c).o
+    objects="$objects $o"
+done
+echo "AR         $mes_cpu-mes/libc.a"
+$AR crD $mes_cpu-mes/libc.a $objects
+
+objects=
+for c in $libc_tcc_SOURCES; do
+    echo "CC         $c"
+    $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
+    o=$(basename $c .c).o
+    objects="$objects $o"
+done
+echo "AR         $mes_cpu-mes/libc+tcc.a"
+$AR crD $mes_cpu-mes/libc+tcc.a $objects
+
+cd ..
+srcdest=
+CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
+
+objects=
+for c in $mes_SOURCES; do
+    echo "CC         $c"
+    $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
+    o=$(basename $c .c).o
+    objects="$objects $o"
+done
+echo "CCLD       src/mes"
+$CC -nostdlib -o src/mes -L mescc-lib mescc-lib/crt1.o $objects -lc
index db10233640a703e701e1640c7a551461e02e7ad5..b70902aa1148e95854b918cfc726d2cf0e9f1a03 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
 
-set -e
-set -u
-
-V=${V-1}
-
-if [ "$V" = 2 ]; then
-    set -x
-fi
-
-. ./config.sh
+srcdest=${srcdest-}
+. ${srcdest}build-aux/configure-lib.sh
 . ${srcdest}build-aux/trace.sh
 . ${srcdest}build-aux/cc.sh
 
 trap 'test -f .log && cat .log' EXIT
 
-srcdest=${srcdest-}
-
-libc_mini_SOURCES="
-lib/mes/eputs.c
-lib/mes/oputs.c
-"
-
-if test $mes_libc = mes; then
-    libc_mini_SOURCES="$libc_mini_SOURCES
-lib/posix/write.c
-lib/string/strlen.c
-lib/stdlib/puts.c
-lib/stdlib/exit.c
-lib/$mes_kernel/$mes_cpu-mes-$compiler/mini.c
-"
-fi
-
-libmes_SOURCES="
-$libc_mini_SOURCES
-lib/ctype/isnumber.c
-lib/mes/abtol.c
-lib/mes/itoa.c
-lib/mes/ltoa.c
-lib/mes/ltoab.c
-lib/mes/ultoa.c
-lib/mes/utoa.c
-lib/mes/eputc.c
-lib/mes/fdgetc.c
-lib/mes/fdputc.c
-lib/mes/fdputs.c
-lib/mes/fdungetc.c
-lib/mes/mes_open.c
-lib/mes/ntoab.c
-lib/mes/oputc.c
-"
-
-if test $mes_libc = mes; then
-    libmes_SOURCES="$libmes_SOURCES
-lib/stdlib/atoi.c
-lib/ctype/isdigit.c
-lib/ctype/isspace.c
-lib/ctype/isxdigit.c
-"
-else
-    libmes_SOURCES="$libmes_SOURCES
-"
-fi
-
-libc_SOURCES="
-$libmes_SOURCES
-lib/mes/__assert_fail.c
-lib/mes/__mes_debug.c
-lib/posix/execv.c
-lib/posix/getcwd.c
-lib/posix/getenv.c
-lib/posix/isatty.c
-lib/posix/read.c
-lib/posix/open.c
-lib/posix/setenv.c
-lib/posix/wait.c
-lib/stdio/fgetc.c
-lib/stdio/fputc.c
-lib/stdio/fputs.c
-lib/stdio/getc.c
-lib/stdio/getchar.c
-lib/stdio/putc.c
-lib/stdio/putchar.c
-lib/stdio/ungetc.c
-lib/stdlib/free.c
-lib/stdlib/malloc.c
-lib/stdlib/realloc.c
-lib/string/memchr.c
-lib/string/memcmp.c
-lib/string/memcpy.c
-lib/string/memset.c
-lib/string/strcmp.c
-lib/string/strcpy.c
-lib/string/strncmp.c
-"
-
-if test $mes_kernel = linux; then
-    libc_SOURCES="$libc_SOURCES
-lib/linux/access.c
-lib/linux/brk.c
-lib/linux/chmod.c
-lib/linux/clock_gettime.c
-lib/linux/dup.c
-lib/linux/dup2.c
-lib/linux/execve.c
-lib/linux/fork.c
-lib/linux/fsync.c
-lib/linux/_getcwd.c
-lib/linux/gettimeofday.c
-lib/linux/ioctl.c
-lib/linux/_open3.c
-lib/linux/_read.c
-lib/linux/time.c
-lib/linux/unlink.c
-lib/linux/waitpid.c
-lib/linux/$mes_cpu-mes-$compiler/syscall.c
-"
-fi
-
-libtcc1_SOURCES="
-lib/libtcc1.c
-"
-
-libc_tcc_SOURCES="
-$libc_SOURCES
-lib/ctype/islower.c
-lib/ctype/isupper.c
-lib/ctype/tolower.c
-lib/ctype/toupper.c
-lib/mes/search-path.c
-lib/posix/execvp.c
-lib/stdio/fclose.c
-lib/stdio/fdopen.c
-lib/stdio/ferror.c
-lib/stdio/fflush.c
-lib/stdio/fopen.c
-lib/stdio/fprintf.c
-lib/stdio/fread.c
-lib/stdio/fseek.c
-lib/stdio/ftell.c
-lib/stdio/fwrite.c
-lib/stdio/printf.c
-lib/stdio/remove.c
-lib/stdio/snprintf.c
-lib/stdio/sprintf.c
-lib/stdio/sscanf.c
-lib/stdio/vfprintf.c
-lib/stdio/vprintf.c
-lib/stdio/vsnprintf.c
-lib/stdio/vsprintf.c
-lib/stdio/vsscanf.c
-lib/stdlib/calloc.c
-lib/stdlib/qsort.c
-lib/stdlib/strtof.c
-lib/stdlib/strtol.c
-lib/stdlib/strtold.c
-lib/stdlib/strtoll.c
-lib/stdlib/strtoul.c
-lib/stdlib/strtoull.c
-lib/string/memmem.c
-lib/string/memmove.c
-lib/string/strcat.c
-lib/string/strchr.c
-lib/string/strlwr.c
-lib/string/strncpy.c
-lib/string/strrchr.c
-lib/string/strstr.c
-lib/string/strupr.c
-lib/stub/sigaction.c
-lib/stub/ldexp.c
-lib/stub/mprotect.c
-lib/stub/localtime.c
-lib/stub/sigemptyset.c
-lib/stub/strtod.c
-lib/$mes_cpu-mes-$compiler/setjmp.c
-"
-
-if test $mes_kernel = linux; then
-    libc_tcc_SOURCES="$libc_tcc_SOURCES
-lib/linux/close.c
-lib/linux/lseek.c
-lib/linux/rmdir.c
-lib/linux/stat.c
-"
-fi
-
-libc_gnu_SOURCES="
-$libc_tcc_SOURCES
-lib/ctype/isalnum.c
-lib/ctype/isalpha.c
-lib/ctype/isascii.c
-lib/ctype/iscntrl.c
-lib/ctype/isprint.c
-lib/ctype/ispunct.c
-lib/dirent/__getdirentries.c
-lib/dirent/closedir.c
-lib/dirent/opendir.c
-lib/dirent/readdir.c
-lib/math/fabs.c
-lib/mes/fdgets.c
-lib/posix/alarm.c
-lib/posix/execl.c
-lib/posix/mktemp.c
-lib/posix/raise.c
-lib/posix/sbrk.c
-lib/posix/sleep.c
-lib/posix/unsetenv.c
-lib/stdio/clearerr.c
-lib/stdio/feof.c
-lib/stdio/fgets.c
-lib/stdio/fileno.c
-lib/stdio/freopen.c
-lib/stdio/perror.c
-lib/stdlib/__exit.c
-lib/stdlib/abort.c
-lib/stdlib/abs.c
-lib/stdlib/alloca.c
-lib/stdlib/atexit.c
-lib/stdlib/atol.c
-lib/stdlib/mbstowcs.c
-lib/string/bcmp.c
-lib/string/bcopy.c
-lib/string/bzero.c
-lib/string/index.c
-lib/string/rindex.c
-lib/string/strcspn.c
-lib/string/strdup.c
-lib/string/strerror.c
-lib/string/strncat.c
-lib/string/strpbrk.c
-lib/string/strspn.c
-lib/stub/__cleanup.c
-lib/stub/bsearch.c
-lib/stub/chown.c
-lib/stub/ctime.c
-lib/stub/fpurge.c
-lib/stub/freadahead.c
-lib/stub/frexp.c
-lib/stub/getlogin.c
-lib/stub/getpwnam.c
-lib/stub/getpwuid.c
-lib/stub/gmtime.c
-lib/stub/pclose.c
-lib/stub/popen.c
-lib/stub/rand.c
-lib/stub/setbuf.c
-lib/stub/setlocale.c
-lib/stub/setvbuf.c
-lib/stub/sigaddset.c
-lib/stub/sigblock.c
-lib/stub/sigdelset.c
-lib/stub/sigsetmask.c
-lib/stub/strftime.c
-lib/stub/sys_siglist.c
-lib/stub/system.c
-lib/stub/times.c
-lib/stub/ttyname.c
-lib/stub/umask.c
-lib/stub/utime.c
-"
-
-if test $mes_kernel = linux; then
-    libc_gnu_SOURCES="$libc_gnu_SOURCES
-lib/linux/chdir.c
-lib/linux/fcntl.c
-lib/linux/fstat.c
-lib/linux/getdents.c
-lib/linux/getegid.c
-lib/linux/geteuid.c
-lib/linux/getgid.c
-lib/linux/getpid.c
-lib/linux/getppid.c
-lib/linux/getrusage.c
-lib/linux/getuid.c
-lib/linux/kill.c
-lib/linux/link.c
-lib/linux/lstat.c
-lib/linux/mkdir.c
-lib/linux/nanosleep.c
-lib/linux/pipe.c
-lib/linux/rename.c
-lib/linux/setgid.c
-lib/linux/settimer.c
-lib/linux/setuid.c
-lib/linux/signal.c
-lib/linux/sigprogmask.c
-"
-fi
-
 mkdir -p $mes_cpu-mes
 compile lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
 cp crt1.o $mes_cpu-mes
index f6d9b6968ce3f7a2841004662ddfc626e1ff0010..4eca931453deaff2e532f3445e14ed9e5f2138b4 100755 (executable)
@@ -190,6 +190,10 @@ lib/tests/scaffold/82-define.c
 lib/tests/scaffold/83-heterogenoous-init.c
 lib/tests/scaffold/84-struct-field-list.c
 lib/tests/scaffold/85-sizeof.c
+"
+
+if test -z "$bootstrap"; then
+    TESTS="$TESTS
 lib/tests/dirent/90-readdir.c
 lib/tests/io/90-stat.c
 lib/tests/posix/90-unsetenv.c
@@ -211,6 +215,7 @@ lib/tests/scaffold/a0-math-divide-signed-negative.c
 lib/tests/scaffold/a1-global-no-align.c
 lib/tests/scaffold/a1-global-no-clobber.c
 "
+fi
 
 XFAIL_TESTS="
 lib/tests/stdio/90-sprintf.c
index 54d23bd300c88ef1b07d2c981f09987be8b5f205..a511daa202eada70e06abe603bb09901742795ad 100644 (file)
@@ -53,6 +53,7 @@ arch:=@arch@
 build:=@build@
 host:=@host@
 
+bootstrap:=
 compiler:=@compiler@
 courageous:=@courageous@
 mes_system:=@mes_system@
index e6e8d241c2cf4f51bbfd61d21218ff9e80da9530..0b2bd82203715c67db1b40b142ffc0e07e16d38b 100644 (file)
@@ -53,6 +53,7 @@ arch="@arch@"
 build="@build@"
 host="@host@"
 
+bootstrap=${bootstrap-}
 compiler=${compiler-@compiler@}
 courageous=${courageous-@courageous@}
 mes_system=@mes_system@
diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh
new file mode 100644 (file)
index 0000000..86d15b2
--- /dev/null
@@ -0,0 +1,315 @@
+#! /bin/sh
+
+# GNU Mes --- Maxwell Equations of Software
+# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+#
+# This file is part of GNU Mes.
+#
+# GNU Mes 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.
+#
+# GNU Mes 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 GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+set -u
+
+V=${V-1}
+
+if [ "$V" = 2 ]; then
+    set -x
+fi
+
+. ./config.sh
+
+libc_mini_SOURCES="
+lib/mes/eputs.c
+lib/mes/oputs.c
+"
+
+if test $mes_libc = mes; then
+    libc_mini_SOURCES="$libc_mini_SOURCES
+lib/posix/write.c
+lib/string/strlen.c
+lib/stdlib/puts.c
+lib/stdlib/exit.c
+lib/$mes_kernel/$mes_cpu-mes-$compiler/mini.c
+"
+fi
+
+libmes_SOURCES="
+$libc_mini_SOURCES
+lib/ctype/isnumber.c
+lib/mes/abtol.c
+lib/mes/itoa.c
+lib/mes/ltoa.c
+lib/mes/ltoab.c
+lib/mes/ultoa.c
+lib/mes/utoa.c
+lib/mes/eputc.c
+lib/mes/fdgetc.c
+lib/mes/fdputc.c
+lib/mes/fdputs.c
+lib/mes/fdungetc.c
+lib/mes/mes_open.c
+lib/mes/ntoab.c
+lib/mes/oputc.c
+"
+
+if test $mes_libc = mes; then
+    libmes_SOURCES="$libmes_SOURCES
+lib/stdlib/atoi.c
+lib/ctype/isdigit.c
+lib/ctype/isspace.c
+lib/ctype/isxdigit.c
+"
+else
+    libmes_SOURCES="$libmes_SOURCES
+"
+fi
+
+libc_SOURCES="
+$libmes_SOURCES
+lib/mes/__assert_fail.c
+lib/mes/__mes_debug.c
+lib/posix/execv.c
+lib/posix/getcwd.c
+lib/posix/getenv.c
+lib/posix/isatty.c
+lib/posix/open.c
+lib/posix/read.c
+lib/posix/setenv.c
+lib/posix/wait.c
+lib/stdio/fgetc.c
+lib/stdio/fputc.c
+lib/stdio/fputs.c
+lib/stdio/getc.c
+lib/stdio/getchar.c
+lib/stdio/putc.c
+lib/stdio/putchar.c
+lib/stdio/ungetc.c
+lib/stdlib/free.c
+lib/stdlib/malloc.c
+lib/stdlib/realloc.c
+lib/string/memchr.c
+lib/string/memcmp.c
+lib/string/memcpy.c
+lib/string/memset.c
+lib/string/strcmp.c
+lib/string/strcpy.c
+lib/string/strncmp.c
+"
+
+if test $mes_kernel = linux; then
+    libc_SOURCES="$libc_SOURCES
+lib/linux/access.c
+lib/linux/brk.c
+lib/linux/chmod.c
+lib/linux/clock_gettime.c
+lib/linux/dup.c
+lib/linux/dup2.c
+lib/linux/execve.c
+lib/linux/fork.c
+lib/linux/fsync.c
+lib/linux/_getcwd.c
+lib/linux/gettimeofday.c
+lib/linux/ioctl.c
+lib/linux/_open3.c
+lib/linux/_read.c
+lib/linux/time.c
+lib/linux/unlink.c
+lib/linux/waitpid.c
+lib/linux/$mes_cpu-mes-$compiler/syscall.c
+"
+fi
+
+libtcc1_SOURCES="
+lib/libtcc1.c
+"
+
+libc_tcc_SOURCES="
+$libc_SOURCES
+lib/ctype/islower.c
+lib/ctype/isupper.c
+lib/ctype/tolower.c
+lib/ctype/toupper.c
+lib/mes/search-path.c
+lib/posix/execvp.c
+lib/stdio/fclose.c
+lib/stdio/fdopen.c
+lib/stdio/ferror.c
+lib/stdio/fflush.c
+lib/stdio/fopen.c
+lib/stdio/fprintf.c
+lib/stdio/fread.c
+lib/stdio/fseek.c
+lib/stdio/ftell.c
+lib/stdio/fwrite.c
+lib/stdio/printf.c
+lib/stdio/remove.c
+lib/stdio/snprintf.c
+lib/stdio/sprintf.c
+lib/stdio/sscanf.c
+lib/stdio/vfprintf.c
+lib/stdio/vprintf.c
+lib/stdio/vsnprintf.c
+lib/stdio/vsprintf.c
+lib/stdio/vsscanf.c
+lib/stdlib/calloc.c
+lib/stdlib/qsort.c
+lib/stdlib/strtof.c
+lib/stdlib/strtol.c
+lib/stdlib/strtold.c
+lib/stdlib/strtoll.c
+lib/stdlib/strtoul.c
+lib/stdlib/strtoull.c
+lib/string/memmem.c
+lib/string/memmove.c
+lib/string/strcat.c
+lib/string/strchr.c
+lib/string/strlwr.c
+lib/string/strncpy.c
+lib/string/strrchr.c
+lib/string/strstr.c
+lib/string/strupr.c
+lib/stub/sigaction.c
+lib/stub/ldexp.c
+lib/stub/mprotect.c
+lib/stub/localtime.c
+lib/stub/sigemptyset.c
+lib/stub/strtod.c
+lib/$mes_cpu-mes-$compiler/setjmp.c
+"
+
+if test $mes_kernel = linux; then
+    libc_tcc_SOURCES="$libc_tcc_SOURCES
+lib/linux/close.c
+lib/linux/lseek.c
+lib/linux/rmdir.c
+lib/linux/stat.c
+"
+fi
+
+libc_gnu_SOURCES="
+$libc_tcc_SOURCES
+lib/ctype/isalnum.c
+lib/ctype/isalpha.c
+lib/ctype/isascii.c
+lib/ctype/iscntrl.c
+lib/ctype/isprint.c
+lib/ctype/ispunct.c
+lib/dirent/__getdirentries.c
+lib/dirent/closedir.c
+lib/dirent/opendir.c
+lib/dirent/readdir.c
+lib/math/fabs.c
+lib/mes/fdgets.c
+lib/posix/alarm.c
+lib/posix/execl.c
+lib/posix/mktemp.c
+lib/posix/raise.c
+lib/posix/sbrk.c
+lib/posix/sleep.c
+lib/posix/unsetenv.c
+lib/stdio/clearerr.c
+lib/stdio/feof.c
+lib/stdio/fgets.c
+lib/stdio/fileno.c
+lib/stdio/freopen.c
+lib/stdio/perror.c
+lib/stdlib/__exit.c
+lib/stdlib/abort.c
+lib/stdlib/abs.c
+lib/stdlib/alloca.c
+lib/stdlib/atexit.c
+lib/stdlib/atol.c
+lib/stdlib/mbstowcs.c
+lib/string/bcmp.c
+lib/string/bcopy.c
+lib/string/bzero.c
+lib/string/index.c
+lib/string/rindex.c
+lib/string/strcspn.c
+lib/string/strdup.c
+lib/string/strerror.c
+lib/string/strncat.c
+lib/string/strpbrk.c
+lib/string/strspn.c
+lib/stub/__cleanup.c
+lib/stub/bsearch.c
+lib/stub/chown.c
+lib/stub/ctime.c
+lib/stub/fpurge.c
+lib/stub/freadahead.c
+lib/stub/frexp.c
+lib/stub/getlogin.c
+lib/stub/getpwnam.c
+lib/stub/getpwuid.c
+lib/stub/gmtime.c
+lib/stub/pclose.c
+lib/stub/popen.c
+lib/stub/rand.c
+lib/stub/setbuf.c
+lib/stub/setlocale.c
+lib/stub/setvbuf.c
+lib/stub/sigaddset.c
+lib/stub/sigblock.c
+lib/stub/sigdelset.c
+lib/stub/sigsetmask.c
+lib/stub/strftime.c
+lib/stub/sys_siglist.c
+lib/stub/system.c
+lib/stub/times.c
+lib/stub/ttyname.c
+lib/stub/umask.c
+lib/stub/utime.c
+"
+
+if test $mes_kernel = linux; then
+    libc_gnu_SOURCES="$libc_gnu_SOURCES
+lib/linux/chdir.c
+lib/linux/fcntl.c
+lib/linux/fstat.c
+lib/linux/getdents.c
+lib/linux/getegid.c
+lib/linux/geteuid.c
+lib/linux/getgid.c
+lib/linux/getpid.c
+lib/linux/getppid.c
+lib/linux/getrusage.c
+lib/linux/getuid.c
+lib/linux/kill.c
+lib/linux/link.c
+lib/linux/lstat.c
+lib/linux/mkdir.c
+lib/linux/nanosleep.c
+lib/linux/pipe.c
+lib/linux/rename.c
+lib/linux/setgid.c
+lib/linux/settimer.c
+lib/linux/setuid.c
+lib/linux/signal.c
+lib/linux/sigprogmask.c
+"
+fi
+
+mes_SOURCES="
+src/gc.c
+src/hash.c
+src/lib.c
+src/math.c
+src/mes.c
+src/module.c
+src/posix.c
+src/reader.c
+src/string.c
+src/struct.c
+src/vector.c
+"
index 5881452461847c91d34f36a310a4b0239804ef88..ed4394bea3ec2e632b572947d3c826bebfa9b9b4 100644 (file)
@@ -42,6 +42,7 @@ export mandir
 export moduledir
 export sysconfdir
 
+export bootstrap
 export compiler
 export courageous
 export mes_system
index 67013db0b2c0f1582bf780a3b909d18fcc3758a7..cf25f71b90fc28149aa100751511e93590e20e15 100755 (executable)
@@ -49,7 +49,6 @@ if test "$p" != "$cmdline"; then
     p=${p% *}
     p=${p% -*}
     prefix=${p-/usr/local}
-
 else
     prefix=${prefix-/usr/local}
 fi
@@ -72,8 +71,7 @@ if [ "$p" != "$cmdline" ]; then
     p=${p% *}
     p=${p% -*}
     host=${p-$build}
-
-else
+elif test -n "$build"; then
     host=${host-$build}
 fi
 
@@ -130,13 +128,13 @@ docdir=$(eval echo ${docdir-$datadir/doc/mes-$VERSION})
 infodir=$(eval echo ${infodir-$datadir/info})
 includedir=$(eval echo ${libdir-$prefix/include})
 libdir=$(eval echo ${libdir-$prefix/lib})
+pkgdatadir=$(eval echo ${pkgdatadir-$datadir/mes})
 mandir=$(eval echo ${mandir-$datadir/man})
-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})
 
 subst () {
+    echo "creating $2"
     sed \
     -e s,"@PACKAGE@,$PACKAGE,"\
     -e s,"@PACKAGE_NAME@,$PACKAGE_NAME,"\
@@ -167,7 +165,7 @@ subst () {
     -e s,"@includedir@,$includedir,"\
     -e s,"@libdir@,$libdir,"\
     -e s,"@mandir@,$mandir,"\
-    -e s,"@moduledir@,$moduledir,"\
+    -e s,"@pkgdatadir@,$pkgdatadir,"\
     -e s,"@sysconfdir@,$sysconfdir,"\
     -e s,"@GUILE_EFFECTIVE_VERSION@,$GUILE_EFFECTIVE_VERSION,"\
     -e s,"@V@,$V,"\
@@ -189,7 +187,6 @@ subst () {
     -e s,"@MES_SEED@,$MES_SEED,"\
     -e s,"@MES_SEED@,$MES_SEED,"\
     -e s,"@SHELL@,$SHELL,"\
-    -e s,"mes/module/,$moduledir/,"\
     $1 > $2
 }
 
@@ -209,6 +206,9 @@ if test "$mes_cpu" = armv4\
         || test "$arch" = armv7l; then
     mes_cpu=arm
 fi
+if test "$mes_cpu" = amd64; then
+    mes_cpu=x86_64
+fi
 
 case "$host" in
     *linux-gnu|*linux)
@@ -238,6 +238,8 @@ mes_system=$mes_cpu-$mes_kernel-mes
 
 subst ${srcdest}build-aux/GNUmakefile.in GNUmakefile
 subst ${srcdest}build-aux/config.sh.in config.sh
+subst ${srcdest}build-aux/bootstrap.sh.in bootstrap.sh
+chmod +x bootstrap.sh
 subst ${srcdest}build-aux/build.sh.in build.sh
 chmod +x build.sh
 subst ${srcdest}build-aux/check.sh.in check.sh
@@ -256,6 +258,7 @@ subst ${srcdest}build-aux/uninstall.sh.in uninstall.sh
 chmod +x uninstall.sh
 
 mkdir -p include/mes
+rm -f include/mes/config.h
 if test $mes_libc = system; then
     cat >> include/mes/config.h <<EOF
 #define SYSTEM_LIBC 1
@@ -266,9 +269,8 @@ else
 EOF
 fi
 cat >> include/mes/config.h <<EOF
-#define VERSION '"'$VERSION'"'
-#define pkgdatadir "'"$pkgdatadir'"'
-
+#define VERSION "$VERSION"
+#define pkgdatadir "$pkgdatadir"
 EOF
 
 cat <<EOF
index 39dd3bf9ae54e359bf1a99d6b0d0223387e0c65c..0efdadd3ef1b8fe67f9769ecf43c6f2eec7a42a4 100644 (file)
@@ -18,6 +18,7 @@
  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <mes/lib.h>
 #include <limits.h>
 #include <sys/types.h>
 
index 6740c823337a3250c08b0faf3557c6fc684d8893..979db503e1aaf95612fb9cec5cd3e2c23368a873 100644 (file)
@@ -32,5 +32,6 @@ for o in "$@"; do
     ((i++))
     M1_objects[$i]=$(dirname "$o")/$(basename "$o" .o).s
 done
+mkdir -p $(dirname "$archive")
 cat "${M1_objects[@]}" > "$M1_archive"
 cat "$@" > "$archive"