Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 455496
Collapse All | Expand All

(-)a/kernel/conftest.sh (-5 / +14 lines)
Lines 157-162 build_cflags() { Link Here
157
157
158
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS"
158
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS"
159
    CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi"
159
    CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi"
160
    CFLAGS="$CFLAGS -I$OUTPUT/include/generated/uapi"
160
161
161
    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
162
    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
162
        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
163
        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
Lines 1647-1653 case "$6" in Link Here
1647
        FILE="linux/version.h"
1648
        FILE="linux/version.h"
1648
        SELECTED_MAKEFILE=""
1649
        SELECTED_MAKEFILE=""
1649
1650
1650
        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
1651
        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE -o -f $OUTPUT/include/generated/uapi/$FILE ]; then
1651
            #
1652
            #
1652
            # We are either looking at a configured kernel source
1653
            # We are either looking at a configured kernel source
1653
            # tree or at headers shipped for a specific kernel.
1654
            # tree or at headers shipped for a specific kernel.
Lines 1697-1707 case "$6" in Link Here
1697
                # kernel older than 2.6.6, that's all we require to
1698
                # kernel older than 2.6.6, that's all we require to
1698
                # build the module.
1699
                # build the module.
1699
                #
1700
                #
1701
                K_VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
1700
                PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
1702
                PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
1701
                SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
1703
                SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
1702
1704
1703
                if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
1705
                kernel_is() {
1704
                        -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
1706
                        local operator value1 value2
1707
                        operator=$1; shift
1708
                        : $(( value1 = K_VERSION * 65536 + PATCHLEVEL * 256 + SUBLEVEL ))
1709
                        : $(( value2 = ${1:-${K_VERSION}} * 65536 + ${2:-${PATCHLEVEL}} * 256 + ${3:-${SUBLEVEL}} ))
1710
                        [ "${value1}" ${operator} "${value2}" ]
1711
                }
1712
                if kernel_is -le 2 6 5; then
1705
                    SELECTED_MAKEFILE=Makefile.kbuild
1713
                    SELECTED_MAKEFILE=Makefile.kbuild
1706
                    RET=0
1714
                    RET=0
1707
                fi
1715
                fi
Lines 1796-1806 case "$6" in Link Here
1796
                # This source tree is not configured, but includes
1804
                # This source tree is not configured, but includes
1797
                # the top-level Makefile.
1805
                # the top-level Makefile.
1798
                #
1806
                #
1807
                K_VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
1799
                PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
1808
                PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
1800
                SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
1809
                SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
1801
1810
1802
                if [ -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
1811
                if [ -n "$K_VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
1803
                    echo 2.$PATCHLEVEL.$SUBLEVEL
1812
                    echo $K_VERSION.$PATCHLEVEL.$SUBLEVEL
1804
                    RET=0
1813
                    RET=0
1805
                fi
1814
                fi
1806
            fi
1815
            fi

Return to bug 455496