Skip to content

Commit c9d45d2

Browse files
committed
modularized config
1 parent 0377a6e commit c9d45d2

File tree

5 files changed

+156
-24
lines changed

5 files changed

+156
-24
lines changed

THANKS

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
This is a list of people who -- directly or indirectly -- supported the
2-
development of this project, for example by suggesting features, pointing out
3-
problems, or just being awesome; in chronological order. If you feel that your
4-
name is missing here, please contact the maintainers.
1+
This is a list of people and projects who -- directly or indirectly --
2+
supported the development of this project, for example by suggesting features,
3+
pointing out problems, or just being awesome; in chronological order. If you
4+
feel that your name is missing here, please contact the maintainers.
55

66

77

@@ -10,3 +10,6 @@ name is missing here, please contact the maintainers.
1010

1111
rwmjones, sorear, davidlt in #fedora-riscv
1212
for providing ports, CFLAGS and miscellaneous advice where needed
13+
14+
the LFS and CLFS projects
15+
for creating and maintaining a wealth of bootstrapping knowledge

config/config.powerpc64le.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
##############################################################################
3+
# parabola-riscv64-bootstrap #
4+
# #
5+
# Copyright (C) 2018 Andreas Grapentin #
6+
# Copyright (C) 2018 Bruno Cichoń #
7+
# #
8+
# This program is free software: you can redistribute it and/or modify #
9+
# it under the terms of the GNU General Public License as published by #
10+
# the Free Software Foundation, either version 3 of the License, or #
11+
# (at your option) any later version. #
12+
# #
13+
# This program is distributed in the hope that it will be useful, #
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16+
# GNU General Public License for more details. #
17+
# #
18+
# You should have received a copy of the GNU General Public License #
19+
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
20+
##############################################################################
21+
22+
# the target host triplet
23+
export CARCH=powerpc64le
24+
export CHOST="$CARCH-unknown-linux-gnu"
25+
26+
# the equivalent architecture name used by the linux kernel
27+
export LINUX_ARCH=powerpc
28+
29+
# flags added to the default CFLAGS in makepkg.conf
30+
export PLATFORM_CFLAGS=("-mabi=elfv2")
31+
32+
# flags added to the gcc PKGBUILD configure call
33+
export GCC_CONFIG_FLAGS=("--with-long-double-128" "--enable-vsx")
34+
35+
# multilib configuration, uncomment if applicable
36+
#export MULTILIB=enable
37+
#export CARCH32=""
38+
#export CHOST32=""
39+
#export PLATFORM32_CFLAGS=()
40+
41+
# configure build directories
42+
export TOPBUILDDIR="$startdir/build/$CHOST"
43+
export TOPSRCDIR="$startdir"/src
44+
export SRCDEST="$startdir"/build/sources
45+
46+
# build options
47+
export REGEN_CONFIG_FRAGMENTS=yes

config/config.riscv64.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
##############################################################################
3+
# parabola-riscv64-bootstrap #
4+
# #
5+
# Copyright (C) 2018 Andreas Grapentin #
6+
# #
7+
# This program is free software: you can redistribute it and/or modify #
8+
# it under the terms of the GNU General Public License as published by #
9+
# the Free Software Foundation, either version 3 of the License, or #
10+
# (at your option) any later version. #
11+
# #
12+
# This program is distributed in the hope that it will be useful, #
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15+
# GNU General Public License for more details. #
16+
# #
17+
# You should have received a copy of the GNU General Public License #
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19+
##############################################################################
20+
21+
# the target host triplet
22+
export CARCH=riscv64
23+
export CHOST="$CARCH-unknown-linux-gnu"
24+
25+
# the equivalent architecture name used by the linux kernel
26+
export LINUX_ARCH=riscv
27+
28+
# flags added to the default CFLAGS in makepkg.conf
29+
export PLATFORM_CFLAGS=("-march=rv64gc" "-mabi=lp64d")
30+
31+
# flags added to the gcc PKGBUILD configure call
32+
export GCC_CONFIG_FLAGS=("--with-arch=rv64gc" "--with-abi=lp64d")
33+
34+
# multilib configuration, uncomment if applicable
35+
#export MULTILIB=enable
36+
#export CARCH32=""
37+
#export CHOST32=""
38+
#export PLATFORM32_CFLAGS=()
39+
40+
# configure build directories
41+
export TOPBUILDDIR="$startdir/build/$CHOST"
42+
export TOPSRCDIR="$startdir"/src
43+
export SRCDEST="$startdir"/build/sources
44+
45+
# build options
46+
export REGEN_CONFIG_FRAGMENTS=yes

