From 7cbe2b11526852a2d2ffe5162a7f1e7ee6fd6562 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 29 Oct 2022 17:37:08 +0200 Subject: [PATCH] squash! stat * configure (main): Copy include///*.h to include/. * configure.sh: Likewise. * .gitignore: Ignore them. Add copyright header. * build-aux/bootstrap.sh.in (AM_CPPFLAGS): Replace include// with built ../include. * build-aux/build.sh.in (AM_CPPFLAGS): Likewise. * build-aux/install.sh.in: Also install built include. --- .gitignore | 20 ++++++++++++++++++++ build-aux/bootstrap.sh.in | 4 ++-- build-aux/build.sh.in | 11 +++++------ build-aux/install.sh.in | 3 ++- configure | 7 +++++++ configure.sh | 4 ++++ include/linux/arm/kernel-stat.h | 2 +- include/linux/x86/kernel-stat.h | 2 +- lib/linux/stat.c | 5 ----- 9 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 58cb2afb..e2397096 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,21 @@ +# GNU Mes --- Maxwell Equations of Software +# Copyright © 2016,2017,2019,2020,2022 Jan (janneke) Nieuwenhuizen +# +# 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 . + *- *~ .#* @@ -117,7 +135,9 @@ /doc/images/gcc-mesboot-graph.pdf /doc/web/ /config.sh +/include/kernel-stat.h /include/mes/config.h +/include/syscall.h /gcc-lib /mescc-lib /bin diff --git a/build-aux/bootstrap.sh.in b/build-aux/bootstrap.sh.in index 1457b907..53524b3a 100644 --- a/build-aux/bootstrap.sh.in +++ b/build-aux/bootstrap.sh.in @@ -50,7 +50,7 @@ srcdest=../${srcdest} ln -sf ${srcdest}mes . ln -sf ${srcdest}module . 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" mkdir -p $mes_cpu-mes @@ -113,7 +113,7 @@ $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" +AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include" AM_CFLAGS="-L ${srcdest}lib" objects= diff --git a/build-aux/build.sh.in b/build-aux/build.sh.in index bbde993c..b8900b1b 100644 --- a/build-aux/build.sh.in +++ b/build-aux/build.sh.in @@ -66,9 +66,8 @@ fi AM_CPPFLAGS=" -D HAVE_CONFIG_H=1 -I ${srcdest}lib --I include -I ${srcdest}include --I ${srcdest}include/$mes_kernel/$mes_cpu +-I ../include " if test $mes_kernel = gnu; then AM_CPPFLAGS="$AM_CPPFLAGS @@ -93,9 +92,9 @@ fi AM_CPPFLAGS=" -D HAVE_CONFIG_H=1 -I ${srcdest}lib --I include -I ${srcdest}include --I ${srcdest}include/$mes_kernel/$mes_cpu +-I ../include +-I include " if test "$compiler" != bootstrap; then ${SHELL} ${srcdest}build-aux/build-mes.sh @@ -137,9 +136,9 @@ fi AM_CPPFLAGS=" -D HAVE_CONFIG_H=1 -I ${srcdest}lib --I include -I ${srcdest}include --I ${srcdest}include/$mes_kernel/$mes_cpu +-I ../include +-I include " compiler=mescc AR=${MESAR-"${srcdest}pre-inst-env mesar"} diff --git a/build-aux/install.sh.in b/build-aux/install.sh.in index 340faf5f..f3a69229 100644 --- a/build-aux/install.sh.in +++ b/build-aux/install.sh.in @@ -1,7 +1,7 @@ #! @SHELL@ # GNU Mes --- Maxwell Equations of Software -# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen +# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen # # This file is part of GNU Mes. # @@ -99,6 +99,7 @@ mkdir -p $DESTDIR$includedir mkdir -p $DESTDIR$libdir mkdir -p $DESTDIR$pkgdatadir 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_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir if test -z "$srcdest"; then diff --git a/configure b/configure index b02e75bf..f535abab 100755 --- a/configure +++ b/configure @@ -707,6 +707,13 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system) #define MES_VERSION \"" VERSION "\" "))))) (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))) (display (string-append " diff --git a/configure.sh b/configure.sh index 51d99b6f..fdc4dff7 100755 --- a/configure.sh +++ b/configure.sh @@ -271,6 +271,10 @@ cat >> include/mes/config.h < #include -#if (__i386__ || __arm__) && SYS_stat64 && HAVE_LONG_LONG -#undef SYS_stat -#define SYS_stat SYS_stat64 -#endif - int stat (char const *file_name, struct stat *statbuf) {