2019-06-08 13:36:22 +00:00
|
|
|
#! @SHELL@
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2018-07-23 17:10:34 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
lib: stat: Use SYS_stat64 for 32bit platforms.
This fixes <https://debbugs.gnu.org/41264>.
* include/linux/arm/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/linux/x86/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/sys/stat.h (struct stat): Move definition to...
* include/linux/arm/kernel-stat.h,
include/linux/m2/kernel-stat.h,
include/linux/x86/kernel-stat.h,
include/linux/x86_64/kernel-stat.h: These new files.
* include/gnu/x86/kernel-stat.h: New file.
* configure (main): Copy <srcdest>include/<kernel>/<arch>/*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them. Add copyright header.
* build-aux/GNUmakefile.in (X86_ARCH_HEADERS, ARCH_HEADERS): New
variables.
(build): Use them.
(include/arch/%.h, arch-dir): New targets.
* 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.
* include/m2/types.h: New file.
* kaem.run: Use it.
* simple.sh: Copy kernel-stat.h, syscall.h for kernel/cpu to
include/arch.
2022-10-29 11:17:58 +00:00
|
|
|
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-07-23 17:10:34 +00:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
|
2017-11-24 18:02:58 +00:00
|
|
|
set -e
|
2018-07-21 22:43:39 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
. ./config.sh
|
2018-07-25 06:14:13 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
v=
|
|
|
|
_v=
|
|
|
|
if test "$V" = 2; then
|
|
|
|
set -x
|
|
|
|
fi
|
2019-10-15 18:18:31 +00:00
|
|
|
if test -n "$V"; then
|
|
|
|
if test "$V" -gt 0; then
|
|
|
|
v=v
|
|
|
|
_v=-v
|
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -u
|
2018-06-28 21:10:14 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
# Use bash or lose if pipes fail
|
|
|
|
if test -n "$BASHOPTS"; then
|
2018-11-24 20:07:31 +00:00
|
|
|
set -o pipefail
|
2018-07-21 22:43:39 +00:00
|
|
|
fi
|
2018-11-24 20:07:31 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
DESTDIR=${DESTDIR-}
|
|
|
|
mkdir -p ${DESTDIR}${bindir}
|
2019-11-03 21:15:11 +00:00
|
|
|
cp $_v bin/mes ${DESTDIR}${bindir}/mes
|
|
|
|
if test -f bin/mes-gcc; then
|
|
|
|
cp $_v bin/mes-gcc ${DESTDIR}${bindir}/mes-gcc
|
|
|
|
fi
|
2020-10-18 21:15:11 +00:00
|
|
|
if test -f bin/mes-m2; then
|
|
|
|
cp $_v bin/mes-m2 ${DESTDIR}${bindir}/mes-m2
|
|
|
|
fi
|
2019-11-03 21:15:11 +00:00
|
|
|
if test -f bin/mes-mescc; then
|
|
|
|
cp $_v bin/mes-mescc ${DESTDIR}${bindir}/mes-mescc
|
|
|
|
fi
|
2019-07-21 14:44:54 +00:00
|
|
|
cp $_v scripts/mesar ${DESTDIR}${bindir}/mesar
|
2019-06-08 13:36:22 +00:00
|
|
|
cp $_v scripts/mescc.scm ${DESTDIR}${bindir}/mescc.scm
|
|
|
|
cp $_v scripts/mescc ${DESTDIR}${bindir}/mescc
|
2018-07-09 08:46:28 +00:00
|
|
|
|
2018-07-21 16:28:47 +00:00
|
|
|
sed \
|
2019-06-08 13:36:22 +00:00
|
|
|
-e "s,^#! /bin/sh,#! ${SHELL}," \
|
|
|
|
scripts/diff.scm > ${DESTDIR}${bindir}/diff.scm
|
|
|
|
chmod +x ${DESTDIR}${bindir}/diff.scm
|
2018-07-21 16:28:47 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
mkdir -p ${DESTDIR}${docdir}
|
2018-07-21 21:56:08 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -n "${PERL}"\
|
|
|
|
&& test -n "${GIT}"\
|
|
|
|
&& ${PERL} -v > /dev/null\
|
2019-07-21 15:13:39 +00:00
|
|
|
&& ! test -f .git-for-build; then
|
2019-06-08 13:36:22 +00:00
|
|
|
${PERL} ${srcdest}build-aux/gitlog-to-changelog --srcdir=. > ChangeLog+
|
2018-07-21 21:56:08 +00:00
|
|
|
fi
|
|
|
|
|
2018-07-21 16:28:47 +00:00
|
|
|
cp\
|
|
|
|
AUTHORS\
|
|
|
|
BOOTSTRAP\
|
|
|
|
COPYING\
|
|
|
|
HACKING\
|
|
|
|
NEWS\
|
|
|
|
README\
|
2019-11-04 18:59:13 +00:00
|
|
|
ROADMAP\
|
2019-06-08 13:36:22 +00:00
|
|
|
${DESTDIR}${docdir}
|
2017-11-24 18:02:58 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -f ChangeLog+; then
|
|
|
|
cp $_v ChangeLog+ ${DESTDIR}${docdir}/ChangeLog
|
|
|
|
rm -f ChangeLog+
|
2018-07-21 16:28:47 +00:00
|
|
|
else
|
2019-06-08 13:36:22 +00:00
|
|
|
cp $_v ChangeLog ${DESTDIR}${docdir}
|
2018-07-21 22:43:39 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-15 18:18:31 +00:00
|
|
|
__exclude_go=
|
|
|
|
__exclude_scm=
|
2019-09-20 17:33:29 +00:00
|
|
|
if test -f module/mescc.go; then
|
|
|
|
__exclude_go=--exclude='*.go'
|
|
|
|
__exclude_scm=--exclude='*.scm'
|
|
|
|
fi
|
|
|
|
|
2019-11-13 08:23:27 +00:00
|
|
|
mkdir -p $DESTDIR$includedir
|
2019-06-08 13:36:22 +00:00
|
|
|
mkdir -p $DESTDIR$libdir
|
|
|
|
mkdir -p $DESTDIR$pkgdatadir
|
2019-11-13 08:23:27 +00:00
|
|
|
tar -cf- -C ${srcdir}/include . | tar -${v}xf- -C $DESTDIR$includedir
|
lib: stat: Use SYS_stat64 for 32bit platforms.
This fixes <https://debbugs.gnu.org/41264>.
* include/linux/arm/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/linux/x86/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/sys/stat.h (struct stat): Move definition to...
* include/linux/arm/kernel-stat.h,
include/linux/m2/kernel-stat.h,
include/linux/x86/kernel-stat.h,
include/linux/x86_64/kernel-stat.h: These new files.
* include/gnu/x86/kernel-stat.h: New file.
* configure (main): Copy <srcdest>include/<kernel>/<arch>/*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them. Add copyright header.
* build-aux/GNUmakefile.in (X86_ARCH_HEADERS, ARCH_HEADERS): New
variables.
(build): Use them.
(include/arch/%.h, arch-dir): New targets.
* 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.
* include/m2/types.h: New file.
* kaem.run: Use it.
* simple.sh: Copy kernel-stat.h, syscall.h for kernel/cpu to
include/arch.
2022-10-29 11:17:58 +00:00
|
|
|
tar -cf- -C include . | tar -${v}xf- -C $DESTDIR$includedir
|
2019-11-13 08:23:27 +00:00
|
|
|
tar -cf- -C ${srcdir}/lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
|
2019-12-11 07:16:46 +00:00
|
|
|
tar -cf- -C ${srcdir}/lib $mes_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -z "$srcdest"; then
|
2019-09-20 17:33:29 +00:00
|
|
|
tar -cf- $__exclude_go module | tar -${v}xf- -C $DESTDIR$pkgdatadir
|
2018-07-25 06:14:13 +00:00
|
|
|
else
|
2019-06-08 13:36:22 +00:00
|
|
|
tar -cf- -C ${srcdest} module | tar -${v}xf- -C $DESTDIR$pkgdatadir
|
2018-07-25 06:14:13 +00:00
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
tar -cf- -C ${srcdest}mes module | tar -${v}xf- -C $DESTDIR$pkgdatadir
|
|
|
|
if test -d gcc-lib/$mes_cpu-mes; then
|
|
|
|
tar -cf- -C gcc-lib/$mes_cpu-mes . | tar -${v}xf- -C $DESTDIR$libdir
|
2018-11-06 19:29:35 +00:00
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -d mescc-lib/$mes_cpu-mes; then
|
|
|
|
tar -cf- -C mescc-lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
|
2018-10-09 17:22:51 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
mkdir -p ${DESTDIR}${guile_site_dir}
|
|
|
|
mkdir -p ${DESTDIR}${guile_site_ccache_dir}
|
2019-09-20 17:33:29 +00:00
|
|
|
tar -cf- -C ${srcdest}module $__exclude_go . | tar -${v}xf- -C ${DESTDIR}${guile_site_dir}
|
|
|
|
tar -cf- -C module $__exclude_scm . | tar -${v}xf- -C ${DESTDIR}${guile_site_ccache_dir}
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -f doc/mes.info; then
|
|
|
|
mkdir -p ${DESTDIR}${infodir}
|
|
|
|
tar -cf- doc/mes.info* doc/images | tar -${v}xf- --strip-components=1 -C ${DESTDIR}${infodir}
|
|
|
|
install-info --info-dir=${DESTDIR}${infodir} doc/mes.info
|
2018-06-27 11:42:47 +00:00
|
|
|
fi
|
2018-06-28 21:10:14 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -f doc/mes.1; then
|
|
|
|
mkdir -p ${DESTDIR}${mandir}/man1
|
|
|
|
cp $_v doc/mes.1 ${DESTDIR}${mandir}/man1/
|
2018-06-28 21:10:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test -f doc/mescc.1; then
|
|
|
|
mkdir -p ${DESTDIR}${mandir}/man1
|
|
|
|
cp $_v doc/mescc.1 ${DESTDIR}${mandir}/man1/
|
2018-06-28 21:10:14 +00:00
|
|
|
fi
|