2017-11-24 18:02:58 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
2017-11-21 18:22:26 +00:00
|
|
|
# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-01-01 14:53:13 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# This file is part of GNU Mes.
|
2018-01-01 14:53:13 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is free software; you can redistribute it and/or modify it
|
2018-01-01 14:53:13 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is distributed in the hope that it will be useful, but
|
2018-01-01 14:53:13 +00:00
|
|
|
# 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
|
2018-07-22 12:24:36 +00:00
|
|
|
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2018-01-01 14:53:13 +00:00
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
set -e
|
|
|
|
|
2019-09-06 21:24:23 +00:00
|
|
|
MES_ARENA=${MES_ARENA-20000000}
|
|
|
|
export MES_ARENA
|
|
|
|
MES_MAX_ARENA=${MES_MAX_ARENA-${MES_ARENA}}
|
|
|
|
export MES_MAX_ARENA
|
|
|
|
MES_STACK=${MES_STACK-5000000}
|
|
|
|
export MES_STACK
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
. ./config.sh
|
2018-05-25 06:05:02 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if $courageous; then
|
|
|
|
echo "Applying courage"
|
|
|
|
set +e
|
|
|
|
fi
|
|
|
|
|
|
|
|
CFLAGS=
|
2020-06-01 22:03:03 +00:00
|
|
|
if test $mes_cpu = arm; then
|
|
|
|
CFLAGS="-marm"
|
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
if test $mes_libc = mes; then
|
2019-07-03 14:47:42 +00:00
|
|
|
CFLAGS="${CFLAGS}
|
2019-07-06 11:57:30 +00:00
|
|
|
-static
|
2019-06-08 13:36:22 +00:00
|
|
|
-nostdinc
|
|
|
|
-nostdlib
|
|
|
|
-fno-builtin
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CPPFLAGS="
|
|
|
|
-D HAVE_CONFIG_H=1
|
|
|
|
-I ../include
|
|
|
|
-I ${srcdir}/include
|
|
|
|
-I ${srcdir}/include/$mes_kernel/$mes_cpu
|
|
|
|
"
|
|
|
|
|
|
|
|
LIBS=
|
|
|
|
LDFLAGS=
|
|
|
|
if test $mes_libc = mes; then
|
|
|
|
LDFLAGS="
|
|
|
|
-nostdlib
|
|
|
|
"
|
|
|
|
LIBS=-lc
|
|
|
|
fi
|
|
|
|
|
|
|
|
export CFLAGS
|
|
|
|
export CPPFLAGS
|
|
|
|
export LDFLAGS
|
|
|
|
#export LIBS
|
|
|
|
|
2019-06-10 09:39:31 +00:00
|
|
|
recheck=${recheck-false}
|
|
|
|
export recheck
|
|
|
|
|
2019-06-25 19:40:43 +00:00
|
|
|
./pre-inst-env ${SHELL} ${srcdest}build-aux/check-boot.sh
|
|
|
|
./pre-inst-env ${SHELL} ${srcdest}build-aux/check-mes.sh
|
2019-06-08 13:36:22 +00:00
|
|
|
|
|
|
|
if test $compiler = gcc; then
|
|
|
|
(
|
|
|
|
cd gcc-lib
|
|
|
|
srcdest=$srcdir/../
|
|
|
|
srcdir=../$srcdir
|
2020-08-29 13:24:48 +00:00
|
|
|
MES_CHECKING_BUILTIN_LIBS="-l gcc"
|
|
|
|
export MES_CHECKING_BUILTIN_LIBS
|
2019-06-25 19:40:43 +00:00
|
|
|
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
2019-06-08 13:36:22 +00:00
|
|
|
)
|
2018-08-09 08:22:26 +00:00
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
|
|
|
|
(
|
|
|
|
cd mescc-lib
|
|
|
|
srcdest=$srcdir/../
|
|
|
|
srcdir=../$srcdir
|
|
|
|
compiler=mescc
|
|
|
|
mes_lib=mes
|
|
|
|
CFLAGS="
|
|
|
|
-nostdinc
|
|
|
|
-nostdlib
|
|
|
|
-fno-builtin
|
|
|
|
"
|
|
|
|
LDFLAGS="
|
|
|
|
-nostdlib
|
|
|
|
"
|
2020-08-29 13:24:48 +00:00
|
|
|
MES_CHECKING_BUILTIN_LIBS="-l mescc"
|
|
|
|
export MES_CHECKING_BUILTIN_LIBS
|
2019-07-21 14:44:54 +00:00
|
|
|
AR="${srcdest}pre-inst-env mesar"
|
2019-06-08 13:36:22 +00:00
|
|
|
CC="${srcdest}pre-inst-env mescc"
|
2019-06-25 19:40:43 +00:00
|
|
|
../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh
|
2019-06-08 13:36:22 +00:00
|
|
|
)
|