]>
Commit | Line | Data |
---|---|---|
57d86234 | 1 | AC_DEFUN([SPL_AC_KERNEL], [ |
2 | ver=`uname -r` | |
3 | ||
4 | AC_ARG_WITH([linux], | |
5 | AS_HELP_STRING([--with-linux=PATH], | |
6 | [Path to kernel source]), | |
7 | [kernelsrc="$withval"; kernelbuild="$withval"]) | |
8 | ||
9 | AC_ARG_WITH([linux-obj], | |
10 | AS_HELP_STRING([--with-linux-obj=PATH], | |
11 | [Path to kernel build objects]), | |
12 | [kernelbuild="$withval"]) | |
13 | ||
14 | AC_MSG_CHECKING([kernel source directory]) | |
15 | if test -z "$kernelsrc"; then | |
16 | kernelbuild= | |
17 | sourcelink=/lib/modules/${ver}/source | |
18 | buildlink=/lib/modules/${ver}/build | |
19 | ||
20 | if test -e $sourcelink; then | |
21 | kernelsrc=`(cd $sourcelink; /bin/pwd)` | |
22 | fi | |
23 | if test -e $buildlink; then | |
24 | kernelbuild=`(cd $buildlink; /bin/pwd)` | |
25 | fi | |
26 | if test -z "$kernelsrc"; then | |
27 | kernelsrc=$kernelbuild | |
28 | fi | |
29 | if test -z "$kernelsrc" -o -z "$kernelbuild"; then | |
30 | AC_MSG_RESULT([Not found]) | |
31 | AC_MSG_ERROR([ | |
32 | *** Please specify the location of the kernel source | |
33 | *** with the '--with-kernel=PATH' option]) | |
34 | fi | |
35 | fi | |
36 | ||
37 | AC_MSG_RESULT([$kernelsrc]) | |
38 | AC_MSG_CHECKING([kernel build directory]) | |
39 | AC_MSG_RESULT([$kernelbuild]) | |
40 | ||
41 | AC_MSG_CHECKING([kernel source version]) | |
42 | if test -r $kernelbuild/include/linux/version.h && | |
43 | fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then | |
44 | ||
45 | kernsrcver=`(echo "#include <linux/version.h>"; | |
46 | echo "kernsrcver=UTS_RELEASE") | | |
47 | cpp -I $kernelbuild/include | | |
48 | grep "^kernsrcver=" | cut -d \" -f 2` | |
49 | ||
50 | elif test -r $kernelbuild/include/linux/utsrelease.h && | |
51 | fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then | |
52 | ||
53 | kernsrcver=`(echo "#include <linux/utsrelease.h>"; | |
54 | echo "kernsrcver=UTS_RELEASE") | | |
55 | cpp -I $kernelbuild/include | | |
56 | grep "^kernsrcver=" | cut -d \" -f 2` | |
57 | fi | |
58 | ||
59 | if test -z "$kernsrcver"; then | |
60 | AC_MSG_RESULT([Not found]) | |
61 | AC_MSG_ERROR([ | |
62 | *** Cannot determine the version of the linux kernel source. | |
63 | *** Please prepare the kernel before running this script]) | |
64 | fi | |
65 | ||
66 | AC_MSG_RESULT([$kernsrcver]) | |
67 | ||
68 | kmoduledir=${INSTALL_MOD_PATH}/lib/modules/$kernsrcver | |
69 | LINUX=${kernelsrc} | |
70 | LINUX_OBJ=${kernelbuild} | |
71 | ||
72 | AC_SUBST(LINUX) | |
73 | AC_SUBST(LINUX_OBJ) | |
74 | AC_SUBST(kmoduledir) | |
75 | ]) | |
76 | ||
77 | AC_DEFUN([SPL_AC_DEBUG], [ | |
78 | AC_MSG_CHECKING([whether debugging is enabled]) | |
79 | AC_ARG_ENABLE( [debug], | |
80 | AS_HELP_STRING([--enable-debug], | |
81 | [Enable generic debug support (default off)]), | |
82 | [ case "$enableval" in | |
83 | yes) spl_ac_debug=yes ;; | |
475cdc78 | 84 | no) spl_ac_debug=no ;; |
57d86234 | 85 | *) AC_MSG_RESULT([Error!]) |
86 | AC_MSG_ERROR([Bad value "$enableval" for --enable-debug]) ;; | |
87 | esac ] | |
88 | ) | |
89 | if test "$spl_ac_debug" = yes; then | |
475cdc78 | 90 | AC_MSG_RESULT([yes]) |
57d86234 | 91 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG" |
92 | else | |
475cdc78 | 93 | AC_MSG_RESULT([no]) |
57d86234 | 94 | AC_DEFINE([NDEBUG], [1], |
95 | [Define to 1 to disable debug tracing]) | |
475cdc78 | 96 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG" |
57d86234 | 97 | fi |
57d86234 | 98 | ]) |
99 | ||
100 | AC_DEFUN([SPL_AC_DEBUG_KMEM], [ | |
101 | AC_MSG_CHECKING([whether kmem debugging is enabled]) | |
102 | AC_ARG_ENABLE( [debug-kmem], | |
103 | AS_HELP_STRING([--enable-debug-kmem], | |
104 | [Enable kmem debug support (default off)]), | |
105 | [ case "$enableval" in | |
475cdc78 | 106 | yes) spl_ac_debug_kmem=yes ;; |
107 | no) spl_ac_debug_kmem=no ;; | |
57d86234 | 108 | *) AC_MSG_RESULT([Error!]) |
109 | AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kmem]) ;; | |
110 | esac ] | |
111 | ) | |
475cdc78 | 112 | if test "$spl_ac_debug_kmem" = yes; then |
113 | AC_MSG_RESULT([yes]) | |
57d86234 | 114 | AC_DEFINE([DEBUG_KMEM], [1], |
115 | [Define to 1 to enable kmem debugging]) | |
475cdc78 | 116 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM" |
117 | else | |
118 | AC_MSG_RESULT([no]) | |
57d86234 | 119 | fi |
57d86234 | 120 | ]) |
121 | ||
122 | AC_DEFUN([SPL_AC_DEBUG_MUTEX], [ | |
123 | AC_MSG_CHECKING([whether mutex debugging is enabled]) | |
124 | AC_ARG_ENABLE( [debug-mutex], | |
125 | AS_HELP_STRING([--enable-debug-mutex], | |
126 | [Enable mutex debug support (default off)]), | |
127 | [ case "$enableval" in | |
475cdc78 | 128 | yes) spl_ac_debug_mutex=yes ;; |
129 | no) spl_ac_debug_mutex=no ;; | |
57d86234 | 130 | *) AC_MSG_RESULT([Error!]) |
131 | AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-mutex]) ;; | |
132 | esac ] | |
133 | ) | |
475cdc78 | 134 | if test "$spl_ac_debug_mutex" = yes; then |
135 | AC_MSG_RESULT([yes]) | |
57d86234 | 136 | AC_DEFINE([DEBUG_MUTEX], [1], |
137 | [Define to 1 to enable mutex debugging]) | |
475cdc78 | 138 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_MUTEX" |
139 | else | |
140 | AC_MSG_RESULT([no]) | |
57d86234 | 141 | fi |
57d86234 | 142 | ]) |
143 | ||
144 | AC_DEFUN([SPL_AC_DEBUG_KSTAT], [ | |
145 | AC_MSG_CHECKING([whether kstat debugging is enabled]) | |
146 | AC_ARG_ENABLE( [debug-kstat], | |
147 | AS_HELP_STRING([--enable-debug-kstat], | |
148 | [Enable kstat debug support (default off)]), | |
149 | [ case "$enableval" in | |
475cdc78 | 150 | yes) spl_ac_debug_kstat=yes ;; |
151 | no) spl_ac_debug_kstat=no ;; | |
57d86234 | 152 | *) AC_MSG_RESULT([Error!]) |
153 | AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kstat]) ;; | |
154 | esac ] | |
155 | ) | |
475cdc78 | 156 | if test "$spl_ac_debug_kstat" = yes; then |
157 | AC_MSG_RESULT([yes]) | |
57d86234 | 158 | AC_DEFINE([DEBUG_KSTAT], [1], |
159 | [Define to 1 to enable kstat debugging]) | |
475cdc78 | 160 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KSTAT" |
161 | else | |
162 | AC_MSG_RESULT([no]) | |
57d86234 | 163 | fi |
57d86234 | 164 | ]) |
165 | ||
166 | AC_DEFUN([SPL_AC_DEBUG_CALLB], [ | |
167 | AC_MSG_CHECKING([whether callb debugging is enabled]) | |
168 | AC_ARG_ENABLE( [debug-callb], | |
169 | AS_HELP_STRING([--enable-debug-callb], | |
170 | [Enable callb debug support (default off)]), | |
171 | [ case "$enableval" in | |
475cdc78 | 172 | yes) spl_ac_debug_callb=yes ;; |
173 | no) spl_ac_debug_callb=no ;; | |
57d86234 | 174 | *) AC_MSG_RESULT([Error!]) |
175 | AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-callb]) ;; | |
176 | esac ] | |
177 | ) | |
475cdc78 | 178 | if test "$spl_ac_debug_callb" = yes; then |
179 | AC_MSG_RESULT([yes]) | |
57d86234 | 180 | AC_DEFINE([DEBUG_CALLB], [1], |
181 | [Define to 1 to enable callb debugging]) | |
475cdc78 | 182 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_CALLB" |
183 | else | |
184 | AC_MSG_RESULT([no]) | |
57d86234 | 185 | fi |
57d86234 | 186 | ]) |
187 | ||
188 | dnl # | |
189 | dnl # SPL_LINUX_CONFTEST | |
190 | dnl # | |
191 | AC_DEFUN([SPL_LINUX_CONFTEST], [ | |
192 | cat >conftest.c <<_ACEOF | |
193 | $1 | |
194 | _ACEOF | |
195 | ]) | |
196 | ||
197 | dnl # | |
198 | dnl # SPL_LANG_PROGRAM(C)([PROLOGUE], [BODY]) | |
199 | dnl # | |
200 | m4_define([SPL_LANG_PROGRAM], [ | |
201 | $1 | |
202 | int | |
203 | main (void) | |
204 | { | |
205 | dnl Do *not* indent the following line: there may be CPP directives. | |
206 | dnl Don't move the `;' right after for the same reason. | |
207 | $2 | |
208 | ; | |
209 | return 0; | |
210 | } | |
211 | ]) | |
212 | ||
213 | dnl # | |
214 | dnl # SPL_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE | |
215 | dnl # | |
216 | AC_DEFUN([SPL_LINUX_COMPILE_IFELSE], [ | |
217 | m4_ifvaln([$1], [SPL_LINUX_CONFTEST([$1])])dnl | |
218 | rm -f build/conftest.o build/conftest.mod.c build/conftest.ko build/Makefile | |
219 | echo "obj-m := conftest.o" >build/Makefile | |
220 | dnl AS_IF([AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" -f $PWD/build/Makefile LINUXINCLUDE="-Iinclude -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 SUBDIRS=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], | |
221 | AS_IF([AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" LINUXINCLUDE="-Iinclude -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) >/dev/null && AC_TRY_COMMAND([$3])], | |
222 | [$4], | |
223 | [_AC_MSG_LOG_CONFTEST | |
224 | m4_ifvaln([$5],[$5])dnl])dnl | |
225 | rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl | |
226 | ]) | |
227 | ||
228 | dnl # | |
229 | dnl # SPL_LINUX_TRY_COMPILE like AC_TRY_COMPILE | |
230 | dnl # | |
231 | AC_DEFUN([SPL_LINUX_TRY_COMPILE], | |
232 | [SPL_LINUX_COMPILE_IFELSE( | |
233 | [AC_LANG_SOURCE([SPL_LANG_PROGRAM([[$1]], [[$2]])])], | |
234 | [modules], | |
235 | [test -s build/conftest.o], | |
236 | [$3], [$4]) | |
237 | ]) | |
238 | ||
239 | dnl # | |
240 | dnl # SPL_LINUX_CONFIG | |
241 | dnl # | |
242 | AC_DEFUN([SPL_LINUX_CONFIG], | |
243 | [AC_MSG_CHECKING([whether Linux was built with CONFIG_$1]) | |
244 | SPL_LINUX_TRY_COMPILE([ | |
245 | #ifndef AUTOCONF_INCLUDED | |
246 | #include <linux/config.h> | |
247 | #endif | |
248 | ],[ | |
249 | #ifndef CONFIG_$1 | |
250 | #error CONFIG_$1 not #defined | |
251 | #endif | |
252 | ],[ | |
253 | AC_MSG_RESULT([yes]) | |
254 | $2 | |
255 | ],[ | |
256 | AC_MSG_RESULT([no]) | |
257 | $3 | |
258 | ]) | |
259 | ]) | |
260 | ||
261 | dnl # | |
262 | dnl # SPL_CHECK_SYMBOL_EXPORT | |
263 | dnl # check symbol exported or not | |
264 | dnl # | |
265 | AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], | |
266 | [AC_MSG_CHECKING([whether symbol $1 is exported]) | |
267 | grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/Module.symvers 2>/dev/null | |
268 | rc=$? | |
269 | if test $rc -ne 0; then | |
270 | export=0 | |
271 | for file in $2; do | |
272 | grep -q -E "EXPORT_SYMBOL.*($1)" "$LINUX/$file" 2>/dev/null | |
273 | rc=$? | |
274 | if test $rc -eq 0; then | |
275 | export=1 | |
276 | break; | |
277 | fi | |
278 | done | |
279 | if test $export -eq 0; then | |
280 | AC_MSG_RESULT([no]) | |
281 | $4 | |
282 | else | |
283 | AC_MSG_RESULT([yes]) | |
284 | $3 | |
285 | fi | |
286 | else | |
287 | AC_MSG_RESULT([yes]) | |
288 | $3 | |
289 | fi | |
290 | ]) | |
291 | ||
6a6cafbe | 292 | |
293 | ||
57d86234 | 294 | dnl # |
295 | dnl # 2.6.x API change | |
296 | dnl # check if uintptr_t typedef is defined | |
297 | dnl # | |
298 | AC_DEFUN([SPL_AC_TYPE_UINTPTR_T], | |
299 | [AC_MSG_CHECKING([whether kernel defines uintptr_t]) | |
300 | SPL_LINUX_TRY_COMPILE([ | |
301 | #include <linux/types.h> | |
302 | ],[ | |
303 | uintptr_t *ptr; | |
304 | ],[ | |
305 | AC_MSG_RESULT([yes]) | |
306 | AC_DEFINE(HAVE_UINTPTR_T, 1, | |
307 | [kernel defines uintptr_t]) | |
308 | ],[ | |
309 | AC_MSG_RESULT([no]) | |
310 | ]) | |
311 | ]) | |
312 | ||
57d86234 | 313 | dnl # |
314 | dnl # 2.6.19 API change | |
315 | dnl # panic_notifier_list use atomic_notifier operations | |
316 | dnl # | |
317 | ||
318 | AC_DEFUN([SPL_AC_ATOMIC_PANIC_NOTIFIER], | |
319 | [AC_MSG_CHECKING([whether panic_notifier_list is atomic]) | |
320 | SPL_LINUX_TRY_COMPILE([ | |
321 | #include <linux/notifier.h> | |
322 | #include <linux/kernel.h> | |
323 | ],[ | |
324 | struct atomic_notifier_head panic_notifier_list; | |
325 | ],[ | |
326 | AC_MSG_RESULT(yes) | |
327 | AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1, | |
328 | [panic_notifier_list is atomic]) | |
329 | ],[ | |
330 | AC_MSG_RESULT(no) | |
331 | ]) | |
332 | ]) | |
333 | ||
334 | dnl # | |
335 | dnl # 2.6.20 API change | |
336 | dnl # INIT_WORK use 2 args and not store data inside | |
337 | dnl # | |
338 | AC_DEFUN([SPL_AC_3ARGS_INIT_WORK], | |
339 | [AC_MSG_CHECKING([whether INIT_WORK wants 3 args]) | |
340 | SPL_LINUX_TRY_COMPILE([ | |
341 | #include <linux/workqueue.h> | |
342 | ],[ | |
343 | struct work_struct work; | |
344 | ||
345 | INIT_WORK(&work, NULL, NULL); | |
346 | ],[ | |
347 | AC_MSG_RESULT(yes) | |
348 | AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1, | |
349 | [INIT_WORK wants 3 args]) | |
350 | ],[ | |
351 | AC_MSG_RESULT(no) | |
352 | ]) | |
353 | ]) | |
354 | ||
355 | dnl # | |
356 | dnl # 2.6.21 api change. | |
357 | dnl # 'register_sysctl_table' use only one argument instead of two | |
358 | dnl # | |
359 | AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL], | |
360 | [AC_MSG_CHECKING([whether register_sysctl_table() wants 2 args]) | |
361 | SPL_LINUX_TRY_COMPILE([ | |
362 | #include <linux/sysctl.h> | |
363 | ],[ | |
364 | return register_sysctl_table(NULL,0); | |
365 | ],[ | |
366 | AC_MSG_RESULT(yes) | |
367 | AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1, | |
368 | [register_sysctl_table() wants 2 args]) | |
369 | ],[ | |
370 | AC_MSG_RESULT(no) | |
371 | ]) | |
372 | ]) | |
373 | ||
57d86234 | 374 | dnl # |
375 | dnl # 2.6.x API change | |
376 | dnl # Old set_shrinker API replaced with register_shrinker | |
377 | dnl # | |
378 | AC_DEFUN([SPL_AC_SET_SHRINKER], [ | |
379 | AC_MSG_CHECKING([whether set_shrinker() available]) | |
380 | SPL_LINUX_TRY_COMPILE([ | |
381 | #include <linux/mm.h> | |
382 | ],[ | |
383 | return set_shrinker(DEFAULT_SEEKS, NULL); | |
384 | ],[ | |
385 | AC_MSG_RESULT([yes]) | |
386 | AC_DEFINE(HAVE_SET_SHRINKER, 1, | |
387 | [set_shrinker() available]) | |
388 | ],[ | |
389 | AC_MSG_RESULT([no]) | |
390 | ]) | |
391 | ]) | |
392 | ||
393 | dnl # | |
394 | dnl # 2.6.x API change | |
395 | dnl # struct path entry added to struct nameidata | |
396 | dnl # | |
397 | AC_DEFUN([SPL_AC_PATH_IN_NAMEIDATA], | |
398 | [AC_MSG_CHECKING([whether struct path used in struct nameidata]) | |
399 | SPL_LINUX_TRY_COMPILE([ | |
400 | #include <linux/namei.h> | |
401 | ],[ | |
402 | struct nameidata nd; | |
403 | ||
404 | nd.path.mnt = NULL; | |
405 | nd.path.dentry = NULL; | |
406 | ],[ | |
407 | AC_MSG_RESULT(yes) | |
408 | AC_DEFINE(HAVE_PATH_IN_NAMEIDATA, 1, | |
409 | [struct path used in struct nameidata]) | |
410 | ],[ | |
411 | AC_MSG_RESULT(no) | |
412 | ]) | |
413 | ]) | |
414 | ||
415 | dnl # | |
416 | dnl # Custom SPL patch may export this system it is not required | |
417 | dnl # | |
418 | AC_DEFUN([SPL_AC_TASK_CURR], [ | |
419 | SPL_CHECK_SYMBOL_EXPORT([task_curr], [kernel/sched.c], | |
420 | [AC_DEFINE(HAVE_TASK_CURR, 1, [task_curr() exported])], | |
421 | []) | |
422 | ]) | |
423 | ||
424 | dnl # | |
425 | dnl # 2.6.x API change | |
426 | dnl # Use CTL_UNNUMBERED when binary sysctl is not required | |
427 | dnl # | |
428 | AC_DEFUN([SPL_AC_CTL_UNNUMBERED], | |
429 | [AC_MSG_CHECKING([whether unnumbered sysctl support exists]) | |
430 | SPL_LINUX_TRY_COMPILE([ | |
431 | #include <linux/sysctl.h> | |
432 | ],[ | |
433 | #ifndef CTL_UNNUMBERED | |
434 | #error CTL_UNNUMBERED undefined | |
435 | #endif | |
436 | ],[ | |
437 | AC_MSG_RESULT(yes) | |
438 | AC_DEFINE(HAVE_CTL_UNNUMBERED, 1, | |
439 | [unnumbered sysctl support exists]) | |
440 | ],[ | |
441 | AC_MSG_RESULT(no) | |
442 | ]) | |
443 | ]) | |
877a32e9 | 444 | |
445 | dnl # | |
446 | dnl # 2.6.16 API change. | |
447 | dnl # Check if 'fls64()' is available | |
448 | dnl # | |
449 | AC_DEFUN([SPL_AC_FLS64], | |
6a6cafbe | 450 | [AC_MSG_CHECKING([whether fls64() is available]) |
451 | SPL_LINUX_TRY_COMPILE([ | |
452 | #include <linux/bitops.h> | |
453 | ],[ | |
454 | return fls64(0); | |
455 | ],[ | |
456 | AC_MSG_RESULT(yes) | |
457 | AC_DEFINE(HAVE_FLS64, 1, [fls64() is available]) | |
458 | ],[ | |
459 | AC_MSG_RESULT(no) | |
460 | ]) | |
877a32e9 | 461 | ]) |
46c685d0 | 462 | |
463 | dnl # | |
464 | dnl # 2.6.18 API change, check whether device_create() is available. | |
465 | dnl # Device_create() was introduced in 2.6.18 and depricated | |
466 | dnl # class_device_create() which was fully removed in 2.6.26. | |
467 | dnl # | |
468 | AC_DEFUN([SPL_AC_DEVICE_CREATE], [ | |
469 | SPL_CHECK_SYMBOL_EXPORT( | |
470 | [device_create], | |
471 | [drivers/base/core.c], | |
472 | [AC_DEFINE(HAVE_DEVICE_CREATE, 1, | |
473 | [device_create() is available])], | |
6a6cafbe | 474 | []) |
46c685d0 | 475 | ]) |
476 | ||
477 | dnl # | |
478 | dnl # 2.6.13 API change, check whether class_device_create() is available. | |
479 | dnl # Class_device_create() was introduced in 2.6.13 and depricated | |
480 | dnl # class_simple_device_add() which was fully removed in 2.6.13. | |
481 | dnl # | |
482 | AC_DEFUN([SPL_AC_CLASS_DEVICE_CREATE], [ | |
483 | SPL_CHECK_SYMBOL_EXPORT( | |
484 | [class_device_create], | |
485 | [drivers/base/class.c], | |
486 | [AC_DEFINE(HAVE_CLASS_DEVICE_CREATE, 1, | |
487 | [class_device_create() is available])], | |
6a6cafbe | 488 | []) |
46c685d0 | 489 | ]) |
6a6cafbe | 490 | |
491 | dnl # | |
492 | dnl # 2.6.26 API change, set_normalized_timespec() is exported. | |
493 | dnl # | |
494 | AC_DEFUN([SPL_AC_CLASS_DEVICE_CREATE], [ | |
495 | SPL_CHECK_SYMBOL_EXPORT( | |
496 | [class_device_create], | |
497 | [drivers/base/class.c], | |
498 | [AC_DEFINE(HAVE_CLASS_DEVICE_CREATE, 1, | |
499 | [class_device_create() is available])], | |
500 | []) | |
501 | ]) | |
502 | ||
503 | dnl # | |
504 | dnl # 2.6.26 API change, set_normalized_timespec() is exported. | |
505 | dnl # | |
506 | AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_EXPORT], [ | |
507 | SPL_CHECK_SYMBOL_EXPORT( | |
508 | [set_normalized_timespec], | |
509 | [kernel/time.c], | |
510 | [AC_DEFINE(HAVE_SET_NORMALIZED_TIMESPEC_EXPORT, 1, | |
511 | [set_normalized_timespec() is available as export])], | |
512 | []) | |
513 | ]) | |
514 | ||
515 | dnl # | |
516 | dnl # 2.6.16 API change, set_normalize_timespec() moved to time.c | |
517 | dnl # previously it was available in time.h as an inline. | |
518 | dnl # | |
519 | AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE], | |
520 | [AC_MSG_CHECKING([whether set_normalized_timespec() is an inline]) | |
521 | SPL_LINUX_TRY_COMPILE([ | |
522 | #include <linux/time.h> | |
523 | ],[ | |
524 | void set_normalized_timespec(struct timespec *ts, | |
525 | time_t sec, long nsec) { } | |
526 | ],[ | |
527 | AC_MSG_RESULT(no) | |
528 | ],[ | |
529 | AC_MSG_RESULT(yes) | |
530 | AC_DEFINE(HAVE_SET_NORMALIZED_TIMESPEC_INLINE, 1, | |
531 | [set_normalized_timespec() is available as inline]) | |
532 | ]) | |
533 | ]) | |
534 | ||
535 | dnl # | |
536 | dnl # 2.6.18 API change, | |
537 | dnl # timespec_sub() inline function available in linux/time.h | |
538 | dnl # | |
539 | AC_DEFUN([SPL_AC_TIMESPEC_SUB], | |
540 | [AC_MSG_CHECKING([whether timespec_sub() is available]) | |
541 | SPL_LINUX_TRY_COMPILE([ | |
542 | #include <linux/time.h> | |
543 | ],[ | |
544 | struct timespec a, b, c = { 0 }; | |
545 | c = timespec_sub(a, b); | |
546 | ],[ | |
547 | AC_MSG_RESULT(yes) | |
548 | AC_DEFINE(HAVE_TIMESPEC_SUB, 1, [timespec_sub() is available]) | |
549 | ],[ | |
550 | AC_MSG_RESULT(no) | |
551 | ]) | |
552 | ]) | |
553 |