|
|
} | } |
| |
build_cflags() { | build_cflags() { |
|
ARCH=`uname -m | sed -e 's/i.86/i386/'` |
|
|
BASE_CFLAGS="-D__KERNEL__ \ | BASE_CFLAGS="-D__KERNEL__ \ |
-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \ | -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \ |
-nostdinc -isystem $ISYSTEM" | -nostdinc -isystem $ISYSTEM" |
|
|
test_xen | test_xen |
| |
if [ "$OUTPUT" != "$SOURCES" ]; then | if [ "$OUTPUT" != "$SOURCES" ]; then |
ARCH=`uname -m | sed -e 's/i.86/i386/'` |
|
MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default" | MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default" |
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then | if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then |
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" | MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" |
|
MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" |
fi | fi |
if [ "$XEN_PRESENT" != "0" ]; then | if [ "$XEN_PRESENT" != "0" ]; then |
MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-xen $MACH_CFLAGS" | MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-xen $MACH_CFLAGS" |
fi | fi |
else | else |
MACH_CFLAGS="-I$HEADERS/asm/mach-default" | MACH_CFLAGS="-I$HEADERS/asm/mach-default" |
|
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then |
|
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" |
|
MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" |
|
fi |
if [ "$XEN_PRESENT" != "0" ]; then | if [ "$XEN_PRESENT" != "0" ]; then |
MACH_CFLAGS="-I$HEADERS/asm/mach-xen $MACH_CFLAGS" | MACH_CFLAGS="-I$HEADERS/asm/mach-xen $MACH_CFLAGS" |
fi | fi |
|
|
| |
CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS" | CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS" |
| |
|
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then |
|
CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include" |
|
fi |
if [ -n "$BUILD_PARAMS" ]; then | if [ -n "$BUILD_PARAMS" ]; then |
CFLAGS="$CFLAGS -D$BUILD_PARAMS" | CFLAGS="$CFLAGS -D$BUILD_PARAMS" |
fi | fi |
|
|
| |
if [ -f conftest$$.o ]; then | if [ -f conftest$$.o ]; then |
rm -f conftest$$.o | rm -f conftest$$.o |
echo "#undef NV_ON_EACH_CPU" >> conftest.h |
echo "#undef NV_ON_EACH_CPU_PRESENT" >> conftest.h |
return | return |
fi | fi |
| |
|
|
fi | fi |
;; | ;; |
| |
|
acpi_evaluate_integer) |
|
# |
|
# Determine if the acpi_evaluate_integer() function is |
|
# present and the type of its 'data' argument. |
|
# |
|
|
|
echo "$CONFTEST_PREAMBLE |
|
#include <acpi/acpi_bus.h> |
|
acpi_status acpi_evaluate_integer(acpi_handle h, acpi_string s, |
|
struct acpi_object_list *l, unsigned long long *d) { |
|
return AE_OK; |
|
}" > conftest$$.c |
|
|
|
$CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 |
|
rm -f conftest$$.c |
|
|
|
if [ -f conftest$$.o ]; then |
|
rm -f conftest$$.o |
|
echo "#define NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h |
|
echo "typedef unsigned long long nv_acpi_integer_t;" >> conftest.h |
|
return |
|
fi |
|
|
|
echo "$CONFTEST_PREAMBLE |
|
#include <acpi/acpi_bus.h> |
|
acpi_status acpi_evaluate_integer(acpi_handle h, acpi_string s, |
|
struct acpi_object_list *l, unsigned long *d) { |
|
return AE_OK; |
|
}" > conftest$$.c |
|
|
|
$CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 |
|
rm -f conftest$$.c |
|
|
|
if [ -f conftest$$.o ]; then |
|
rm -f conftest$$.o |
|
echo "#define NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h |
|
echo "typedef unsigned long nv_acpi_integer_t;" >> conftest.h |
|
return |
|
else |
|
# |
|
# We can't report a compile test failure here because |
|
# this is a catch-all for both kernels that don't |
|
# have acpi_evaluate_integer() and kernels that have |
|
# broken header files that make it impossible to |
|
# tell if the function is present. |
|
# |
|
echo "#undef NV_ACPI_EVALUATE_INTEGER_PRESENT" >> conftest.h |
|
echo "typedef unsigned long nv_acpi_integer_t;" >> conftest.h |
|
fi |
|
;; |
|
|
esac | esac |
} | } |
| |