diff --git a/config/config.in b/config/config.in index 14e1a411..73b4b022 100644 --- a/config/config.in +++ b/config/config.in @@ -4,6 +4,7 @@ source config/toolchain.in source config/kernel.in source config/companion_libs.in source config/binutils.in +source config/elf2flt.in source config/cc.in source config/libc.in source config/tools.in diff --git a/config/elf2flt.in b/config/elf2flt.in new file mode 100644 index 00000000..eae69fc2 --- /dev/null +++ b/config/elf2flt.in @@ -0,0 +1,49 @@ +# elf2flt options + +menu "elf2flt" + depends on KERNEL_UCLINUX_BINFMT_FLAT + +config ELF2FLT_VERSION + string + +choice + bool + prompt "elf2flt version" + +config ELF2FLT_CVSHEAD + bool + prompt "CVS Head" + help + Grab the latest version of elf2flt from the CVS repository + +config ELF2FLT_CVS_SNAPSHOT + bool + prompt "CVS Snapshot" + +# CT_INSERT_VERSION_ABOVE +# Don't remove above line! +endchoice + +config ELF2FLT_CVS_SNAPSHOT_SPEC + string + depends on ELF2FLT_CVS_SNAPSHOT + default "" + prompt "CVS refspec for elf2flt" + help + What you enter here will be passed verbatim to the cvs checkout command + so be careful! + +config ELF2FLT_VERSION + string + default "head" if ELF2FLT_CVSHEAD +# CT_INSERT_VERSION_STRING_ABOVE +# Don't remove above line! + +config ELF2FLT_EXTRA_CONFIG + string + prompt "elf2flt extra config" + default "" + help + Extra flags passed onto ./configure when configuring + +endmenu diff --git a/config/kernel.in b/config/kernel.in index 388c0487..9c701e10 100644 --- a/config/kernel.in +++ b/config/kernel.in @@ -3,7 +3,7 @@ menu "Operating System" # Config option used throughout the config and code to determine wether -# we have a kernel or not (there might be different bare metal stuff... +# we have a kernel or not (there might be different bare metal stuff)... config BARE_METAL bool default n diff --git a/config/kernel/linux.in b/config/kernel/linux.in index 06a179b4..fdc40fbb 100644 --- a/config/kernel/linux.in +++ b/config/kernel/linux.in @@ -4,250 +4,3 @@ config KERNEL_linux help Build a toolchain targeting systems running Linux as a kernel. -choice - bool - prompt "Get kernel headers from:" - -config KERNEL_LINUX_INSTALL - bool - prompt "kernel's 'headers_install'" - help - This will make use of the new headers_install rule in recent kernels. - This is most probably what you want to use. - -if KERNEL_LINUX_INSTALL - -config KERNEL_LINUX_INSTALL_CHECK - bool - prompt "Check installed headers" - default y - help - If you are in doubt that installed headers are buggy, say 'Y' - here to have an extra check passed onto the headers. - -choice - bool - prompt "Linux kernel version" - -config KERNEL_V_2_6_18_8 - bool - prompt "2.6.18.8 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_19_7 - bool - prompt "2.6.19.7 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_20_21 - bool - prompt "2.6.20.21 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_21_7 - bool - prompt "2.6.21.7 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_22_19 - bool - prompt "2.6.22.19 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_23_17 - bool - prompt "2.6.23.17 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_24_7 - bool - prompt "2.6.24.7 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_25_20 - bool - prompt "2.6.25.20 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_26_8 - bool - prompt "2.6.26.8 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_27_22 - bool - prompt "2.6.27.22 (OBSOLETE)" - depends on OBSOLETE - -config KERNEL_V_2_6_28 - bool - prompt "2.6.28" - -config KERNEL_V_2_6_28_1 - bool - prompt "2.6.28.1" - -config KERNEL_V_2_6_28_2 - bool - prompt "2.6.28.2" - -config KERNEL_V_2_6_28_3 - bool - prompt "2.6.28.3" - -config KERNEL_V_2_6_28_4 - bool - prompt "2.6.28.4" - -config KERNEL_V_2_6_28_5 - bool - prompt "2.6.28.5" - -config KERNEL_V_2_6_28_6 - bool - prompt "2.6.28.6" - -config KERNEL_V_2_6_28_7 - bool - prompt "2.6.28.7" - -config KERNEL_V_2_6_28_8 - bool - prompt "2.6.28.8" - -config KERNEL_V_2_6_28_9 - bool - prompt "2.6.28.9" - -config KERNEL_V_2_6_28_10 - bool - prompt "2.6.28.10" - -config KERNEL_V_2_6_29 - bool - prompt "2.6.29" - -config KERNEL_V_2_6_29_1 - bool - prompt "2.6.29.1" - -config KERNEL_V_2_6_29_2 - bool - prompt "2.6.29.2" - -# CT_INSERT_VERSION_ABOVE -# Don't remove above line! - -config KERNEL_V_select - bool - prompt "Other version (EXPERIMENTAL)" - depends on EXPERIMENTAL - -endchoice - -config KERNEL_VERSION - string - prompt "Kernel version" if KERNEL_V_select - default "2.6.18.8" if KERNEL_V_2_6_18_8 - default "2.6.19.7" if KERNEL_V_2_6_19_7 - default "2.6.20.21" if KERNEL_V_2_6_20_21 - default "2.6.21.7" if KERNEL_V_2_6_21_7 - default "2.6.22.19" if KERNEL_V_2_6_22_19 - default "2.6.23.17" if KERNEL_V_2_6_23_17 - default "2.6.24.7" if KERNEL_V_2_6_24_7 - default "2.6.25.20" if KERNEL_V_2_6_25_20 - default "2.6.26.8" if KERNEL_V_2_6_26_8 - default "2.6.27.22" if KERNEL_V_2_6_27_22 - default "2.6.28" if KERNEL_V_2_6_28 - default "2.6.28.1" if KERNEL_V_2_6_28_1 - default "2.6.28.2" if KERNEL_V_2_6_28_2 - default "2.6.28.3" if KERNEL_V_2_6_28_3 - default "2.6.28.4" if KERNEL_V_2_6_28_4 - default "2.6.28.5" if KERNEL_V_2_6_28_5 - default "2.6.28.6" if KERNEL_V_2_6_28_6 - default "2.6.28.7" if KERNEL_V_2_6_28_7 - default "2.6.28.8" if KERNEL_V_2_6_28_8 - default "2.6.28.9" if KERNEL_V_2_6_28_9 - default "2.6.28.10" if KERNEL_V_2_6_28_10 - default "2.6.29" if KERNEL_V_2_6_29 - default "2.6.29.1" if KERNEL_V_2_6_29_1 - default "2.6.29.2" if KERNEL_V_2_6_29_2 -# CT_INSERT_VERSION_STRING_ABOVE -# Don't remove above line! - help - Enter here the kernel version you want to use, if it is - not listed above. Something like V.P.S or V.P.S.E, where: - V: VERSION - P: PATCHLEVEL - S: SUBLEVEL - E: EXTRAVERSION - -choice - bool - prompt "Kernel verbosity:" - default KERNEL_LINUX_VERBOSITY_0 - -config KERNEL_LINUX_VERBOSITY_0 - bool - prompt "Simplified" - help - Print simplified command lines. - -config KERNEL_LINUX_VERBOSITY_1 - bool - prompt "Full commands" - help - Print full command lines. - -config KERNEL_LINUX_VERBOSITY_2 - bool - prompt "Exec reasons" - help - Print the reasons why a make target is rebuild. - -endchoice - -config KERNEL_LINUX_VERBOSE_LEVEL - int - default 0 if KERNEL_LINUX_VERBOSITY_0 - default 1 if KERNEL_LINUX_VERBOSITY_1 - default 2 if KERNEL_LINUX_VERBOSITY_2 - -endif - -config KERNEL_LINUX_USE_CUSTOM_HEADERS - bool - prompt "Use custom headers" - help - If you have some kernel headers lying around, you can enter the path - below. - -if KERNEL_LINUX_USE_CUSTOM_HEADERS - -config KERNEL_LINUX_CUSTOM_IS_TARBALL - bool - prompt "This is a tarball" - default n - help - If you say 'n' here, the path below is expected to point to a directory - containing readily prepared headers - - If you say 'y' here, then the path below is expected to point to a - tarball of such a directory. - - Eg., if your headers are available in: /foo/bar/buz/my_hdrs/include, - say 'n' here, and enter: /foo/bar/buz/my_hdrs below. - - Now, passing a tarball around is easier than passing a directory, so - if you want to, you can make a tarball of /foo/bar/buz/my_hdrs/include, - say 'y' here, and enter the path to this tarball below. - -config KERNEL_LINUX_CUSTOM_PATH - string - prompt "Path to custom headers directory/tarball" - help - See KERNEL_LINUX_CUSTOM_IS_TARBALL, above. - -endif # KERNEL_LINUX_USE_CUSTOM_DIR - -endchoice diff --git a/config/kernel/linux.in-common b/config/kernel/linux.in-common new file mode 100644 index 00000000..4a017995 --- /dev/null +++ b/config/kernel/linux.in-common @@ -0,0 +1,252 @@ +# Linux kernel options + +if KERNEL_linux || KERNEL_uclinux + +choice + bool + prompt "Get kernel headers from:" + +config KERNEL_LINUX_INSTALL + bool + prompt "kernel's 'headers_install'" + help + This will make use of the new headers_install rule in recent kernels. + This is most probably what you want to use. + +if KERNEL_LINUX_INSTALL + +config KERNEL_LINUX_INSTALL_CHECK + bool + prompt "Check installed headers" + default y + help + If you are in doubt that installed headers are buggy, say 'Y' + here to have an extra check passed onto the headers. + +choice + bool + prompt "Linux kernel version" + +config KERNEL_V_2_6_18_8 + bool + prompt "2.6.18.8 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_19_7 + bool + prompt "2.6.19.7 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_20_21 + bool + prompt "2.6.20.21 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_21_7 + bool + prompt "2.6.21.7 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_22_19 + bool + prompt "2.6.22.19 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_23_17 + bool + prompt "2.6.23.17 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_24_7 + bool + prompt "2.6.24.7 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_25_20 + bool + prompt "2.6.25.20 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_26_8 + bool + prompt "2.6.26.8 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_27_22 + bool + prompt "2.6.27.22 (OBSOLETE)" + depends on OBSOLETE + +config KERNEL_V_2_6_28 + bool + prompt "2.6.28" + +config KERNEL_V_2_6_28_1 + bool + prompt "2.6.28.1" + +config KERNEL_V_2_6_28_2 + bool + prompt "2.6.28.2" + +config KERNEL_V_2_6_28_3 + bool + prompt "2.6.28.3" + +config KERNEL_V_2_6_28_4 + bool + prompt "2.6.28.4" + +config KERNEL_V_2_6_28_5 + bool + prompt "2.6.28.5" + +config KERNEL_V_2_6_28_6 + bool + prompt "2.6.28.6" + +config KERNEL_V_2_6_28_7 + bool + prompt "2.6.28.7" + +config KERNEL_V_2_6_28_8 + bool + prompt "2.6.28.8" + +config KERNEL_V_2_6_28_9 + bool + prompt "2.6.28.9" + +config KERNEL_V_2_6_28_10 + bool + prompt "2.6.28.10" + +config KERNEL_V_2_6_29 + bool + prompt "2.6.29" + +config KERNEL_V_2_6_29_1 + bool + prompt "2.6.29.1" + +config KERNEL_V_2_6_29_2 + bool + prompt "2.6.29.2" + +# CT_INSERT_VERSION_ABOVE +# Don't remove above line! + +config KERNEL_V_select + bool + prompt "Other version (EXPERIMENTAL)" + depends on EXPERIMENTAL + +endchoice + +config KERNEL_VERSION + string + prompt "Kernel version" if KERNEL_V_select + default "2.6.18.8" if KERNEL_V_2_6_18_8 + default "2.6.19.7" if KERNEL_V_2_6_19_7 + default "2.6.20.21" if KERNEL_V_2_6_20_21 + default "2.6.21.7" if KERNEL_V_2_6_21_7 + default "2.6.22.19" if KERNEL_V_2_6_22_19 + default "2.6.23.17" if KERNEL_V_2_6_23_17 + default "2.6.24.7" if KERNEL_V_2_6_24_7 + default "2.6.25.20" if KERNEL_V_2_6_25_20 + default "2.6.26.8" if KERNEL_V_2_6_26_8 + default "2.6.27.22" if KERNEL_V_2_6_27_22 + default "2.6.28" if KERNEL_V_2_6_28 + default "2.6.28.1" if KERNEL_V_2_6_28_1 + default "2.6.28.2" if KERNEL_V_2_6_28_2 + default "2.6.28.3" if KERNEL_V_2_6_28_3 + default "2.6.28.4" if KERNEL_V_2_6_28_4 + default "2.6.28.5" if KERNEL_V_2_6_28_5 + default "2.6.28.6" if KERNEL_V_2_6_28_6 + default "2.6.28.7" if KERNEL_V_2_6_28_7 + default "2.6.28.8" if KERNEL_V_2_6_28_8 + default "2.6.28.9" if KERNEL_V_2_6_28_9 + default "2.6.28.10" if KERNEL_V_2_6_28_10 + default "2.6.29" if KERNEL_V_2_6_29 + default "2.6.29.1" if KERNEL_V_2_6_29_1 + default "2.6.29.2" if KERNEL_V_2_6_29_2 +# CT_INSERT_VERSION_STRING_ABOVE +# Don't remove above line! + help + Enter here the kernel version you want to use, if it is + not listed above. Something like V.P.S or V.P.S.E, where: + V: VERSION + P: PATCHLEVEL + S: SUBLEVEL + E: EXTRAVERSION + +choice + bool + prompt "Kernel verbosity:" + default KERNEL_LINUX_VERBOSITY_0 + +config KERNEL_LINUX_VERBOSITY_0 + bool + prompt "Simplified" + help + Print simplified command lines. + +config KERNEL_LINUX_VERBOSITY_1 + bool + prompt "Full commands" + help + Print full command lines. + +config KERNEL_LINUX_VERBOSITY_2 + bool + prompt "Exec reasons" + help + Print the reasons why a make target is rebuild. + +endchoice + +config KERNEL_LINUX_VERBOSE_LEVEL + int + default 0 if KERNEL_LINUX_VERBOSITY_0 + default 1 if KERNEL_LINUX_VERBOSITY_1 + default 2 if KERNEL_LINUX_VERBOSITY_2 + +endif + +config KERNEL_LINUX_USE_CUSTOM_HEADERS + bool + prompt "Use custom headers" + help + If you have some kernel headers lying around, you can enter the path + below. + +if KERNEL_LINUX_USE_CUSTOM_HEADERS + +config KERNEL_LINUX_CUSTOM_IS_TARBALL + bool + prompt "This is a tarball" + default n + help + If you say 'n' here, the path below is expected to point to a directory + containing readily prepared headers + + If you say 'y' here, then the path below is expected to point to a + tarball of such a directory. + + Eg., if your headers are available in: /foo/bar/buz/my_hdrs/include, + say 'n' here, and enter: /foo/bar/buz/my_hdrs below. + + Now, passing a tarball around is easier than passing a directory, so + if you want to, you can make a tarball of /foo/bar/buz/my_hdrs/include, + say 'y' here, and enter the path to this tarball below. + +config KERNEL_LINUX_CUSTOM_PATH + string + prompt "Path to custom headers directory/tarball" + help + See KERNEL_LINUX_CUSTOM_IS_TARBALL, above. + +endif # KERNEL_LINUX_USE_CUSTOM_DIR + +endchoice +endif diff --git a/config/kernel/uclinux.in b/config/kernel/uclinux.in new file mode 100644 index 00000000..b4997c0d --- /dev/null +++ b/config/kernel/uclinux.in @@ -0,0 +1,21 @@ +# uClinux kernel options +# depends on EXPERIMENTAL + +config KERNEL_uclinux + help + Build a toolchain targeting systems running uClinux as a kernel. + +choice + bool + depends on KERNEL_uclinux + prompt "noMMU binary format" + +config KERNEL_UCLINUX_BINFMT_FLAT + bool + prompt "binfmt_flat" + help + This will build the elf2flt and flthdr utilities for your architecture + into the toolchain + +endchoice + diff --git a/config/libc/eglibc.in b/config/libc/eglibc.in index de335d58..f8490c9e 100644 --- a/config/libc/eglibc.in +++ b/config/libc/eglibc.in @@ -1,5 +1,5 @@ # eglibc options -# depends on ! BARE_METAL +# depends on ! BARE_METAL && ! KERNEL_uclinux config LIBC_eglibc select LIBC_SUPPORT_NPTL diff --git a/config/libc/glibc-eglibc.in-common b/config/libc/glibc-eglibc.in-common index be8ac88b..5a066a7f 100644 --- a/config/libc/glibc-eglibc.in-common +++ b/config/libc/glibc-eglibc.in-common @@ -4,12 +4,17 @@ if LIBC_glibc || LIBC_eglibc # Some architectures require the ports addon. List them one by one here: +# This list must be carefully in sync with the architectures names +# we can find in config/arch/* + config ARCH_arm select LIBC_GLIBC_USE_PORTS config ARCH_mips select LIBC_GLIBC_USE_PORTS +# End of arch-specific ports auto-select + comment "glibc/eglibc common options" config LIBC_GLIBC_EXTRA_CONFIG diff --git a/config/libc/glibc.in b/config/libc/glibc.in index 204b65ea..92f9e40c 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -1,5 +1,5 @@ # glibc options -# depends on ! BARE_METAL +# depends on ! BARE_METAL && ! KERNEL_uclinux config LIBC_glibc select LIBC_SUPPORT_NPTL diff --git a/scripts/build/elf2flt.sh b/scripts/build/elf2flt.sh new file mode 100644 index 00000000..53b625f8 --- /dev/null +++ b/scripts/build/elf2flt.sh @@ -0,0 +1,75 @@ +# This file adds functions to build elf2flt +# Copyright 2009 John Williams +# Copyright 2007 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +# Download elf2flt +do_elf2flt_get() { + CT_GetCVS "elf2flt-cvs-${CT_ELF2FLT_VERSION}" \ + ":pserver:anonymous@cvs.uclinux.org:/var/cvs" \ + "elf2flt" \ + "" \ + "elf2flt-cvs-${CT_ELF2FLT_VERSION}" +} + +# Extract elf2flt +do_elf2flt_extract() { + CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}" + CT_Patch "elf2flt-cvs-${CT_ELF2FLT_VERSION}" +} + +# Build elf2flt +do_elf2flt() { + [ -z ${CT_KERNEL_UCLINUX_BINFMT_FLAT} ] && return 0 + mkdir -p "${CT_BUILD_DIR}/build-elf2flt" + cd "${CT_BUILD_DIR}/build-elf2flt" + + CT_DoStep INFO "Installing elf2flt" + + elf2flt_opts= + binutils_bld=${CT_BUILD_DIR}/build-binutils + binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION} + + CT_DoLog EXTRA "Configuring elf2flt" + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_HOST} \ + --target=${CT_TARGET} \ + --prefix=${CT_PREFIX_DIR} \ + --with-bfd-include-dir=${binutils_bld}/bfd \ + --with-binutils-include-dir=${binutils_src}/include \ + --with-libbfd=${binutils_bld}/bfd/libbfd.a \ + --with-libiberty=${binutils_bld}/libiberty/libiberty.a \ + ${elf2flt_opts} \ + ${CT_ELF2FLT_EXTRA_CONFIG} + + CT_DoLog EXTRA "Building elf2flt" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + CT_DoLog EXTRA "Installing elf2flt" + CT_DoExecLog ALL make install + + # Make those new tools available to the core C compilers to come. + # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as + # well. Create that. + mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin" + mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin" + mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin" + mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin" + for t in elf2flt flthdr; do + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}" + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}" + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}" + ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}" + done 2>&1 |CT_DoLog ALL + + CT_EndStep +} + +# Now on for the target libraries +do_elf2flt_target() { + exit -1 +} + diff --git a/scripts/build/kernel/linux-common.sh b/scripts/build/kernel/linux-common.sh new file mode 100644 index 00000000..fa6a9dde --- /dev/null +++ b/scripts/build/kernel/linux-common.sh @@ -0,0 +1,99 @@ +# This file declares functions to install the kernel headers for linux +# Copyright 2007 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +CT_DoKernelTupleValues() { + # Nothing to do, keep the default value + : +} + +# Download the kernel +do_kernel_get() { + if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then + CT_GetFile "linux-${CT_KERNEL_VERSION}" \ + {ftp,http}://ftp.{de.,eu.,}kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2} + fi + return 0 +} + +# Extract kernel +do_kernel_extract() { + if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then + CT_Extract "linux-${CT_KERNEL_VERSION}" + CT_Patch "linux-${CT_KERNEL_VERSION}" + fi + return 0 +} + +# Wrapper to the actual headers install method +do_kernel_headers() { + CT_DoStep INFO "Installing kernel headers" + + if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then + do_kernel_custom + else + do_kernel_install + fi + + CT_EndStep +} + +# Install kernel headers using headers_install from kernel sources. +do_kernel_install() { + CT_DoLog DEBUG "Using kernel's headers_install" + + mkdir -p "${CT_BUILD_DIR}/build-kernel-headers" + cd "${CT_BUILD_DIR}/build-kernel-headers" + + # Only starting with 2.6.18 does headers_install is usable. We only + # have 2.6 version available, so only test for sublevel. + k_sublevel=$(awk '/^SUBLEVEL =/ { print $3 }' "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}/Makefile") + [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers." + + V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}" + + CT_DoLog EXTRA "Installing kernel headers" + CT_DoExecLog ALL \ + make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \ + O=$(pwd) \ + ARCH=${CT_KERNEL_ARCH} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ + headers_install + + if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then + CT_DoLog EXTRA "Checking installed headers" + CT_DoExecLog ALL \ + make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \ + O=$(pwd) \ + ARCH=${CT_KERNEL_ARCH} \ + INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ + ${V_OPT} \ + headers_check + find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \; + fi +} + +# Use custom headers (most probably by using make headers_install in a +# modified (read: customised) kernel tree, or using pre-2.6.18 headers, such +# as 2.4). In this case, simply copy the headers in place +do_kernel_custom() { + local tar_opt + + CT_DoLog EXTRA "Installing custom kernel headers" + + mkdir -p "${CT_SYSROOT_DIR}/usr" + cd "${CT_SYSROOT_DIR}/usr" + if [ "${CT_KERNEL_LINUX_CUSTOM_IS_TARBALL}" = "y" ]; then + case "${CT_KERNEL_LINUX_CUSTOM_PATH}" in + *.tar) ;; + *.tgz) tar_opt=--gzip;; + *.tar.gz) tar_opt=--gzip;; + *.tar.bz2) tar_opt=--bzip2;; + *.tar.lzma) tar_opt=--lzma;; + esac + CT_DoExecLog ALL tar x ${tar_opt} -vf ${CT_KERNEL_LINUX_CUSTOM_PATH} + else + CT_DoExecLog ALL cp -rv "${CT_KERNEL_LINUX_CUSTOM_PATH}/include" . + fi +} diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh index fa6a9dde..0401c9ff 100644 --- a/scripts/build/kernel/linux.sh +++ b/scripts/build/kernel/linux.sh @@ -1,99 +1 @@ -# This file declares functions to install the kernel headers for linux -# Copyright 2007 Yann E. MORIN -# Licensed under the GPL v2. See COPYING in the root of this package - -CT_DoKernelTupleValues() { - # Nothing to do, keep the default value - : -} - -# Download the kernel -do_kernel_get() { - if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then - CT_GetFile "linux-${CT_KERNEL_VERSION}" \ - {ftp,http}://ftp.{de.,eu.,}kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2} - fi - return 0 -} - -# Extract kernel -do_kernel_extract() { - if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then - CT_Extract "linux-${CT_KERNEL_VERSION}" - CT_Patch "linux-${CT_KERNEL_VERSION}" - fi - return 0 -} - -# Wrapper to the actual headers install method -do_kernel_headers() { - CT_DoStep INFO "Installing kernel headers" - - if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then - do_kernel_custom - else - do_kernel_install - fi - - CT_EndStep -} - -# Install kernel headers using headers_install from kernel sources. -do_kernel_install() { - CT_DoLog DEBUG "Using kernel's headers_install" - - mkdir -p "${CT_BUILD_DIR}/build-kernel-headers" - cd "${CT_BUILD_DIR}/build-kernel-headers" - - # Only starting with 2.6.18 does headers_install is usable. We only - # have 2.6 version available, so only test for sublevel. - k_sublevel=$(awk '/^SUBLEVEL =/ { print $3 }' "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}/Makefile") - [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers." - - V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}" - - CT_DoLog EXTRA "Installing kernel headers" - CT_DoExecLog ALL \ - make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \ - O=$(pwd) \ - ARCH=${CT_KERNEL_ARCH} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ - headers_install - - if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then - CT_DoLog EXTRA "Checking installed headers" - CT_DoExecLog ALL \ - make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" \ - O=$(pwd) \ - ARCH=${CT_KERNEL_ARCH} \ - INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr" \ - ${V_OPT} \ - headers_check - find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \; - fi -} - -# Use custom headers (most probably by using make headers_install in a -# modified (read: customised) kernel tree, or using pre-2.6.18 headers, such -# as 2.4). In this case, simply copy the headers in place -do_kernel_custom() { - local tar_opt - - CT_DoLog EXTRA "Installing custom kernel headers" - - mkdir -p "${CT_SYSROOT_DIR}/usr" - cd "${CT_SYSROOT_DIR}/usr" - if [ "${CT_KERNEL_LINUX_CUSTOM_IS_TARBALL}" = "y" ]; then - case "${CT_KERNEL_LINUX_CUSTOM_PATH}" in - *.tar) ;; - *.tgz) tar_opt=--gzip;; - *.tar.gz) tar_opt=--gzip;; - *.tar.bz2) tar_opt=--bzip2;; - *.tar.lzma) tar_opt=--lzma;; - esac - CT_DoExecLog ALL tar x ${tar_opt} -vf ${CT_KERNEL_LINUX_CUSTOM_PATH} - else - CT_DoExecLog ALL cp -rv "${CT_KERNEL_LINUX_CUSTOM_PATH}/include" . - fi -} +. ${CT_LIB_DIR}/scripts/build/kernel/linux-common.sh diff --git a/scripts/build/kernel/uclinux.sh b/scripts/build/kernel/uclinux.sh new file mode 100644 index 00000000..0401c9ff --- /dev/null +++ b/scripts/build/kernel/uclinux.sh @@ -0,0 +1 @@ +. ${CT_LIB_DIR}/scripts/build/kernel/linux-common.sh diff --git a/steps.mk b/steps.mk index 088b004b..bb25061d 100644 --- a/steps.mk +++ b/steps.mk @@ -22,6 +22,7 @@ CT_STEPS := libc_check_config \ mpfr \ ppl \ binutils \ + elf2flt \ cc_core_pass_1 \ libc_headers \ libc_start_files \