Skip to content

Commit

Permalink
Add coreutils port
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalmiel committed Oct 19, 2023
1 parent 40955fe commit 77098dd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ https://user-images.githubusercontent.com/3881998/183302450-65193783-b10f-4ddd-8
- [x] mlibc (<https://github.com/rafalmiel/mlibc/tree/cykusz>) ([upstream](https://github.com/managarm/mlibc))
- [x] binutils (<https://github.com/rafalmiel/binutils-gdb/tree/cykusz>)
- [x] gcc (<https://github.com/rafalmiel/gcc/tree/cykusz>)
- [x] coreutils (<https://github.com/rafalmiel/coreutils/tree/cykusz>)
- [x] nyancat (<https://github.com/rafalmiel/nyancat/tree/cykusz>)
- [x] ncurses (<https://github.com/rafalmiel/ncurses/tree/cykusz>)
- [x] bash (<https://github.com/rafalmiel/bash/tree/cykusz>)
Expand Down
33 changes: 33 additions & 0 deletions sysroot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ GMP_SRC_DIR=$SRC_DIR/gmp
MPFR_SRC_DIR=$SRC_DIR/mpfr
MPC_SRC_DIR=$SRC_DIR/mpc
DOOM_SRC_DIR=$SRC_DIR/doomgeneric
COREUTILS_SRC_DIR=$SRC_DIR/coreutils

BUILD_DIR=$CYKUSZ_DIR/sysroot/build
BINUTILS_BUILD_DIR=$BUILD_DIR/binutils-gdb
Expand All @@ -24,6 +25,7 @@ GCC_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-gcc
NCURSES_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-ncurses
NANO_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-nano
BASH_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-bash
COREUTILS_CYKUSZ_BUILD_DIR=$BUILD_DIR/cykusz-coreutils
GCC_BUILD_DIR=$BUILD_DIR/gcc
MLIBC_BUILD_DIR=$BUILD_DIR/mlibc
GMP_BUILD_DIR=$BUILD_DIR/gmp
Expand Down Expand Up @@ -94,6 +96,20 @@ function _prepare_bash {
fi
}

function _prepare_coreutils {
if [ ! -d $COREUTILS_SRC_DIR ]; then
mkdir -p $SRC_DIR
git clone --depth 1 -b cykusz https://github.com/rafalmiel/coreutils.git $COREUTILS_SRC_DIR

pushd .
cd $COREUTILS_SRC_DIR
./bootstrap
rm build-aux/config.sub
mv config.sub.cykusz build-aux/config.sub
popd
fi
}

function _prepare_nano {
if [ ! -d $NANO_SRC_DIR ]; then
mkdir -p $SRC_DIR
Expand Down Expand Up @@ -316,6 +332,23 @@ function _cykusz_nano {
make -C $NANO_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT install
}

function _cykusz_coreutils {
_prepare_coreutils

mkdir -p $COREUTILS_CYKUSZ_BUILD_DIR

pushd .

cd $COREUTILS_CYKUSZ_BUILD_DIR

CFLAGS="-DSLOW_BUT_NO_HACKS -Wno-error" $COREUTILS_SRC_DIR/configure --host=$TRIPLE --target=$TRIPLE --prefix=/usr

popd

make -C $COREUTILS_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT -j4
make -C $COREUTILS_CYKUSZ_BUILD_DIR DESTDIR=$SYSROOT install
}

function _cykusz_bash {
_prepare_bash

Expand Down
3 changes: 3 additions & 0 deletions sysroot/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ $SPATH/build.sh cykusz_libgcc > $LOGDIR/cykusz_libgcc.log 2>&1
echo "Cross building libstdc++..."
$SPATH/build.sh cykusz_libstd > $LOGDIR/cykusz_libstd.log 2>&1

echo "Cross building coreutils..."
$SPATH/build.sh cykusz_coreutils > $LOGDIR/cykusz_coreutils.log 2>&1

echo "Cross building nyancat..."
$SPATH/build.sh cykusz_nyancat > $LOGDIR/cykusz_nyancat.log 2>&1

Expand Down

0 comments on commit 77098dd

Please sign in to comment.