squash! stat

* configure (main): Copy <srcdest>include/<kernel>/<arch>/*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them.  Add copyright header.
* build-aux/bootstrap.sh.in (AM_CPPFLAGS): Replace
<srcdest>include/<kernel>/<cpu> with built ../include.
* build-aux/build.sh.in (AM_CPPFLAGS): Likewise.
* build-aux/install.sh.in: Also install built include.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-10-29 17:37:08 +02:00
parent cb49899215
commit 7cbe2b1152
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
9 changed files with 42 additions and 16 deletions

20
.gitignore vendored
View File

@ -1,3 +1,21 @@
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2016,2017,2019,2020,2022 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/>.
*- *-
*~ *~
.#* .#*
@ -117,7 +135,9 @@
/doc/images/gcc-mesboot-graph.pdf /doc/images/gcc-mesboot-graph.pdf
/doc/web/ /doc/web/
/config.sh /config.sh
/include/kernel-stat.h
/include/mes/config.h /include/mes/config.h
/include/syscall.h
/gcc-lib /gcc-lib
/mescc-lib /mescc-lib
/bin /bin

View File

@ -50,7 +50,7 @@ srcdest=../${srcdest}
ln -sf ${srcdest}mes . ln -sf ${srcdest}mes .
ln -sf ${srcdest}module . ln -sf ${srcdest}module .
ln -sf ${srcdest}src . ln -sf ${srcdest}src .
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu" AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
AM_CFLAGS="-L ${srcdest}lib" AM_CFLAGS="-L ${srcdest}lib"
mkdir -p $mes_cpu-mes mkdir -p $mes_cpu-mes
@ -113,7 +113,7 @@ $AR crD $mes_cpu-mes/libc+tcc.a $objects
cd .. cd ..
srcdest= srcdest=
CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu" AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
AM_CFLAGS="-L ${srcdest}lib" AM_CFLAGS="-L ${srcdest}lib"
objects= objects=

View File

@ -66,9 +66,8 @@ fi
AM_CPPFLAGS=" AM_CPPFLAGS="
-D HAVE_CONFIG_H=1 -D HAVE_CONFIG_H=1
-I ${srcdest}lib -I ${srcdest}lib
-I include
-I ${srcdest}include -I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu -I ../include
" "
if test $mes_kernel = gnu; then if test $mes_kernel = gnu; then
AM_CPPFLAGS="$AM_CPPFLAGS AM_CPPFLAGS="$AM_CPPFLAGS
@ -93,9 +92,9 @@ fi
AM_CPPFLAGS=" AM_CPPFLAGS="
-D HAVE_CONFIG_H=1 -D HAVE_CONFIG_H=1
-I ${srcdest}lib -I ${srcdest}lib
-I include
-I ${srcdest}include -I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu -I ../include
-I include
" "
if test "$compiler" != bootstrap; then if test "$compiler" != bootstrap; then
${SHELL} ${srcdest}build-aux/build-mes.sh ${SHELL} ${srcdest}build-aux/build-mes.sh
@ -137,9 +136,9 @@ fi
AM_CPPFLAGS=" AM_CPPFLAGS="
-D HAVE_CONFIG_H=1 -D HAVE_CONFIG_H=1
-I ${srcdest}lib -I ${srcdest}lib
-I include
-I ${srcdest}include -I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu -I ../include
-I include
" "
compiler=mescc compiler=mescc
AR=${MESAR-"${srcdest}pre-inst-env mesar"} AR=${MESAR-"${srcdest}pre-inst-env mesar"}

View File

@ -1,7 +1,7 @@
#! @SHELL@ #! @SHELL@
# GNU Mes --- Maxwell Equations of Software # GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> # Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Mes. # This file is part of GNU Mes.
# #
@ -99,6 +99,7 @@ mkdir -p $DESTDIR$includedir
mkdir -p $DESTDIR$libdir mkdir -p $DESTDIR$libdir
mkdir -p $DESTDIR$pkgdatadir mkdir -p $DESTDIR$pkgdatadir
tar -cf- -C ${srcdir}/include . | tar -${v}xf- -C $DESTDIR$includedir tar -cf- -C ${srcdir}/include . | tar -${v}xf- -C $DESTDIR$includedir
tar -cf- -C include . | tar -${v}xf- -C $DESTDIR$includedir
tar -cf- -C ${srcdir}/lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir tar -cf- -C ${srcdir}/lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
tar -cf- -C ${srcdir}/lib $mes_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir tar -cf- -C ${srcdir}/lib $mes_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
if test -z "$srcdest"; then if test -z "$srcdest"; then

7
configure vendored
View File

@ -707,6 +707,13 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
#define MES_VERSION \"" VERSION "\" #define MES_VERSION \"" VERSION "\"
"))))) ")))))
(substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make")) (substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make"))
(let ((arch-dir (string-append srcdest "include/" mes-kernel "/" mes-cpu)))
(define (copy-header file-name)
(system* "cp" "-f" "-v"
(string-append arch-dir "/" file-name)
(string-append "include/" file-name)))
(system* "mkdir" "-p" "include")
(for-each copy-header '("kernel-stat.h" "syscall.h")))
(let ((make (and=> (file-name "make" deps) basename))) (let ((make (and=> (file-name "make" deps) basename)))
(display (string-append " (display (string-append "

View File

@ -271,6 +271,10 @@ cat >> include/mes/config.h <<EOF
#define MES_VERSION "$VERSION" #define MES_VERSION "$VERSION"
EOF EOF
mkdir -p include
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/kernel-stat.h include
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/syscall.h include
cat <<EOF cat <<EOF
GNU Mes is configured for GNU Mes is configured for
compiler: $compiler compiler: $compiler

View File

@ -46,7 +46,7 @@ struct stat
unsigned long __pad0; unsigned long __pad0;
unsigned long __pad1; unsigned long __pad1;
}; };
#if HAVE_LONG_LONG #if __SIZEOF_LONG_LONG__ == 8
struct stat64 struct stat64
{ {
unsigned long long st_dev; unsigned long long st_dev;

View File

@ -46,7 +46,7 @@ struct stat
unsigned long __pad0; unsigned long __pad0;
unsigned long __pad1; unsigned long __pad1;
}; };
#if HAVE_LONG_LONG #if __SIZEOF_LONG_LONG__ == 8
struct stat64 struct stat64
{ {
unsigned long long st_dev; unsigned long long st_dev;

View File

@ -22,11 +22,6 @@
#include <syscall.h> #include <syscall.h>
#include <sys/stat.h> #include <sys/stat.h>
#if (__i386__ || __arm__) && SYS_stat64 && HAVE_LONG_LONG
#undef SYS_stat
#define SYS_stat SYS_stat64
#endif
int int
stat (char const *file_name, struct stat *statbuf) stat (char const *file_name, struct stat *statbuf)
{ {