-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
executable file
·71 lines (62 loc) · 1.9 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Target library change script.
# Copyright (C) 2018-2021 NEC Corporation
# This file 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.
#
# This program 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 this program; if not, see <https://www.gnu.org/licenses/>.
set -x
SOURCE_PATH=../gcc_source
INSTALLBASE=/usr/local/ve/gcc
BINUTILS=/opt/nec/ve/bin
LIBC_TYPE=musl
while getopts "s:l:i:" OPT; do
case $OPT in
s)
SOURCE_PATH="$OPTARG";;
l)
LIBC_TYPE="$OPTARG";;
i)
INSTALLBASE="$OPTARG";;
esac
done
if [ "$LIBC_TYPE" = "musl" ]; then
LIBC_PATH=/opt/nec/ve/musl
TARGET=ve-nec-linux-musl
elif [ "$LIBC_TYPE" = "gnu" ]; then
LIBC_PATH=/opt/nec/ve
TARGET=ve-nec-linux-gnu
fi
date "+%Y%m%d" > $SOURCE_PATH/gcc/DATESTAMP
echo "experimental" > $SOURCE_PATH/gcc/DEV-PHASE
export PATH=/bin:/usr/bin
AS_FOR_TARGET=$BINUTILS/nas \
LD_FOR_TARGET=$BINUTILS/nld \
AR_FOR_TARGET=$BINUTILS/nar \
NM_FOR_TARGET=$BINUTILS/nnm \
STRIP_FOR_TARGET=$BINUTILS/nstrip \
RANLIB_FOR_TARGET=$BINUTILS/nranlib \
OBJDUMP_FOR_TARGET=$BINUTILS/nobjdump \
READELF_FOR_TARGET=$BINUTILS/nreadelf \
$SOURCE_PATH/configure \
--build=i386-unknown-linux \
--target=$TARGET \
--prefix=$INSTALLBASE \
--enable-languages=c,c++ \
--enable-libstdc++-v3 \
--disable-shared \
--enable-static \
--enable-sjlj-exceptions \
--disable-libunwind-exceptions \
--enable-tls \
--with-as=$BINUTILS/nas \
--with-ld=$BINUTILS/nld \
--program-prefix=""