summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-05-23 11:27:14 +0200
committerAndreas Grapentin <andreas@grapentin.org>2018-05-23 11:38:34 +0200
commitc9d45d267226ecad2d5ac4b91efa8740c3542589 (patch)
tree64ba43ea47126864f8df962cc0b343cabba92eed
parent0377a6e48a00bacd5ee270cfcc9a7372451536a5 (diff)
modularized config
-rw-r--r--THANKS11
-rw-r--r--config/config.powerpc64le.sh47
-rw-r--r--config/config.riscv64.sh46
-rw-r--r--config/config.template.sh46
-rwxr-xr-xcreate.sh30
5 files changed, 156 insertions, 24 deletions
diff --git a/THANKS b/THANKS
index cfd6f8f..43086b3 100644
--- a/THANKS
+++ b/THANKS
@@ -1,7 +1,7 @@
-This is a list of people who -- directly or indirectly -- supported the
-development of this project, for example by suggesting features, pointing out
-problems, or just being awesome; in chronological order. If you feel that your
-name is missing here, please contact the maintainers.
+This is a list of people and projects who -- directly or indirectly --
+supported the development of this project, for example by suggesting features,
+pointing out problems, or just being awesome; in chronological order. If you
+feel that your name is missing here, please contact the maintainers.
@@ -10,3 +10,6 @@ name is missing here, please contact the maintainers.
rwmjones, sorear, davidlt in #fedora-riscv
for providing ports, CFLAGS and miscellaneous advice where needed
+
+ the LFS and CLFS projects
+ for creating and maintaining a wealth of bootstrapping knowledge
diff --git a/config/config.powerpc64le.sh b/config/config.powerpc64le.sh
new file mode 100644
index 0000000..8490cd7
--- /dev/null
+++ b/config/config.powerpc64le.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+ ##############################################################################
+ # parabola-riscv64-bootstrap #
+ # #
+ # Copyright (C) 2018 Andreas Grapentin #
+ # Copyright (C) 2018 Bruno CichoĊ„ #
+ # #
+ # This program 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 <http://www.gnu.org/licenses/>. #
+ ##############################################################################
+
+# the target host triplet
+export CARCH=powerpc64le
+export CHOST="$CARCH-unknown-linux-gnu"
+
+# the equivalent architecture name used by the linux kernel
+export LINUX_ARCH=powerpc
+
+# flags added to the default CFLAGS in makepkg.conf
+export PLATFORM_CFLAGS=("-mabi=elfv2")
+
+# flags added to the gcc PKGBUILD configure call
+export GCC_CONFIG_FLAGS=("--with-long-double-128" "--enable-vsx")
+
+# multilib configuration, uncomment if applicable
+#export MULTILIB=enable
+#export CARCH32=""
+#export CHOST32=""
+#export PLATFORM32_CFLAGS=()
+
+# configure build directories
+export TOPBUILDDIR="$startdir/build/$CHOST"
+export TOPSRCDIR="$startdir"/src
+export SRCDEST="$startdir"/build/sources
+
+# build options
+export REGEN_CONFIG_FRAGMENTS=yes
diff --git a/config/config.riscv64.sh b/config/config.riscv64.sh
new file mode 100644
index 0000000..665f979
--- /dev/null
+++ b/config/config.riscv64.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+ ##############################################################################
+ # parabola-riscv64-bootstrap #
+ # #
+ # Copyright (C) 2018 Andreas Grapentin #
+ # #
+ # This program 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 <http://www.gnu.org/licenses/>. #
+ ##############################################################################
+
+# the target host triplet
+export CARCH=riscv64
+export CHOST="$CARCH-unknown-linux-gnu"
+
+# the equivalent architecture name used by the linux kernel
+export LINUX_ARCH=riscv
+
+# flags added to the default CFLAGS in makepkg.conf
+export PLATFORM_CFLAGS=("-march=rv64gc" "-mabi=lp64d")
+
+# flags added to the gcc PKGBUILD configure call
+export GCC_CONFIG_FLAGS=("--with-arch=rv64gc" "--with-abi=lp64d")
+
+# multilib configuration, uncomment if applicable
+#export MULTILIB=enable
+#export CARCH32=""
+#export CHOST32=""
+#export PLATFORM32_CFLAGS=()
+
+# configure build directories
+export TOPBUILDDIR="$startdir/build/$CHOST"
+export TOPSRCDIR="$startdir"/src
+export SRCDEST="$startdir"/build/sources
+
+# build options
+export REGEN_CONFIG_FRAGMENTS=yes
diff --git a/config/config.template.sh b/config/config.template.sh
new file mode 100644
index 0000000..66e61dd
--- /dev/null
+++ b/config/config.template.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+ ##############################################################################
+ # parabola-riscv64-bootstrap #
+ # #
+ # Copyright (C) 2018 Andreas Grapentin #
+ # #
+ # This program 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 <http://www.gnu.org/licenses/>. #
+ ##############################################################################
+
+# the target host triplet
+export CARCH=
+export CHOST="$CARCH-unknown-linux-gnu"
+
+# the equivalent architecture name used by the linux kernel
+export LINUX_ARCH=
+
+# flags added to the default CFLAGS in makepkg.conf
+export PLATFORM_CFLAGS=()
+
+# flags added to the gcc PKGBUILD configure call
+export GCC_CONFIG_FLAGS=()
+
+# multilib configuration, uncomment if applicable
+#export MULTILIB=enable
+#export CARCH32=""
+#export CHOST32=""
+#export PLATFORM32_CFLAGS=()
+
+# configure build directories
+export TOPBUILDDIR="$startdir/build/$CHOST"
+export SRCDEST="$startdir"/build/sources
+
+# regenerate config.sub / config.guess during builds
+export REGEN_CONFIG_FRAGMENTS=yes
+
diff --git a/create.sh b/create.sh
index c22fcb0..dcf1e37 100755
--- a/create.sh
+++ b/create.sh
@@ -19,33 +19,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
##############################################################################
-# target platform
-export CARCH=riscv64
-export CHOST=riscv64-unknown-linux-gnu
-export LINUX_ARCH=riscv
-export GCC_MARCH=rv64gc
-export GCC_MABI=lp64d
-#export MULTILIB=enable
-#export GCC32_MARCH=rv32gc
-#export GCC32_MABI=ilp32d
-#export CARCH32=riscv32
-#export CHOST32=riscv32-pc-linux-gnu
-
-# common directories
startdir="$(pwd)"
-export TOPBUILDDIR="$startdir"/build
export TOPSRCDIR="$startdir"/src
-export SRCDEST="$TOPBUILDDIR"/sources
-mkdir -p "$TOPBUILDDIR" "$SRCDEST"
-chown "$SUDO_USER" "$TOPBUILDDIR"
-
-# options
-export REGEN_CONFIG_FRAGMENTS=${REGEN_CONFIG_FRAGMENTS:-yes}
+export CONFIGDIR="$startdir"/config
# shellcheck source=src/shared/common.sh
. "$TOPSRCDIR"/shared/common.sh
# sanity checks
+if [ -z "$1" ]; then
+ die -e "$ERROR_INVOCATION" "usage: $0 CARCH (see config/config.*.sh)"
+fi
if [ "$(id -u)" -ne 0 ]; then
die -e "$ERROR_INVOCATION" "must be root"
fi
@@ -53,6 +37,12 @@ if [ -z "${SUDO_USER:-}" ]; then
die -e "$ERROR_INVOCATION" "SUDO_USER must be set in environment"
fi
+# shellcheck source=config/config.template.sh
+. "$CONFIGDIR/config.$1.sh" || die -e "$ERROR_INVOCATION" "usage: $0 CARCH (see config/config.*.sh)"
+
+mkdir -p "$TOPBUILDDIR" "$SRCDEST"
+chown "$SUDO_USER" "$TOPBUILDDIR"
+
# shellcheck source=src/stage1/stage1.sh
. "$TOPSRCDIR"/stage1/stage1.sh
stage1 || die -e "$ERROR_BUILDFAIL" "Stage 1 failed. Exiting..."