config/config.template.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
##############################################################################
3+
# parabola-riscv64-bootstrap #
4+
# #
5+
# Copyright (C) 2018 Andreas Grapentin #
6+
# #
7+
# This program is free software: you can redistribute it and/or modify #
8+
# it under the terms of the GNU General Public License as published by #
9+
# the Free Software Foundation, either version 3 of the License, or #
10+
# (at your option) any later version. #
11+
# #
12+
# This program is distributed in the hope that it will be useful, #
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15+
# GNU General Public License for more details. #
16+
# #
17+
# You should have received a copy of the GNU General Public License #
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19+
##############################################################################
20+
21+
# the target host triplet
22+
export CARCH=
23+
export CHOST="$CARCH-unknown-linux-gnu"
24+
25+
# the equivalent architecture name used by the linux kernel
26+
export LINUX_ARCH=
27+
28+
# flags added to the default CFLAGS in makepkg.conf
29+
export PLATFORM_CFLAGS=()
30+
31+
# flags added to the gcc PKGBUILD configure call
32+
export GCC_CONFIG_FLAGS=()
33+
34+
# multilib configuration, uncomment if applicable
35+
#export MULTILIB=enable
36+
#export CARCH32=""
37+
#export CHOST32=""
38+
#export PLATFORM32_CFLAGS=()
39+
40+
# configure build directories
41+
export TOPBUILDDIR="$startdir/build/$CHOST"
42+
export SRCDEST="$startdir"/build/sources
43+
44+
# regenerate config.sub / config.guess during builds
45+
export REGEN_CONFIG_FRAGMENTS=yes
46+

create.sh

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,30 @@
1919
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
2020
##############################################################################
2121

22-
# target platform
23-
export CARCH=riscv64
24-
export CHOST=riscv64-unknown-linux-gnu
25-
export LINUX_ARCH=riscv
26-
export GCC_MARCH=rv64gc
27-
export GCC_MABI=lp64d
28-
#export MULTILIB=enable
29-
#export GCC32_MARCH=rv32gc
30-
#export GCC32_MABI=ilp32d
31-
#export CARCH32=riscv32
32-
#export CHOST32=riscv32-pc-linux-gnu
33-
34-
# common directories
3522
startdir="$(pwd)"
36-
export TOPBUILDDIR="$startdir"/build
3723
export TOPSRCDIR="$startdir"/src
38-
export SRCDEST="$TOPBUILDDIR"/sources
39-
mkdir -p "$TOPBUILDDIR" "$SRCDEST"
40-
chown "$SUDO_USER" "$TOPBUILDDIR"
41-
42-
# options
43-
export REGEN_CONFIG_FRAGMENTS=${REGEN_CONFIG_FRAGMENTS:-yes}
24+
export CONFIGDIR="$startdir"/config
4425

4526
# shellcheck source=src/shared/common.sh
4627
. "$TOPSRCDIR"/shared/common.sh
4728

4829
# sanity checks
30+
if [ -z "$1" ]; then
31+
die -e "$ERROR_INVOCATION" "usage: $0 CARCH (see config/config.*.sh)"
32+
fi
4933
if [ "$(id -u)" -ne 0 ]; then
5034
die -e "$ERROR_INVOCATION" "must be root"
5135
fi
5236
if [ -z "${SUDO_USER:-}" ]; then
5337
die -e "$ERROR_INVOCATION" "SUDO_USER must be set in environment"
5438
fi
5539

40+
# shellcheck source=config/config.template.sh
41+
. "$CONFIGDIR/config.$1.sh" || die -e "$ERROR_INVOCATION" "usage: $0 CARCH (see config/config.*.sh)"
42+
43+
mkdir -p "$TOPBUILDDIR" "$SRCDEST"
44+
chown "$SUDO_USER" "$TOPBUILDDIR"
45+
5646
# shellcheck source=src/stage1/stage1.sh
5747
. "$TOPSRCDIR"/stage1/stage1.sh
5848
stage1 || die -e "$ERROR_BUILDFAIL" "Stage 1 failed. Exiting..."

0 commit comments

Comments
 (0)