diff options
author | Brian Behlendorf <[email protected]> | 2009-03-13 13:38:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-03-13 13:38:43 -0700 |
commit | 8123ac4f0d7409cae209858d01803fb2744b51b6 (patch) | |
tree | 7e2c28b3215d47eff289fcd309a62224427621fb /configure | |
parent | a0b5ae8acaaf63fa2378a6d062e66fdf99387625 (diff) |
Added SPL_AC_5ARGS_DEVICE_CREATE autoconf configure check
As of 2.6.27 kernels the device_create() API changed to include
a private data argument. This check detects which version of
device_create() function the kernel has and properly defines
spl_device_create() to use the correct prototype.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -19788,6 +19788,74 @@ _ACEOF + echo "$as_me:$LINENO: checking whether device_create() wants 5 args" >&5 +echo $ECHO_N "checking whether device_create() wants 5 args... $ECHO_C" >&6 + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Werror" + + +cat >conftest.c <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + #include <linux/device.h> + +int +main (void) +{ + + device_create(NULL, NULL, 0, NULL, "%d", 1); + + ; + return 0; +} + +_ACEOF + + + rm -Rf build && mkdir -p build + echo "obj-m := conftest.o" >build/Makefile + if { ac_try='cp conftest.c build && make modules CC="$CC" LINUXINCLUDE="-Iinclude -Iinclude2 -I$LINUX/include -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_5ARGS_DEVICE_CREATE 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + + + +fi + + rm -Rf build + + + EXTRA_KCFLAGS="$tmp_flags" + + echo "$as_me:$LINENO: checking whether symbol class_device_create is exported" >&5 echo $ECHO_N "checking whether symbol class_device_create is exported... $ECHO_C" >&6 grep -q -E '[[:space:]]class_device_create[[:space:]]' $LINUX_OBJ/Module.symvers 2>/dev/null |