diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-03-18 23:40:30 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-03-18 23:40:30 +0100 |
commit | fb516edcaeaa02e435316622b2bcc5314b42d529 (patch) | |
tree | 02639a2de4f645f63ee493345e6587a8f0633443 /core/defconfigs | |
parent | ef3ed363560a9f3f598a97d60c8aac206c034ef4 (diff) | |
download | embtoolkit-fb516edcaeaa02e435316622b2bcc5314b42d529.tar.gz embtoolkit-fb516edcaeaa02e435316622b2bcc5314b42d529.tar.bz2 embtoolkit-fb516edcaeaa02e435316622b2bcc5314b42d529.tar.xz |
Move defconfigs to core/
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'core/defconfigs')
-rwxr-xr-x | core/defconfigs/arm/arm-ci-build.sh | 78 | ||||
-rwxr-xr-x | core/defconfigs/ci-build.sh | 176 | ||||
-rw-r--r-- | core/defconfigs/common.kconfig | 10 | ||||
-rwxr-xr-x | core/defconfigs/mips/mips-ci-build.sh | 76 |
4 files changed, 340 insertions, 0 deletions
diff --git a/core/defconfigs/arm/arm-ci-build.sh b/core/defconfigs/arm/arm-ci-build.sh new file mode 100755 index 0000000..434738f --- /dev/null +++ b/core/defconfigs/arm/arm-ci-build.sh @@ -0,0 +1,78 @@ +#!/bin/sh + +arm_perror() { + echo "[CI-BUILD-ERROR] ARM: $1" +} + +cibuild_kconfig=$workspace/cibuild-arm.kconfig +rm -rf $cibuild_kconfig +echo "CONFIG_EMBTK_ARCH_ARM=y" > $cibuild_kconfig + +set_arch_family() { + case "$archvariant" in + arm9tdmi|arm920t|arm922t) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM9TDMI=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM9TDMI_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + arm926ej-s) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM9E=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM9E_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + arm1020e|arm1022e|arm1026ej-s) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM10E=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM10E_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + xscale) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_XSCALE=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_XSCALE_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + arm1136j-s|arm1136jf-s|arm1176jz-s|arm1176jzf-s|mpcore) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM11=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_ARM11_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + cortex-a7|cortex-a8|cortex-a9|cortex-a15) + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_CORTEX=y" >> $cibuild_kconfig + echo "CONFIG_EMBTK_ARCH_ARM_FAMILY_CORTEX_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + *) + arm_perror "Unknown ARM architecture family for $archvariant" + exit 1 + ;; + esac +} + +set_endian() { + case "$endian" in + little|LITTLE) + echo "CONFIG_EMBTK_ARCH_ARM_LITTLE_ENDIAN=y" >> $cibuild_kconfig + ;; + big|BIG) + echo "CONFIG_EMBTK_ARCH_ARM_BIG_ENDIAN=y" >> $cibuild_kconfig + ;; + *) + arm_perror "Unknown ARM endianness for $archvariant" + exit 1 + ;; + esac +} + +set_float() { + case "$float" in + softfloat) + echo "CONFIG_EMBTK_SOFTFLOAT=y" >> $cibuild_kconfig + ;; + hardfloat) + echo "CONFIG_EMBTK_HARDFLOAT=y" >> $cibuild_kconfig + ;; + *) + arm_perror "Unknown ARM floating point type $float for $archvariant" + exit 1 + ;; + esac +} + +set_endian +set_arch_family +set_float + +cat $cibuild_kconfig >> $workspace/.config && rm -rf $cibuild_kconfig diff --git a/core/defconfigs/ci-build.sh b/core/defconfigs/ci-build.sh new file mode 100755 index 0000000..0b86386 --- /dev/null +++ b/core/defconfigs/ci-build.sh @@ -0,0 +1,176 @@ +#!/bin/sh + +# NOTE: this script only accepts long options + +perror() { + echo "[CI-BUILD-ERROR] : $1" +} + +pwarning() { + echo "[CI-BUILD-WARNING]: $1" +} + +pinfo() { + echo "[CI-BUILD-INFO] : $1" +} + +set_os() { + local x_os=$1 + local x_cibuild_kconfig=$2 + case "$x_os" in + linux|LINUX) + echo "CONFIG_EMBTK_OS_LINUX=y" >> $x_cibuild_kconfig + ;; + *) + perror "Unsupported OS $x_os , please help to support it" + exit 1 + ;; + esac +} + +set_xcompiler() { + local x_toolchain=$1 + local x_cibuild_kconfig=$2 + case "$x_toolchain" in + gcc|GCC) + echo "CONFIG_EMBTK_GCC_TOOLCHAIN=y" >> $x_cibuild_kconfig + ;; + Clang+llvm) + echo "CONFIG_EMBTK_LLVM_ONLY_TOOLCHAIN=y" >> $x_cibuild_kconfig + ;; + *) + perror "Unsupported cross compiler $x_toolchain , please help to support it" + exit 1 + ;; + esac +} + +set_clibrary() { + local x_clibrary=$1 + local x_cibuild_kconfig=$2 + case "$x_clibrary" in + eglibc) + echo "CONFIG_EMBTK_CLIB_EGLIBC=y" >> $x_cibuild_kconfig + ;; + uClibc) + echo "CONFIG_EMBTK_CLIB_UCLIBC=y" >> $x_cibuild_kconfig + ;; + glibc) + echo "CONFIG_EMBTK_CLIB_GLIBC=y" >> $x_cibuild_kconfig + ;; + musl) + echo "CONFIG_EMBTK_CLIB_MUSL=y" >> $x_cibuild_kconfig + ;; + *) + perror "Unsupported c library $x_clibrary , please help to support it" + exit 1 + ;; + esac +} + +options=$(echo $* | sed 's/=/ /g') +set -- $options + +pinfo "Parsing parameters" + +while true; do + case "$1" in + --abi) + abi=$2; shift 2;; + --arch) + arch=$2; shift 2;; + --archvariant) + archvariant=$2; shift 2;; + --clibrary) + clibrary=$2; shift 2;; + --endian) + endian=$2; shift 2;; + --float) + float=$2; shift 2;; + --os) + os=$2; shift 2;; + --toolchain) + toolchain=$2; shift 2;; + --workspace) + workspace=$2; shift 2;; + --downloaddir) + downloaddir=$2; shift 2;; + --makecmd) + makecmd=$2; shift 2;; + --) + shift; break ;; + *) + break;; + esac +done + +# +# Basic checks +# +if [ "x$workspace" = "x" ]; then + perror "Workspace not specified" + exit 1 +fi + +if [ "x$arch" = "x" ]; then + perror "Architecture not specified" + exit 1 +fi + +if [ ! -d $workspace/defconfigs/$arch ]; then + perror "Architecture $arch seems not be supported" + exit 1 +fi + +if [ ! -e $workspace/defconfigs/$arch/$arch-ci-build.sh ]; then + perror "Architecture $arch does not provide specifics" + exit 1 +fi + +xmakecmd="" +if [ "x$makecmd" = "x" ]; then + xmakecmd=make +else + xmakecmd=$makecmd +fi + +# +# Clean up old build +# +pinfo "Clean up old build" +cd $workspace && $xmakecmd clean +rm -rf $workspace/.config +rm -rf $workspace/.config.old +rm -rf $workspace/dl/*.patch +rm -rf $workspace/src/toolchain/*.git +rm -rf $workspace/src/toolchain/*.svn +rm -rf $workspace/generated/* + +pinfo "Generating .config file" +# +# arch script +# +. $workspace/defconfigs/$arch/$arch-ci-build.sh + +# +# toolchain and OS +# +set_os $os $workspace/.config +set_xcompiler $toolchain $workspace/.config +set_clibrary $clibrary $workspace/.config + +# +# Now generating final .config +# + +if [ ! "x$downloaddir" = "x" ]; then + if [ -d $downloaddir ]; then + echo "CONFIG_EMBTK_DOWNLOAD_DIR=\"$downloaddir\"" >> $workspace/.config + rm -rf $downloaddir/*.patch + fi +fi +cat $workspace/defconfigs/common.kconfig >> $workspace/.config + +pinfo "Starting toolchain build" +set -- +cd $workspace && $xmakecmd olddefconfig && $xmakecmd diff --git a/core/defconfigs/common.kconfig b/core/defconfigs/common.kconfig new file mode 100644 index 0000000..766e801 --- /dev/null +++ b/core/defconfigs/common.kconfig @@ -0,0 +1,10 @@ +CONFIG_EMBTK_WIPEOUTWORKSPACES=y +CONFIG_EMBTK_GCC_LANGUAGE_CPP=y +CONFIG_EMBTK_HAVE_GDB_SYSTEM=y +CONFIG_EMBTK_HAVE_GDB=y +CONFIG_EMBTK_HAVE_STRACE=y +CONFIG_EMBTK_NUMBER_BUILD_JOBS=3 +CONFIG_EMBTK_HAVE_ROOTFS=y +CONFIG_EMBTK_ROOTFS_HAVE_SQUASHFS=y +CONFIG_EMBTK_HAVE_BB=y +CONFIG_EMBTK_HAVE_GTEST=y diff --git a/core/defconfigs/mips/mips-ci-build.sh b/core/defconfigs/mips/mips-ci-build.sh new file mode 100755 index 0000000..93f58bf --- /dev/null +++ b/core/defconfigs/mips/mips-ci-build.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +mips_perror() { + echo "[CI-BUILD-ERROR] MIPS: $1" +} + +cibuild_kconfig=$workspace/cibuild-mips.kconfig +rm -rf $cibuild_kconfig +echo "CONFIG_EMBTK_ARCH_MIPS=y" > $cibuild_kconfig + +set_mips_isa() { + case "$archvariant" in + mips1|mips2|mips3|mips4|mips32|mips32r2|mips64|mips64r2|octeon) + echo "CONFIG_EMBTK_ARCH_MIPS_"$(echo $archvariant | tr a-z A-Z)"=y" >> $cibuild_kconfig + ;; + *) + mips_perror "Unknown MIPS ISA: $archvariant" + exit 1 + ;; + esac +} + +set_abi() { + case "$abi" in + o32|O32) + echo "CONFIG_EMBTK_ARCH_MIPS_ABI_O32=y" >> $cibuild_kconfig + ;; + n32|N32) + echo "CONFIG_EMBTK_ARCH_MIPS_ABI_N32=y" >> $cibuild_kconfig + ;; + n64|N64) + echo "CONFIG_EMBTK_ARCH_MIPS_ABI_N64=y" >> $cibuild_kconfig + ;; + *) + mips_perror "Unknown MIPS abi: $abi" + exit 1 + ;; + esac +} + +set_endian() { + case "$endian" in + little|LITTLE) + echo "CONFIG_EMBTK_ARCH_MIPS_LITTLE_ENDIAN=y" >> $cibuild_kconfig + ;; + big|BIG) + echo "CONFIG_EMBTK_ARCH_MIPS_BIG_ENDIAN=y" >> $cibuild_kconfig + ;; + *) + mips_perror "Unknown endianness for $archvariant" + exit 1 + ;; + esac +} + +set_float() { + case "$float" in + softfloat) + echo "CONFIG_EMBTK_SOFTFLOAT=y" >> $cibuild_kconfig + ;; + hardfloat) + echo "CONFIG_EMBTK_HARDFLOAT=y" >> $cibuild_kconfig + ;; + *) + mips_perror "Unknown floating point type $float for $archvariant" + exit 1 + ;; + esac +} + +set_mips_isa +set_abi +set_endian +set_float + +cat $cibuild_kconfig >> $workspace/.config && rm -rf $cibuild_kconfig |