summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-05-15 19:37:19 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-10-09 23:55:24 (GMT)
commitbb04e1368eb428118c3de6220026715350969b7d (patch)
tree96078e36e96dc1453ea3eee18a0a9035e38ae40a
parent4838ef05426ab4bef15f7385631c5ba0965b9699 (diff)
downloadtoolchains-ashmew2/kolibrios.tar.gz
toolchains-ashmew2/kolibrios.tar.bz2
Add makefile for kos32-gcc.ashmew2/kolibrios
Add a shell script called via the makefile which does the actual build. The compiler package (with sdk) is downloaded from the KolibriOS Ftp Site. Script verifies downloaded compiler package by checking sha512 sum on the file. In addition, the SVN Checkout of kolibrios is required for building some other objects required to build netsurf.
-rw-r--r--kos32-gcc/Makefile4
-rwxr-xr-xkos32-gcc/build.sh64
2 files changed, 68 insertions, 0 deletions
diff --git a/kos32-gcc/Makefile b/kos32-gcc/Makefile
new file mode 100644
index 0000000..e023a4b
--- a/dev/null
+++ b/kos32-gcc/Makefile
@@ -0,0 +1,4 @@
+install: builder
+
+builder:
+ ./build.sh
diff --git a/kos32-gcc/build.sh b/kos32-gcc/build.sh
new file mode 100755
index 0000000..37fb92c
--- a/dev/null
+++ b/kos32-gcc/build.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+set -x
+COMPILER=x86_64-linux-kos32-4.8.5.7z
+SDK=sdk-28-10-16.7z
+
+SVN_URL=svn://kolibrios.org
+SDK_URL=http://ftp.kolibrios.org/users/Serge/new/Toolchain/$SDK
+COMPILER_URL=http://ftp.kolibrios.org/users/Serge/new/Toolchain/$COMPILER
+
+INSTALL_PATH=/opt/netsurf/kos32-gcc
+CROSS_PATH=$INSTALL_PATH/cross/autobuild/tools/
+ENV_PATH=$INSTALL_PATH/env
+OBJ_PATH=$ENV_PATH/obj
+
+SVN_CHECKOUT=$ENV_PATH/kolibrios
+
+SHA512_SDK=e37226c1421104f9025c644277080a0adad1cb5db560fe04bbcc6c41797fe87e57d337da314bde4abc4decfbedf3087ffb16b1d71d2587e317933204255ead1a
+SHA512_COMPILER=28555b2247848c5d85be6b18e10dc903b9a161179230b65d35f7f3bf40dff3b135972e84f6c25db23fee2a90c7a96b5a755dba9a2eaa9dbc4735e717436db1ce
+
+# clean
+# rm -rf $INSTALL_PATH
+
+# set up directories
+for dir in $INSTALL_PATH $CROSS_PATH $ENV_PATH $OBJ_PATH; do
+ mkdir -p $dir
+done
+
+# download sdk and friends
+svn checkout ${SVN_URL} ${SVN_CHECKOUT}
+wget -v ${COMPILER_URL} --directory-prefix=${CROSS_PATH}
+wget -v ${SDK_URL} --directory-prefix=${CROSS_PATH}
+
+# verify checksums
+for file in COMPILER SDK; do
+ VARNAME=SHA512_${file}
+ [[ $(sha512sum $CROSS_PATH/${!file} | awk '{print $1}') != ${!VARNAME} ]] && exit 1
+done
+
+# set up toolchain
+pushd $PWD
+
+cd $CROSS_PATH
+7z x $COMPILER
+
+mv $SDK win32/
+
+cd win32
+7z x $SDK
+
+popd
+
+# fix up environment
+PATH=${PATH}:/opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/bin
+GCC="kos32-gcc -c -fno-ident -fomit-frame-pointer -U__WIN32__ -I${SVN_CHECKOUT}/contrib/sdk/sources/newlib/libc/include -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U__BSD_VISIBLE"
+ASM=fasm
+
+# build stuff
+$GCC ${SVN_CHECKOUT}/programs/fs/unzip60/kolibri/dirent.c -o ${OBJ_PATH}/dirent.o
+$GCC ${SVN_CHECKOUT}/programs/develop/libraries/iconv/iconv.c -o ${OBJ_PATH}/iconv.o
+$ASM ${SVN_CHECKOUT}/contrib/C_Layer/ASM/loadhttp.asm ${OBJ_PATH}/loadhttp.obj
+
+
+