Commit Diff


commit - 87df77a28a58d36cfc93336867ae27a6679a3e17
commit + 6341b1fd7700790ff5d9f19b1de17e265f09bb8f
blob - c330c80c729c9585f20ce981f16a40a4d8bcb6b8
blob + 60f901e6468c5e851aa49a7cac9874e15027d194
--- examples/test.c
+++ examples/test.c
@@ -59,5 +59,7 @@ int main (int argc, char *argv[]) {
 
 	printf ("Result: %u\n", mul (3, 2));
 
+	execl ("/bin/ksh", "/bin/ksh", NULL);
+
 	return 0;
 }
blob - 2b6164bfa02e7596ae90b138212040e30f570710
blob + eb82ae0f10499c0ce9dde16c9e0bef4f28c22d58
--- tools/Makefile
+++ tools/Makefile
@@ -16,6 +16,7 @@ LINUX_MAJOR != echo ${LINUX_VER} | cut -d. -f1
 GMP_VER = 6.3.0
 MPFR_VER = 4.2.1
 MPC_VER = 1.3.1
+OKSH_VER = 7.5
 
 GMAKE = $U/gmake
 SUDO =
@@ -71,6 +72,10 @@ src/mpc.tgz:
 	mkdir -p src
 	$U/download $@ https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VER}.tar.gz
 
+src/oksh.tgz:
+	mkdir -p src
+	$U/download $@ https://github.com/ibara/oksh/releases/download/oksh-${OKSH_VER}/oksh-${OKSH_VER}.tar.gz
+
 # EXTRACT
 
 ${STAMPS}/binutils-extract: src/binutils.tgz
@@ -122,7 +127,13 @@ ${STAMPS}/mpc: src/mpc.tgz
 	mv build/mpc-* build/mpc
 	touch $@
 
+${STAMPS}/oksh: src/oksh.tgz
+	mkdir -p ${STAMPS}
+	tar -C build -xzf src/oksh.tgz
+	mv build/oksh-* build/oksh
+	touch $@
 
+
 # KERNEL HEADERS
 
 ${STAMPS}/linux-headers: ${STAMPS}/linux-extract
@@ -225,3 +236,27 @@ ${STAMPS}/libgcc-build: ${STAMPS}/gcc-install ${STAMPS
 ${STAMPS}/libgcc-install: ${STAMPS}/libgcc-build
 	(cd ${TOOLS}/build/gcc/build && ${SUDO} ${GMAKE} install-target-libgcc)
 	touch $@
+
+# OKSH
+
+${STAMPS}/oksh-configure: ${STAMPS}/oksh ${STAMPS}/gcc-install
+	cd ${TOOLS}/build/oksh &&			\
+	./configure					\
+		--prefix=/				\
+		--cc=${PREFIX}/bin/${TARGET}-gcc	\
+		--enable-sh				\
+		--enable-ksh				\
+		--enable-static				\
+		--disable-curses			\
+		--no-thanks
+	touch $@
+
+${STAMPS}/oksh-build: ${STAMPS}/oksh-configure
+	(cd ${TOOLS}/build/oksh && ${MAKE})
+	touch $@
+
+${TOP}/rootfs/bin/ksh: ${STAMPS}/oksh-build
+	mkdir -p ${TOP}/rootfs
+	(cd ${TOOLS}/build/oksh && ${MAKE} DESTDIR=${TOP}/rootfs install)
+
+oksh: ${TOP}/rootfs/bin/ksh