scripts/build/kernel/linux.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 27 21:16:01 2009 +0000 (2009-05-27)
branchgcc-4.4
changeset 1393 b432bd628b10
parent 1337 7f742f73c2d1
child 1746 5851a36db763
permissions -rw-r--r--
/devel/gcc-4.4:
- add gcc-4.4.0 patches, vampirised from the Gentoo patchset
- gcc-4.4.0 auto-selects and uses appropriate companion linraries

-------- diffstat follows --------
/devel/gcc-4.4/scripts/build/cc/gcc.sh | 20 18 2 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/280-freebsd.patch | 188 188 0 0 ++++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/140-default-format-security.patch | 98 98 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/290-freebsd.patch | 128 128 0 0 +++++++
/devel/gcc-4.4/patches/gcc/4.4.0/310-uclibc-conf.patch | 70 70 0 0 ++++
/devel/gcc-4.4/patches/gcc/4.4.0/240-libstdc++-pic.patch | 106 106 0 0 ++++++
/devel/gcc-4.4/patches/gcc/4.4.0/260-sh-libgcc-stacks.patch | 50 50 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/100-alpha-mieee-default.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/180-libgomp-no-werror.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/170-sparc64-bsd.patch | 58 58 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/200-libiberty.h-asprintf.patch | 30 30 0 0 ++
/devel/gcc-4.4/patches/gcc/4.4.0/220-libiberty-pic.patch | 22 22 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/110-trampolinewarn.patch | 54 54 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/160-netbsd-symbolic.patch | 22 22 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/150-default-fortify-source.patch | 52 52 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch | 96 96 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/120-java-nomulti.patch | 92 92 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/270-sh-pr24836.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/330-c99-snprintf.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/230-superh-default-multilib.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/250-ia64-noteGNUstack.patch | 158 158 0 0 +++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/300-pr40105.patch | 360 360 0 0 ++++++++++++++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/130-cross-compile.patch | 78 78 0 0 ++++
/devel/gcc-4.4/patches/gcc/4.4.0/320-missing-execinfo_h.patch | 24 24 0 0 +
/devel/gcc-4.4/config/cc/gcc.in | 1 1 0 0 +
27 files changed, 1945 insertions(+), 2 deletions(-)
     1 # This file declares functions to install the kernel headers for linux
     2 # Copyright 2007 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 CT_DoKernelTupleValues() {
     6     if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
     7         CT_TARGET_KERNEL="linux"
     8     else
     9         CT_TARGET_KERNEL="uclinux"
    10     fi
    11 }
    12 
    13 # Download the kernel
    14 do_kernel_get() {
    15     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then
    16         CT_GetFile "linux-${CT_KERNEL_VERSION}" \
    17                    {ftp,http}://ftp.{de.,eu.,}kernel.org/pub/linux/kernel/v2.{6{,/testing},4,2}
    18     fi
    19     return 0
    20 }
    21 
    22 # Extract kernel
    23 do_kernel_extract() {
    24     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then
    25         CT_Extract "linux-${CT_KERNEL_VERSION}"
    26         CT_Patch "linux-${CT_KERNEL_VERSION}"
    27     fi
    28     return 0
    29 }
    30 
    31 # Wrapper to the actual headers install method
    32 do_kernel_headers() {
    33     CT_DoStep INFO "Installing kernel headers"
    34 
    35     if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" = "y" ]; then
    36         do_kernel_custom
    37     else
    38         do_kernel_install
    39     fi
    40 
    41     CT_EndStep
    42 }
    43 
    44 # Install kernel headers using headers_install from kernel sources.
    45 do_kernel_install() {
    46     CT_DoLog DEBUG "Using kernel's headers_install"
    47 
    48     mkdir -p "${CT_BUILD_DIR}/build-kernel-headers"
    49     cd "${CT_BUILD_DIR}/build-kernel-headers"
    50 
    51     # Only starting with 2.6.18 does headers_install is usable. We only
    52     # have 2.6 version available, so only test for sublevel.
    53     k_sublevel=$(awk '/^SUBLEVEL =/ { print $3 }' "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}/Makefile")
    54     [ ${k_sublevel} -ge 18 ] || CT_Abort "Kernel version >= 2.6.18 is needed to install kernel headers."
    55 
    56     V_OPT="V=${CT_KERNEL_LINUX_VERBOSE_LEVEL}"
    57 
    58     CT_DoLog EXTRA "Installing kernel headers"
    59     CT_DoExecLog ALL                                    \
    60     make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}"  \
    61          O=$(pwd)                                       \
    62          ARCH=${CT_KERNEL_ARCH}                         \
    63          INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr"       \
    64          ${V_OPT}                                       \
    65          headers_install
    66 
    67     if [ "${CT_KERNEL_LINUX_INSTALL_CHECK}" = "y" ]; then
    68         CT_DoLog EXTRA "Checking installed headers"
    69         CT_DoExecLog ALL                                    \
    70         make -C "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}"  \
    71              O=$(pwd)                                       \
    72              ARCH=${CT_KERNEL_ARCH}                         \
    73              INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr"       \
    74              ${V_OPT}                                       \
    75              headers_check
    76         find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \;
    77     fi
    78 }
    79 
    80 # Use custom headers (most probably by using make headers_install in a
    81 # modified (read: customised) kernel tree, or using pre-2.6.18 headers, such
    82 # as 2.4). In this case, simply copy the headers in place
    83 do_kernel_custom() {
    84     local tar_opt
    85 
    86     CT_DoLog EXTRA "Installing custom kernel headers"
    87 
    88     mkdir -p "${CT_SYSROOT_DIR}/usr"
    89     cd "${CT_SYSROOT_DIR}/usr"
    90     if [ "${CT_KERNEL_LINUX_CUSTOM_IS_TARBALL}" = "y" ]; then
    91         case "${CT_KERNEL_LINUX_CUSTOM_PATH}" in
    92             *.tar)      ;;
    93             *.tgz)      tar_opt=--gzip;;
    94             *.tar.gz)   tar_opt=--gzip;;
    95             *.tar.bz2)  tar_opt=--bzip2;;
    96             *.tar.lzma) tar_opt=--lzma;;
    97         esac
    98         CT_DoExecLog ALL tar x ${tar_opt} -vf ${CT_KERNEL_LINUX_CUSTOM_PATH}
    99     else
   100         CT_DoExecLog ALL cp -rv "${CT_KERNEL_LINUX_CUSTOM_PATH}/include" .
   101     fi
   102 }