]>
Commit | Line | Data |
---|---|---|
716154c5 BB |
1 | ############################################################################### |
2 | # Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. | |
3 | # Copyright (C) 2007 The Regents of the University of California. | |
4 | # Written by Brian Behlendorf <behlendorf1@llnl.gov>. | |
5 | ############################################################################### | |
6 | # SPL_AC_CONFIG_KERNEL: Default SPL kernel configuration. | |
7 | ############################################################################### | |
8 | ||
86933a6e BB |
9 | AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ |
10 | SPL_AC_KERNEL | |
11 | ||
86933a6e BB |
12 | dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other |
13 | dnl # compiler options are added by the kernel build system. | |
14 | abs_srcdir=`readlink -f ${srcdir}` | |
15 | KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes -Werror" | |
16b719f0 BB |
16 | KERNELCPPFLAGS="$KERNELCPPFLAGS -I${abs_srcdir}/include" |
17 | KERNELCPPFLAGS="$KERNELCPPFLAGS -include ${abs_srcdir}/spl_config.h" | |
86933a6e BB |
18 | |
19 | if test "${LINUX_OBJ}" != "${LINUX}"; then | |
20 | KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" | |
21 | fi | |
22 | ||
23 | AC_SUBST(KERNELMAKE_PARAMS) | |
24 | AC_SUBST(KERNELCPPFLAGS) | |
25 | ||
26 | SPL_AC_DEBUG | |
27 | SPL_AC_DEBUG_KMEM | |
055ffd98 | 28 | SPL_AC_DEBUG_KMEM_TRACKING |
5e9b5d83 | 29 | SPL_AC_ATOMIC_SPINLOCK |
302b88e6 BB |
30 | SPL_AC_TYPE_ATOMIC64_CMPXCHG |
31 | SPL_AC_TYPE_ATOMIC64_XCHG | |
d04c8a56 | 32 | SPL_AC_TYPE_UINTPTR_T |
86933a6e BB |
33 | SPL_AC_3ARGS_INIT_WORK |
34 | SPL_AC_2ARGS_REGISTER_SYSCTL | |
35 | SPL_AC_SET_SHRINKER | |
36 | SPL_AC_PATH_IN_NAMEIDATA | |
37 | SPL_AC_TASK_CURR | |
38 | SPL_AC_CTL_UNNUMBERED | |
39 | SPL_AC_FLS64 | |
40 | SPL_AC_DEVICE_CREATE | |
41 | SPL_AC_5ARGS_DEVICE_CREATE | |
42 | SPL_AC_CLASS_DEVICE_CREATE | |
43 | SPL_AC_SET_NORMALIZED_TIMESPEC_EXPORT | |
44 | SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE | |
45 | SPL_AC_TIMESPEC_SUB | |
46 | SPL_AC_INIT_UTSNAME | |
47 | SPL_AC_FDTABLE_HEADER | |
48 | SPL_AC_FILES_FDTABLE | |
49 | SPL_AC_UACCESS_HEADER | |
50 | SPL_AC_KMALLOC_NODE | |
51 | SPL_AC_MONOTONIC_CLOCK | |
52 | SPL_AC_INODE_I_MUTEX | |
4d54fdee | 53 | SPL_AC_MUTEX_OWNER |
86933a6e BB |
54 | SPL_AC_MUTEX_LOCK_NESTED |
55 | SPL_AC_DIV64_64 | |
56 | SPL_AC_DIV64_U64 | |
57 | SPL_AC_3ARGS_ON_EACH_CPU | |
58 | SPL_AC_KALLSYMS_LOOKUP_NAME | |
59 | SPL_AC_GET_VMALLOC_INFO | |
60 | SPL_AC_PGDAT_HELPERS | |
61 | SPL_AC_FIRST_ONLINE_PGDAT | |
62 | SPL_AC_NEXT_ONLINE_PGDAT | |
63 | SPL_AC_NEXT_ZONE | |
64 | SPL_AC_PGDAT_LIST | |
86933a6e | 65 | SPL_AC_GLOBAL_PAGE_STATE |
6ae7fef5 BB |
66 | SPL_AC_ZONE_STAT_ITEM_FREE |
67 | SPL_AC_ZONE_STAT_ITEM_INACTIVE | |
68 | SPL_AC_ZONE_STAT_ITEM_ACTIVE | |
69 | SPL_AC_GET_ZONE_COUNTS | |
51a727e9 BB |
70 | SPL_AC_SET_FS_PWD |
71 | SPL_AC_2ARGS_SET_FS_PWD | |
86933a6e BB |
72 | SPL_AC_2ARGS_VFS_UNLINK |
73 | SPL_AC_4ARGS_VFS_RENAME | |
ec7d53e9 BB |
74 | SPL_AC_CRED_STRUCT |
75 | SPL_AC_GROUPS_SEARCH | |
e811949a | 76 | SPL_AC_PUT_TASK_STRUCT |
3977f837 | 77 | SPL_AC_5ARGS_PROC_HANDLER |
b868e22f | 78 | SPL_AC_KVASPRINTF |
86933a6e BB |
79 | ]) |
80 | ||
81 | AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ | |
bb339d06 | 82 | modpost=$LINUX/scripts/Makefile.modpost |
86933a6e | 83 | AC_MSG_CHECKING([kernel file name for module symbols]) |
bb339d06 BB |
84 | if test -f "$modpost"; then |
85 | if grep -q Modules.symvers $modpost; then | |
86 | LINUX_SYMBOLS=Modules.symvers | |
87 | else | |
88 | LINUX_SYMBOLS=Module.symvers | |
89 | fi | |
86933a6e | 90 | else |
bb339d06 | 91 | LINUX_SYMBOLS=NONE |
86933a6e BB |
92 | fi |
93 | AC_MSG_RESULT($LINUX_SYMBOLS) | |
94 | AC_SUBST(LINUX_SYMBOLS) | |
95 | ]) | |
96 | ||
57d86234 | 97 | AC_DEFUN([SPL_AC_KERNEL], [ |
57d86234 | 98 | AC_ARG_WITH([linux], |
99 | AS_HELP_STRING([--with-linux=PATH], | |
100 | [Path to kernel source]), | |
39a3d2a4 | 101 | [kernelsrc="$withval"]) |
57d86234 | 102 | |
103 | AC_ARG_WITH([linux-obj], | |
104 | AS_HELP_STRING([--with-linux-obj=PATH], | |
105 | [Path to kernel build objects]), | |
106 | [kernelbuild="$withval"]) | |
107 | ||
108 | AC_MSG_CHECKING([kernel source directory]) | |
109 | if test -z "$kernelsrc"; then | |
534c4e38 BM |
110 | headersdir="/lib/modules/$(uname -r)/build" |
111 | if test -e "$headersdir"; then | |
112 | sourcelink=$(readlink -f "$headersdir") | |
113 | else | |
114 | sourcelink=$(ls -1d /usr/src/kernels/* \ | |
115 | /usr/src/linux-* \ | |
116 | 2>/dev/null | grep -v obj | tail -1) | |
117 | fi | |
57d86234 | 118 | |
d4326403 BB |
119 | if test -e ${sourcelink}; then |
120 | kernelsrc=`readlink -f ${sourcelink}` | |
d4326403 | 121 | else |
57d86234 | 122 | AC_MSG_RESULT([Not found]) |
123 | AC_MSG_ERROR([ | |
124 | *** Please specify the location of the kernel source | |
6a1c3d41 | 125 | *** with the '--with-linux=PATH' option]) |
57d86234 | 126 | fi |
c5f70460 BB |
127 | else |
128 | if test "$kernelsrc" = "NONE"; then | |
129 | kernsrcver=NONE | |
130 | fi | |
57d86234 | 131 | fi |
132 | ||
133 | AC_MSG_RESULT([$kernelsrc]) | |
134 | AC_MSG_CHECKING([kernel build directory]) | |
39a3d2a4 | 135 | if test -z "$kernelbuild"; then |
749e5eb1 | 136 | if test -d ${kernelsrc}-obj/`arch`/`arch`; then |
39a3d2a4 | 137 | kernelbuild=${kernelsrc}-obj/`arch`/`arch` |
749e5eb1 BB |
138 | elif test -d ${kernelsrc}-obj/`arch`/default; then |
139 | kernelbuild=${kernelsrc}-obj/`arch`/default | |
39a3d2a4 BB |
140 | elif test -d `dirname ${kernelsrc}`/build-`arch`; then |
141 | kernelbuild=`dirname ${kernelsrc}`/build-`arch` | |
142 | else | |
143 | kernelbuild=${kernelsrc} | |
144 | fi | |
bf338d8d | 145 | fi |
57d86234 | 146 | AC_MSG_RESULT([$kernelbuild]) |
147 | ||
148 | AC_MSG_CHECKING([kernel source version]) | |
149 | if test -r $kernelbuild/include/linux/version.h && | |
150 | fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then | |
151 | ||
152 | kernsrcver=`(echo "#include <linux/version.h>"; | |
153 | echo "kernsrcver=UTS_RELEASE") | | |
d4326403 | 154 | cpp -I $kernelbuild/include | |
57d86234 | 155 | grep "^kernsrcver=" | cut -d \" -f 2` |
156 | ||
157 | elif test -r $kernelbuild/include/linux/utsrelease.h && | |
158 | fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then | |
159 | ||
160 | kernsrcver=`(echo "#include <linux/utsrelease.h>"; | |
161 | echo "kernsrcver=UTS_RELEASE") | | |
d4326403 | 162 | cpp -I $kernelbuild/include | |
57d86234 | 163 | grep "^kernsrcver=" | cut -d \" -f 2` |
164 | fi | |
165 | ||
166 | if test -z "$kernsrcver"; then | |
167 | AC_MSG_RESULT([Not found]) | |
168 | AC_MSG_ERROR([ | |
169 | *** Cannot determine the version of the linux kernel source. | |
170 | *** Please prepare the kernel before running this script]) | |
171 | fi | |
172 | ||
173 | AC_MSG_RESULT([$kernsrcver]) | |
174 | ||
57d86234 | 175 | LINUX=${kernelsrc} |
176 | LINUX_OBJ=${kernelbuild} | |
c5f70460 BB |
177 | LINUX_VERSION=${kernsrcver} |
178 | ||
57d86234 | 179 | AC_SUBST(LINUX) |
180 | AC_SUBST(LINUX_OBJ) | |
c5f70460 | 181 | AC_SUBST(LINUX_VERSION) |
57d86234 | 182 | |
86933a6e | 183 | SPL_AC_MODULE_SYMVERS |
2e0e7e69 BB |
184 | ]) |
185 | ||
86933a6e BB |
186 | dnl # |
187 | dnl # Default SPL user configuration | |
188 | dnl # | |
189 | AC_DEFUN([SPL_AC_CONFIG_USER], []) | |
190 | ||
6a1c3d41 | 191 | AC_DEFUN([SPL_AC_LICENSE], [ |
86933a6e BB |
192 | AC_MSG_CHECKING([spl license]) |
193 | LICENSE=GPL | |
194 | AC_MSG_RESULT([$LICENSE]) | |
6a1c3d41 | 195 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DHAVE_GPL_ONLY_SYMBOLS" |
86933a6e BB |
196 | AC_SUBST(LICENSE) |
197 | ]) | |
198 | ||
199 | AC_DEFUN([SPL_AC_CONFIG], [ | |
200 | SPL_CONFIG=all | |
201 | AC_ARG_WITH([config], | |
202 | AS_HELP_STRING([--with-config=CONFIG], | |
c1541dfe | 203 | [Config file 'kernel|user|all|srpm']), |
86933a6e BB |
204 | [SPL_CONFIG="$withval"]) |
205 | ||
206 | AC_MSG_CHECKING([spl config]) | |
207 | AC_MSG_RESULT([$SPL_CONFIG]); | |
208 | AC_SUBST(SPL_CONFIG) | |
209 | ||
210 | case "$SPL_CONFIG" in | |
211 | kernel) SPL_AC_CONFIG_KERNEL ;; | |
212 | user) SPL_AC_CONFIG_USER ;; | |
213 | all) SPL_AC_CONFIG_KERNEL | |
214 | SPL_AC_CONFIG_USER ;; | |
c1541dfe | 215 | srpm) ;; |
86933a6e BB |
216 | *) |
217 | AC_MSG_RESULT([Error!]) | |
218 | AC_MSG_ERROR([Bad value "$SPL_CONFIG" for --with-config, | |
c1541dfe | 219 | user kernel|user|all|srpm]) ;; |
86933a6e BB |
220 | esac |
221 | ||
222 | AM_CONDITIONAL([CONFIG_USER], | |
223 | [test "$SPL_CONFIG" = user] || | |
224 | [test "$SPL_CONFIG" = all]) | |
225 | AM_CONDITIONAL([CONFIG_KERNEL], | |
226 | [test "$SPL_CONFIG" = kernel] || | |
227 | [test "$SPL_CONFIG" = all]) | |
6a1c3d41 | 228 | ]) |
229 | ||
055ffd98 BB |
230 | dnl # |
231 | dnl # Enable if the SPL should be compiled with internal debugging enabled. | |
232 | dnl # By default this support is disabled. | |
233 | dnl # | |
57d86234 | 234 | AC_DEFUN([SPL_AC_DEBUG], [ |
055ffd98 BB |
235 | AC_ARG_ENABLE([debug], |
236 | [AS_HELP_STRING([--enable-debug], | |
237 | [Enable generic debug support @<:@default=no@:>@])], | |
238 | [], | |
239 | [enable_debug=no]) | |
240 | ||
241 | AS_IF([test "x$enable_debug" = xyes], | |
242 | [KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG"], | |
243 | [KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"]) | |
244 | ||
57d86234 | 245 | AC_MSG_CHECKING([whether debugging is enabled]) |
055ffd98 | 246 | AC_MSG_RESULT([$enable_debug]) |
57d86234 | 247 | ]) |
248 | ||
055ffd98 BB |
249 | dnl # |
250 | dnl # Enabled by default it provides a minimal level of memory tracking. | |
251 | dnl # A total count of bytes allocated is kept for each alloc and free. | |
252 | dnl # Then at module unload time a report to the console will be printed | |
253 | dnl # if memory was leaked. Additionally, /proc/spl/kmem/slab will exist | |
254 | dnl # and provide an easy way to inspect the kmem based slab. | |
255 | dnl # | |
57d86234 | 256 | AC_DEFUN([SPL_AC_DEBUG_KMEM], [ |
055ffd98 BB |
257 | AC_ARG_ENABLE([debug-kmem], |
258 | [AS_HELP_STRING([--enable-debug-kmem], | |
259 | [Enable basic kmem accounting @<:@default=yes@:>@])], | |
260 | [], | |
261 | [enable_debug_kmem=yes]) | |
57d86234 | 262 | |
055ffd98 BB |
263 | AS_IF([test "x$enable_debug_kmem" = xyes], |
264 | [AC_DEFINE([DEBUG_KMEM], [1], | |
265 | [Define to 1 to enable basic kmem accounting]) | |
266 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"]) | |
267 | ||
268 | AC_MSG_CHECKING([whether basic kmem accounting is enabled]) | |
269 | AC_MSG_RESULT([$enable_debug_kmem]) | |
57d86234 | 270 | ]) |
271 | ||
055ffd98 BB |
272 | dnl # |
273 | dnl # Disabled by default it provides detailed memory tracking. This | |
274 | dnl # feature also requires --enable-debug-kmem to be set. When enabled | |
275 | dnl # not only will total bytes be tracked but also the location of every | |
276 | dnl # alloc and free. When the SPL module is unloaded a list of all leaked | |
277 | dnl # addresses and where they were allocated will be dumped to the console. | |
278 | dnl # Enabling this feature has a significant impact on performance but it | |
279 | dnl # makes finding memory leaks pretty straight forward. | |
280 | dnl # | |
281 | AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [ | |
282 | AC_ARG_ENABLE([debug-kmem-tracking], | |
283 | [AS_HELP_STRING([--enable-debug-kmem-tracking], | |
284 | [Enable detailed kmem tracking @<:@default=no@:>@])], | |
285 | [], | |
286 | [enable_debug_kmem_tracking=no]) | |
287 | ||
288 | AS_IF([test "x$enable_debug_kmem_tracking" = xyes], | |
289 | [AC_DEFINE([DEBUG_KMEM_TRACKING], [1], | |
290 | [Define to 1 to enable detailed kmem tracking]) | |
291 | KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"]) | |
292 | ||
293 | AC_MSG_CHECKING([whether detailed kmem tracking is enabled]) | |
294 | AC_MSG_RESULT([$enable_debug_kmem_tracking]) | |
57d86234 | 295 | ]) |
296 | ||
297 | dnl # | |
298 | dnl # SPL_LINUX_CONFTEST | |
299 | dnl # | |
300 | AC_DEFUN([SPL_LINUX_CONFTEST], [ | |
301 | cat >conftest.c <<_ACEOF | |
302 | $1 | |
303 | _ACEOF | |
304 | ]) | |
305 | ||
306 | dnl # | |
307 | dnl # SPL_LANG_PROGRAM(C)([PROLOGUE], [BODY]) | |
308 | dnl # | |
309 | m4_define([SPL_LANG_PROGRAM], [ | |
310 | $1 | |
311 | int | |
312 | main (void) | |
313 | { | |
314 | dnl Do *not* indent the following line: there may be CPP directives. | |
315 | dnl Don't move the `;' right after for the same reason. | |
316 | $2 | |
317 | ; | |
318 | return 0; | |
319 | } | |
320 | ]) | |
321 | ||
322 | dnl # | |
323 | dnl # SPL_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE | |
324 | dnl # | |
325 | AC_DEFUN([SPL_LINUX_COMPILE_IFELSE], [ | |
c5f70460 BB |
326 | m4_ifvaln([$1], [SPL_LINUX_CONFTEST([$1])]) |
327 | rm -Rf build && mkdir -p build | |
328 | echo "obj-m := conftest.o" >build/Makefile | |
329 | AS_IF( | |
3d0cb2d3 | 330 | [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], |
c5f70460 BB |
331 | [$4], |
332 | [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] | |
333 | ) | |
334 | rm -Rf build | |
57d86234 | 335 | ]) |
336 | ||
337 | dnl # | |
338 | dnl # SPL_LINUX_TRY_COMPILE like AC_TRY_COMPILE | |
339 | dnl # | |
340 | AC_DEFUN([SPL_LINUX_TRY_COMPILE], | |
341 | [SPL_LINUX_COMPILE_IFELSE( | |
d50bd9e2 | 342 | [AC_LANG_SOURCE([SPL_LANG_PROGRAM([[$1]], [[$2]])])], |
343 | [modules], | |
344 | [test -s build/conftest.o], | |
345 | [$3], [$4]) | |
57d86234 | 346 | ]) |
347 | ||
348 | dnl # | |
349 | dnl # SPL_LINUX_CONFIG | |
350 | dnl # | |
351 | AC_DEFUN([SPL_LINUX_CONFIG], | |
352 | [AC_MSG_CHECKING([whether Linux was built with CONFIG_$1]) | |
353 | SPL_LINUX_TRY_COMPILE([ | |
354 | #ifndef AUTOCONF_INCLUDED | |
355 | #include <linux/config.h> | |
356 | #endif | |
357 | ],[ | |
358 | #ifndef CONFIG_$1 | |
359 | #error CONFIG_$1 not #defined | |
360 | #endif | |
361 | ],[ | |
362 | AC_MSG_RESULT([yes]) | |
363 | $2 | |
364 | ],[ | |
365 | AC_MSG_RESULT([no]) | |
366 | $3 | |
367 | ]) | |
368 | ]) | |
369 | ||
370 | dnl # | |
371 | dnl # SPL_CHECK_SYMBOL_EXPORT | |
372 | dnl # check symbol exported or not | |
373 | dnl # | |
374 | AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], | |
375 | [AC_MSG_CHECKING([whether symbol $1 is exported]) | |
2e0e7e69 BB |
376 | grep -q -E '[[[:space:]]]$1[[[:space:]]]' \ |
377 | $LINUX_OBJ/Module*.symvers 2>/dev/null | |
57d86234 | 378 | rc=$? |
379 | if test $rc -ne 0; then | |
380 | export=0 | |
381 | for file in $2; do | |
2e0e7e69 BB |
382 | grep -q -E "EXPORT_SYMBOL.*($1)" \ |
383 | "$LINUX_OBJ/$file" 2>/dev/null | |
57d86234 | 384 | rc=$? |
385 | if test $rc -eq 0; then | |
386 | export=1 | |
387 | break; | |
388 | fi | |
389 | done | |
390 | if test $export -eq 0; then | |
391 | AC_MSG_RESULT([no]) | |
392 | $4 | |
393 | else | |
394 | AC_MSG_RESULT([yes]) | |
395 | $3 | |
396 | fi | |
397 | else | |
398 | AC_MSG_RESULT([yes]) | |
399 | $3 | |
400 | fi | |
401 | ]) | |
402 | ||
86de8532 | 403 | dnl # |
404 | dnl # SPL_CHECK_HEADER | |
405 | dnl # check whether header exists and define HAVE_$2_HEADER | |
406 | dnl # | |
407 | AC_DEFUN([SPL_CHECK_HEADER], | |
408 | [AC_MSG_CHECKING([whether header $1 exists]) | |
409 | SPL_LINUX_TRY_COMPILE([ | |
d50bd9e2 | 410 | #include <$1> |
86de8532 | 411 | ],[ |
412 | return 0; | |
413 | ],[ | |
414 | AC_DEFINE(HAVE_$2_HEADER, 1, [$1 exists]) | |
415 | AC_MSG_RESULT(yes) | |
416 | $3 | |
417 | ],[ | |
418 | AC_MSG_RESULT(no) | |
419 | $4 | |
420 | ]) | |
421 | ]) | |
6a6cafbe | 422 | |
57d86234 | 423 | dnl # |
d04c8a56 BB |
424 | dnl # Use the atomic implemenation based on global spinlocks. This |
425 | dnl # should only be needed by 32-bit kernels which do not provide | |
426 | dnl # the atomic64_* API. It may be optionally enabled as a fallback | |
427 | dnl # if problems are observed with the direct mapping to the native | |
428 | dnl # Linux atomic operations. You may not disable atomic spinlocks | |
429 | dnl # if you kernel does not an atomic64_* API. | |
57d86234 | 430 | dnl # |
d04c8a56 BB |
431 | AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [ |
432 | AC_ARG_ENABLE([atomic-spinlocks], | |
433 | [AS_HELP_STRING([--enable-atomic-spinlocks], | |
434 | [Atomic types use spinlocks @<:@default=check@:>@])], | |
435 | [], | |
436 | [enable_atomic_spinlocks=check]) | |
57d86234 | 437 | |
a0f6da3d | 438 | SPL_LINUX_TRY_COMPILE([ |
439 | #include <asm/atomic.h> | |
440 | ],[ | |
441 | atomic64_t *ptr; | |
442 | ],[ | |
d04c8a56 | 443 | have_atomic64_t=yes |
a0f6da3d | 444 | AC_DEFINE(HAVE_ATOMIC64_T, 1, |
d04c8a56 | 445 | [kernel defines atomic64_t]) |
a0f6da3d | 446 | ],[ |
d04c8a56 BB |
447 | have_atomic64_t=no |
448 | ]) | |
449 | ||
450 | AS_IF([test "x$enable_atomic_spinlocks" = xcheck], [ | |
451 | AS_IF([test "x$have_atomic64_t" = xyes], [ | |
452 | enable_atomic_spinlocks=no | |
453 | ],[ | |
454 | enable_atomic_spinlocks=yes | |
455 | ]) | |
a0f6da3d | 456 | ]) |
d04c8a56 BB |
457 | |
458 | AS_IF([test "x$enable_atomic_spinlocks" = xyes], [ | |
459 | AC_DEFINE([ATOMIC_SPINLOCK], [1], | |
460 | [Atomic types use spinlocks]) | |
461 | ],[ | |
462 | AS_IF([test "x$have_atomic64_t" = xno], [ | |
463 | AC_MSG_FAILURE( | |
464 | [--disable-atomic-spinlocks given but required atomic64 support is unavailable]) | |
465 | ]) | |
466 | ]) | |
467 | ||
468 | AC_MSG_CHECKING([whether atomic types use spinlocks]) | |
469 | AC_MSG_RESULT([$enable_atomic_spinlocks]) | |
470 | ||
471 | AC_MSG_CHECKING([whether kernel defines atomic64_t]) | |
472 | AC_MSG_RESULT([$have_atomic64_t]) | |
a0f6da3d | 473 | ]) |
474 | ||
302b88e6 BB |
475 | dnl # |
476 | dnl # 2.6.24 API change, | |
477 | dnl # check if atomic64_cmpxchg is defined | |
478 | dnl # | |
479 | AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG], | |
480 | [AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg]) | |
481 | SPL_LINUX_TRY_COMPILE([ | |
482 | #include <asm/atomic.h> | |
483 | ],[ | |
484 | atomic64_cmpxchg((atomic64_t *)NULL, 0, 0); | |
485 | ],[ | |
486 | AC_MSG_RESULT([yes]) | |
487 | AC_DEFINE(HAVE_ATOMIC64_CMPXCHG, 1, | |
488 | [kernel defines atomic64_cmpxchg]) | |
489 | ],[ | |
490 | AC_MSG_RESULT([no]) | |
491 | ]) | |
492 | ]) | |
493 | ||
494 | dnl # | |
495 | dnl # 2.6.24 API change, | |
496 | dnl # check if atomic64_xchg is defined | |
497 | dnl # | |
498 | AC_DEFUN([SPL_AC_TYPE_ATOMIC64_XCHG], | |
499 | [AC_MSG_CHECKING([whether kernel defines atomic64_xchg]) | |
500 | SPL_LINUX_TRY_COMPILE([ | |
501 | #include <asm/atomic.h> | |
502 | ],[ | |
503 | atomic64_xchg((atomic64_t *)NULL, 0); | |
504 | ],[ | |
505 | AC_MSG_RESULT([yes]) | |
506 | AC_DEFINE(HAVE_ATOMIC64_XCHG, 1, | |
507 | [kernel defines atomic64_xchg]) | |
508 | ],[ | |
509 | AC_MSG_RESULT([no]) | |
510 | ]) | |
511 | ]) | |
512 | ||
d04c8a56 BB |
513 | dnl # |
514 | dnl # 2.6.24 API change, | |
515 | dnl # check if uintptr_t typedef is defined | |
516 | dnl # | |
517 | AC_DEFUN([SPL_AC_TYPE_UINTPTR_T], | |
518 | [AC_MSG_CHECKING([whether kernel defines uintptr_t]) | |
519 | SPL_LINUX_TRY_COMPILE([ | |
520 | #include <linux/types.h> | |
521 | ],[ | |
522 | uintptr_t *ptr; | |
523 | ],[ | |
524 | AC_MSG_RESULT([yes]) | |
525 | AC_DEFINE(HAVE_UINTPTR_T, 1, | |
526 | [kernel defines uintptr_t]) | |
527 | ],[ | |
528 | AC_MSG_RESULT([no]) | |
529 | ]) | |
530 | ]) | |
531 | ||
57d86234 | 532 | dnl # |
3d061e9d | 533 | dnl # 2.6.20 API change, |
57d86234 | 534 | dnl # INIT_WORK use 2 args and not store data inside |
535 | dnl # | |
536 | AC_DEFUN([SPL_AC_3ARGS_INIT_WORK], | |
537 | [AC_MSG_CHECKING([whether INIT_WORK wants 3 args]) | |
538 | SPL_LINUX_TRY_COMPILE([ | |
d50bd9e2 | 539 | #include <linux/workqueue.h> |
57d86234 | 540 | ],[ |
d50bd9e2 | 541 | struct work_struct work; |
542 | INIT_WORK(&work, NULL, NULL); | |
57d86234 | 543 | ],[ |
d50bd9e2 | 544 | AC_MSG_RESULT(yes) |
545 | AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1, | |
546 | [INIT_WORK wants 3 args]) | |
57d86234 | 547 | ],[ |
d50bd9e2 | 548 | AC_MSG_RESULT(no) |
57d86234 | 549 | ]) |
550 | ]) | |
551 | ||
552 | dnl # | |
3d061e9d | 553 | dnl # 2.6.21 API change, |
57d86234 | 554 | dnl # 'register_sysctl_table' use only one argument instead of two |
555 | dnl # | |
556 | AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL], | |
557 | [AC_MSG_CHECKING([whether register_sysctl_table() wants 2 args]) | |
558 | SPL_LINUX_TRY_COMPILE([ | |
d50bd9e2 | 559 | #include <linux/sysctl.h> |
57d86234 | 560 | ],[ |
d50bd9e2 | 561 | return register_sysctl_table(NULL,0); |
57d86234 | 562 | ],[ |
d50bd9e2 | 563 | AC_MSG_RESULT(yes) |
564 | AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1, | |
565 | [register_sysctl_table() wants 2 args]) | |
57d86234 | 566 | ],[ |
d50bd9e2 | 567 | AC_MSG_RESULT(no) |
57d86234 | 568 | ]) |
569 | ]) | |
570 | ||
57d86234 | 571 | dnl # |
3d061e9d | 572 | dnl # 2.6.23 API change |
57d86234 | 573 | dnl # Old set_shrinker API replaced with register_shrinker |
574 | dnl # | |
575 | AC_DEFUN([SPL_AC_SET_SHRINKER], [ | |
576 | AC_MSG_CHECKING([whether set_shrinker() available]) | |
577 | SPL_LINUX_TRY_COMPILE([ | |
578 | #include <linux/mm.h> | |
579 | ],[ | |
580 | return set_shrinker(DEFAULT_SEEKS, NULL); | |
581 | ],[ | |
582 | AC_MSG_RESULT([yes]) | |
583 | AC_DEFINE(HAVE_SET_SHRINKER, 1, | |
584 | [set_shrinker() available]) | |
585 | ],[ | |
586 | AC_MSG_RESULT([no]) | |
587 | ]) | |
588 | ]) | |
589 | ||
590 | dnl # | |
3d061e9d | 591 | dnl # 2.6.25 API change, |
57d86234 | 592 | dnl # struct path entry added to struct nameidata |
593 | dnl # | |
594 | AC_DEFUN([SPL_AC_PATH_IN_NAMEIDATA], | |
595 | [AC_MSG_CHECKING([whether struct path used in struct nameidata]) | |
596 | SPL_LINUX_TRY_COMPILE([ | |
d50bd9e2 | 597 | #include <linux/namei.h> |
57d86234 | 598 | ],[ |
d50bd9e2 | 599 | struct nameidata nd; |
57d86234 | 600 | |
601 | nd.path.mnt = NULL; | |
602 | nd.path.dentry = NULL; | |
603 | ],[ | |
d50bd9e2 | 604 | AC_MSG_RESULT(yes) |
605 | AC_DEFINE(HAVE_PATH_IN_NAMEIDATA, 1, | |
606 | [struct path used in struct nameidata]) | |
57d86234 | 607 | ],[ |
d50bd9e2 | 608 | AC_MSG_RESULT(no) |
57d86234 | 609 | ]) |
610 | ]) | |
611 | ||
612 | dnl # | |
613 | dnl # Custom SPL patch may export this system it is not required | |
614 | dnl # | |
615 | AC_DEFUN([SPL_AC_TASK_CURR], [ | |
616 | SPL_CHECK_SYMBOL_EXPORT([task_curr], [kernel/sched.c], | |
617 | [AC_DEFINE(HAVE_TASK_CURR, 1, [task_curr() exported])], | |
618 | []) | |
619 | ]) | |
620 | ||
621 | dnl # | |
3d061e9d | 622 | dnl # 2.6.19 API change, |
57d86234 | 623 | dnl # Use CTL_UNNUMBERED when binary sysctl is not required |
624 | dnl # | |
625 | AC_DEFUN([SPL_AC_CTL_UNNUMBERED], | |
626 | [AC_MSG_CHECKING([whether unnumbered sysctl support exists]) | |
627 | SPL_LINUX_TRY_COMPILE([ | |
d50bd9e2 | 628 | #include <linux/sysctl.h> |
57d86234 | 629 | ],[ |
630 | #ifndef CTL_UNNUMBERED | |
631 | #error CTL_UNNUMBERED undefined | |
632 | #endif | |
633 | ],[ | |
d50bd9e2 | 634 | AC_MSG_RESULT(yes) |
635 | AC_DEFINE(HAVE_CTL_UNNUMBERED, 1, | |
636 | [unnumbered sysctl support exists]) | |
57d86234 | 637 | ],[ |
d50bd9e2 | 638 | AC_MSG_RESULT(no) |
57d86234 | 639 | ]) |
640 | ]) | |
877a32e9 | 641 | |
642 | dnl # | |
643 | dnl # 2.6.16 API change. | |
644 | dnl # Check if 'fls64()' is available | |
645 | dnl # | |
646 | AC_DEFUN([SPL_AC_FLS64], | |
6a6cafbe | 647 | [AC_MSG_CHECKING([whether fls64() is available]) |
648 | SPL_LINUX_TRY_COMPILE([ | |
649 | #include <linux/bitops.h> | |
650 | ],[ | |
651 | return fls64(0); | |
652 | ],[ | |
653 | AC_MSG_RESULT(yes) | |
654 | AC_DEFINE(HAVE_FLS64, 1, [fls64() is available]) | |
655 | ],[ | |
656 | AC_MSG_RESULT(no) | |
657 | ]) | |
877a32e9 | 658 | ]) |
46c685d0 | 659 | |
660 | dnl # | |
661 | dnl # 2.6.18 API change, check whether device_create() is available. | |
662 | dnl # Device_create() was introduced in 2.6.18 and depricated | |
663 | dnl # class_device_create() which was fully removed in 2.6.26. | |
664 | dnl # | |
665 | AC_DEFUN([SPL_AC_DEVICE_CREATE], [ | |
666 | SPL_CHECK_SYMBOL_EXPORT( | |
667 | [device_create], | |
668 | [drivers/base/core.c], | |
669 | [AC_DEFINE(HAVE_DEVICE_CREATE, 1, | |
670 | [device_create() is available])], | |
6a6cafbe | 671 | []) |
46c685d0 | 672 | ]) |
673 | ||
8123ac4f BB |
674 | dnl # |
675 | dnl # 2.6.27 API change, | |
676 | dnl # device_create() uses 5 args, new 'drvdata' argument. | |
677 | dnl # | |
678 | AC_DEFUN([SPL_AC_5ARGS_DEVICE_CREATE], [ | |
679 | AC_MSG_CHECKING([whether device_create() wants 5 args]) | |
680 | tmp_flags="$EXTRA_KCFLAGS" | |
681 | EXTRA_KCFLAGS="-Werror" | |
682 | SPL_LINUX_TRY_COMPILE([ | |
683 | #include <linux/device.h> | |
684 | ],[ | |
685 | device_create(NULL, NULL, 0, NULL, "%d", 1); | |
686 | ],[ | |
687 | AC_MSG_RESULT(yes) | |
688 | AC_DEFINE(HAVE_5ARGS_DEVICE_CREATE, 1, | |
689 | [device_create wants 5 args]) | |
690 | ],[ | |
691 | AC_MSG_RESULT(no) | |
692 | ]) | |
693 | EXTRA_KCFLAGS="$tmp_flags" | |
694 | ]) | |
695 | ||
46c685d0 | 696 | dnl # |
697 | dnl # 2.6.13 API change, check whether class_device_create() is available. | |
698 | dnl # Class_device_create() was introduced in 2.6.13 and depricated | |
699 | dnl # class_simple_device_add() which was fully removed in 2.6.13. | |
700 | dnl # | |
701 | AC_DEFUN([SPL_AC_CLASS_DEVICE_CREATE], [ | |
702 | SPL_CHECK_SYMBOL_EXPORT( | |
703 | [class_device_create], | |
704 | [drivers/base/class.c], | |
705 | [AC_DEFINE(HAVE_CLASS_DEVICE_CREATE, 1, | |
706 | [class_device_create() is available])], | |
6a6cafbe | 707 | []) |
46c685d0 | 708 | ]) |
6a6cafbe | 709 | |
6a6cafbe | 710 | dnl # |
711 | dnl # 2.6.26 API change, set_normalized_timespec() is exported. | |
712 | dnl # | |
713 | AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_EXPORT], [ | |
714 | SPL_CHECK_SYMBOL_EXPORT( | |
715 | [set_normalized_timespec], | |
716 | [kernel/time.c], | |
717 | [AC_DEFINE(HAVE_SET_NORMALIZED_TIMESPEC_EXPORT, 1, | |
718 | [set_normalized_timespec() is available as export])], | |
719 | []) | |
720 | ]) | |
721 | ||
722 | dnl # | |
723 | dnl # 2.6.16 API change, set_normalize_timespec() moved to time.c | |
724 | dnl # previously it was available in time.h as an inline. | |
725 | dnl # | |
86de8532 | 726 | AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE], [ |
727 | AC_MSG_CHECKING([whether set_normalized_timespec() is an inline]) | |
6a6cafbe | 728 | SPL_LINUX_TRY_COMPILE([ |
729 | #include <linux/time.h> | |
6a6cafbe | 730 | void set_normalized_timespec(struct timespec *ts, |
25557fd8 | 731 | time_t sec, long nsec) { } |
732 | ], | |
733 | [], | |
734 | [ | |
6a6cafbe | 735 | AC_MSG_RESULT(no) |
736 | ],[ | |
737 | AC_MSG_RESULT(yes) | |
738 | AC_DEFINE(HAVE_SET_NORMALIZED_TIMESPEC_INLINE, 1, | |
739 | [set_normalized_timespec() is available as inline]) | |
740 | ]) | |
741 | ]) | |
742 | ||
743 | dnl # | |
744 | dnl # 2.6.18 API change, | |
745 | dnl # timespec_sub() inline function available in linux/time.h | |
746 | dnl # | |
86de8532 | 747 | AC_DEFUN([SPL_AC_TIMESPEC_SUB], [ |
748 | AC_MSG_CHECKING([whether timespec_sub() is available]) | |
6a6cafbe | 749 | SPL_LINUX_TRY_COMPILE([ |
750 | #include <linux/time.h> | |
751 | ],[ | |
752 | struct timespec a, b, c = { 0 }; | |
753 | c = timespec_sub(a, b); | |
754 | ],[ | |
755 | AC_MSG_RESULT(yes) | |
756 | AC_DEFINE(HAVE_TIMESPEC_SUB, 1, [timespec_sub() is available]) | |
757 | ],[ | |
758 | AC_MSG_RESULT(no) | |
759 | ]) | |
760 | ]) | |
761 | ||
86de8532 | 762 | dnl # |
3d061e9d | 763 | dnl # 2.6.19 API change, |
764 | dnl # check if init_utsname() is available in linux/utsname.h | |
765 | dnl # | |
766 | AC_DEFUN([SPL_AC_INIT_UTSNAME], [ | |
767 | AC_MSG_CHECKING([whether init_utsname() is available]) | |
768 | SPL_LINUX_TRY_COMPILE([ | |
769 | #include <linux/utsname.h> | |
770 | ],[ | |
771 | struct new_utsname *a = init_utsname(); | |
772 | ],[ | |
773 | AC_MSG_RESULT(yes) | |
774 | AC_DEFINE(HAVE_INIT_UTSNAME, 1, [init_utsname() is available]) | |
775 | ],[ | |
776 | AC_MSG_RESULT(no) | |
777 | ]) | |
778 | ]) | |
779 | ||
780 | dnl # | |
781 | dnl # 2.6.26 API change, | |
782 | dnl # definition of struct fdtable relocated to linux/fdtable.h | |
86de8532 | 783 | dnl # |
784 | AC_DEFUN([SPL_AC_FDTABLE_HEADER], [ | |
785 | SPL_CHECK_HEADER([linux/fdtable.h], [FDTABLE], [], []) | |
786 | ]) | |
322640b7 | 787 | |
788 | dnl # | |
3d061e9d | 789 | dnl # 2.6.14 API change, |
790 | dnl # check whether 'files_fdtable()' exists | |
791 | dnl # | |
792 | AC_DEFUN([SPL_AC_FILES_FDTABLE], [ | |
793 | AC_MSG_CHECKING([whether files_fdtable() is available]) | |
794 | SPL_LINUX_TRY_COMPILE([ | |
795 | #include <linux/sched.h> | |
796 | #include <linux/file.h> | |
797 | #ifdef HAVE_FDTABLE_HEADER | |
798 | #include <linux/fdtable.h> | |
799 | #endif | |
800 | ],[ | |
801 | struct files_struct *files = current->files; | |
802 | struct fdtable *fdt = files_fdtable(files); | |
803 | ],[ | |
804 | AC_MSG_RESULT(yes) | |
805 | AC_DEFINE(HAVE_FILES_FDTABLE, 1, [files_fdtable() is available]) | |
806 | ],[ | |
807 | AC_MSG_RESULT(no) | |
808 | ]) | |
809 | ]) | |
810 | ||
811 | dnl # | |
812 | dnl # 2.6.18 API change, | |
813 | dnl # added linux/uaccess.h | |
322640b7 | 814 | dnl # |
815 | AC_DEFUN([SPL_AC_UACCESS_HEADER], [ | |
816 | SPL_CHECK_HEADER([linux/uaccess.h], [UACCESS], [], []) | |
817 | ]) | |
3d061e9d | 818 | |
819 | dnl # | |
820 | dnl # 2.6.12 API change, | |
821 | dnl # check whether 'kmalloc_node()' is available. | |
822 | dnl # | |
823 | AC_DEFUN([SPL_AC_KMALLOC_NODE], [ | |
824 | AC_MSG_CHECKING([whether kmalloc_node() is available]) | |
825 | SPL_LINUX_TRY_COMPILE([ | |
826 | #include <linux/slab.h> | |
827 | ],[ | |
828 | void *a = kmalloc_node(1, GFP_KERNEL, 0); | |
829 | ],[ | |
830 | AC_MSG_RESULT(yes) | |
831 | AC_DEFINE(HAVE_KMALLOC_NODE, 1, [kmalloc_node() is available]) | |
832 | ],[ | |
833 | AC_MSG_RESULT(no) | |
834 | ]) | |
835 | ]) | |
836 | ||
837 | dnl # | |
838 | dnl # 2.6.9 API change, | |
839 | dnl # check whether 'monotonic_clock()' is available it may | |
840 | dnl # be available for some archs but not others. | |
841 | dnl # | |
842 | AC_DEFUN([SPL_AC_MONOTONIC_CLOCK], [ | |
843 | SPL_CHECK_SYMBOL_EXPORT( | |
844 | [monotonic_clock], | |
845 | [], | |
846 | [AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, | |
847 | [monotonic_clock() is available])], | |
848 | []) | |
849 | ]) | |
850 | ||
851 | dnl # | |
852 | dnl # 2.6.16 API change, | |
853 | dnl # check whether 'struct inode' has i_mutex | |
854 | dnl # | |
855 | AC_DEFUN([SPL_AC_INODE_I_MUTEX], [ | |
856 | AC_MSG_CHECKING([whether struct inode has i_mutex]) | |
857 | SPL_LINUX_TRY_COMPILE([ | |
858 | #include <linux/fs.h> | |
859 | #include <linux/mutex.h> | |
860 | ],[ | |
861 | struct inode i; | |
862 | mutex_init(&i.i_mutex); | |
863 | ],[ | |
864 | AC_MSG_RESULT(yes) | |
865 | AC_DEFINE(HAVE_INODE_I_MUTEX, 1, [struct inode has i_mutex]) | |
866 | ],[ | |
867 | AC_MSG_RESULT(no) | |
868 | ]) | |
869 | ]) | |
b61a6e8b | 870 | |
4d54fdee BB |
871 | dnl # |
872 | dnl # 2.6.29 API change, | |
873 | dnl # Adaptive mutexs introduced. | |
874 | dnl # | |
875 | AC_DEFUN([SPL_AC_MUTEX_OWNER], [ | |
876 | AC_MSG_CHECKING([whether struct mutex has owner]) | |
877 | SPL_LINUX_TRY_COMPILE([ | |
878 | #include <linux/mutex.h> | |
879 | ],[ | |
880 | struct mutex mtx; | |
881 | mtx.owner = NULL; | |
882 | ],[ | |
883 | AC_MSG_RESULT(yes) | |
884 | AC_DEFINE(HAVE_MUTEX_OWNER, 1, [struct mutex has owner]) | |
885 | ],[ | |
886 | AC_MSG_RESULT(no) | |
887 | ]) | |
888 | ]) | |
889 | ||
6c9433c1 BB |
890 | dnl # |
891 | dnl # 2.6.18 API change, | |
892 | dnl # First introduced 'mutex_lock_nested()' in include/linux/mutex.h, | |
893 | dnl # as part of the mutex validator. Fallback to using 'mutex_lock()' | |
894 | dnl # if the mutex validator is disabled or otherwise unavailable. | |
895 | dnl # | |
896 | AC_DEFUN([SPL_AC_MUTEX_LOCK_NESTED], [ | |
897 | AC_MSG_CHECKING([whether mutex_lock_nested() is available]) | |
898 | SPL_LINUX_TRY_COMPILE([ | |
899 | #include <linux/mutex.h> | |
900 | ],[ | |
901 | struct mutex mutex; | |
902 | mutex_init(&mutex); | |
903 | mutex_lock_nested(&mutex, 0); | |
904 | ],[ | |
905 | AC_MSG_RESULT(yes) | |
906 | AC_DEFINE(HAVE_MUTEX_LOCK_NESTED, 1, | |
907 | [mutex_lock_nested() is available]) | |
908 | ],[ | |
909 | AC_MSG_RESULT(no) | |
910 | ]) | |
911 | ]) | |
912 | ||
b61a6e8b | 913 | dnl # |
96dded38 BB |
914 | dnl # 2.6.22 API change, |
915 | dnl # First introduced 'div64_64()' in lib/div64.c | |
916 | dnl | |
b61a6e8b | 917 | AC_DEFUN([SPL_AC_DIV64_64], [ |
96dded38 BB |
918 | SPL_CHECK_SYMBOL_EXPORT( |
919 | [div64_64], | |
920 | [], | |
921 | [AC_DEFINE(HAVE_DIV64_64, 1, | |
922 | [div64_64() is available])], | |
923 | []) | |
924 | ]) | |
925 | ||
926 | dnl # | |
927 | dnl # 2.6.26 API change, | |
928 | dnl # Renamed 'div64_64()' to 'div64_u64' in lib/div64.c | |
929 | dnl # | |
930 | AC_DEFUN([SPL_AC_DIV64_U64], [ | |
931 | SPL_CHECK_SYMBOL_EXPORT( | |
932 | [div64_u64], | |
933 | [], | |
934 | [AC_DEFINE(HAVE_DIV64_U64, 1, | |
935 | [div64_u64() is available])], | |
936 | []) | |
b61a6e8b | 937 | ]) |
31a033ec BB |
938 | |
939 | dnl # | |
940 | dnl # 2.6.27 API change, | |
941 | dnl # on_each_cpu() uses 3 args, no 'retry' argument | |
942 | dnl # | |
943 | AC_DEFUN([SPL_AC_3ARGS_ON_EACH_CPU], [ | |
944 | AC_MSG_CHECKING([whether on_each_cpu() wants 3 args]) | |
945 | SPL_LINUX_TRY_COMPILE([ | |
946 | #include <linux/smp.h> | |
947 | ],[ | |
948 | on_each_cpu(NULL, NULL, 0); | |
949 | ],[ | |
950 | AC_MSG_RESULT(yes) | |
951 | AC_DEFINE(HAVE_3ARGS_ON_EACH_CPU, 1, | |
952 | [on_each_cpu wants 3 args]) | |
953 | ],[ | |
954 | AC_MSG_RESULT(no) | |
955 | ]) | |
956 | ]) | |
36b313da BB |
957 | |
958 | dnl # | |
d1ff2312 BB |
959 | dnl # 2.6.18 API change, |
960 | dnl # kallsyms_lookup_name no longer exported | |
961 | dnl # | |
962 | AC_DEFUN([SPL_AC_KALLSYMS_LOOKUP_NAME], [ | |
963 | SPL_CHECK_SYMBOL_EXPORT( | |
964 | [kallsyms_lookup_name], | |
965 | [], | |
966 | [AC_DEFINE(HAVE_KALLSYMS_LOOKUP_NAME, 1, | |
967 | [kallsyms_lookup_name() is available])], | |
968 | []) | |
969 | ]) | |
970 | ||
971 | dnl # | |
e11d6c5f BB |
972 | dnl # Proposed API change, |
973 | dnl # This symbol is not available in stock kernels. You may build a | |
974 | dnl # custom kernel with the *-spl-export-symbols.patch which will export | |
975 | dnl # these symbols for use. If your already rolling a custom kernel for | |
976 | dnl # your environment this is recommended. | |
d1ff2312 BB |
977 | dnl # |
978 | AC_DEFUN([SPL_AC_GET_VMALLOC_INFO], [ | |
979 | SPL_CHECK_SYMBOL_EXPORT( | |
980 | [get_vmalloc_info], | |
981 | [], | |
982 | [AC_DEFINE(HAVE_GET_VMALLOC_INFO, 1, | |
983 | [get_vmalloc_info() is available])], | |
984 | []) | |
985 | ]) | |
986 | ||
5232d256 BB |
987 | dnl # |
988 | dnl # 2.6.17 API change | |
989 | dnl # The helper functions first_online_pgdat(), next_online_pgdat(), and | |
990 | dnl # next_zone() are introduced to simplify for_each_zone(). These symbols | |
991 | dnl # were exported in 2.6.17 for use by modules which was consistent with | |
992 | dnl # the previous implementation of for_each_zone(). From 2.6.18 - 2.6.19 | |
993 | dnl # the symbols were exported as 'unused', and by 2.6.20 they exports | |
994 | dnl # were dropped entirely leaving modules no way to directly iterate over | |
995 | dnl # the zone list. Because we need access to the zone helpers we check | |
996 | dnl # if the kernel contains the old or new implementation. Then we check | |
997 | dnl # to see if the symbols we need for each version are available. If they | |
998 | dnl # are not, dynamically aquire the addresses with kallsyms_lookup_name(). | |
999 | dnl # | |
1000 | AC_DEFUN([SPL_AC_PGDAT_HELPERS], [ | |
1001 | AC_MSG_CHECKING([whether symbol *_pgdat exist]) | |
1002 | grep -q -E 'first_online_pgdat' $LINUX/include/linux/mmzone.h 2>/dev/null | |
1003 | rc=$? | |
1004 | if test $rc -eq 0; then | |
1005 | AC_MSG_RESULT([yes]) | |
1006 | AC_DEFINE(HAVE_PGDAT_HELPERS, 1, [pgdat helpers are available]) | |
1007 | else | |
1008 | AC_MSG_RESULT([no]) | |
1009 | fi | |
1010 | ]) | |
1011 | ||
d1ff2312 | 1012 | dnl # |
e11d6c5f BB |
1013 | dnl # Proposed API change, |
1014 | dnl # This symbol is not available in stock kernels. You may build a | |
1015 | dnl # custom kernel with the *-spl-export-symbols.patch which will export | |
1016 | dnl # these symbols for use. If your already rolling a custom kernel for | |
1017 | dnl # your environment this is recommended. | |
36b313da BB |
1018 | dnl # |
1019 | AC_DEFUN([SPL_AC_FIRST_ONLINE_PGDAT], [ | |
1020 | SPL_CHECK_SYMBOL_EXPORT( | |
1021 | [first_online_pgdat], | |
1022 | [], | |
1023 | [AC_DEFINE(HAVE_FIRST_ONLINE_PGDAT, 1, | |
1024 | [first_online_pgdat() is available])], | |
1025 | []) | |
1026 | ]) | |
1027 | ||
1028 | dnl # | |
e11d6c5f BB |
1029 | dnl # Proposed API change, |
1030 | dnl # This symbol is not available in stock kernels. You may build a | |
1031 | dnl # custom kernel with the *-spl-export-symbols.patch which will export | |
1032 | dnl # these symbols for use. If your already rolling a custom kernel for | |
1033 | dnl # your environment this is recommended. | |
36b313da BB |
1034 | dnl # |
1035 | AC_DEFUN([SPL_AC_NEXT_ONLINE_PGDAT], [ | |
1036 | SPL_CHECK_SYMBOL_EXPORT( | |
1037 | [next_online_pgdat], | |
1038 | [], | |
1039 | [AC_DEFINE(HAVE_NEXT_ONLINE_PGDAT, 1, | |
1040 | [next_online_pgdat() is available])], | |
1041 | []) | |
1042 | ]) | |
1043 | ||
1044 | dnl # | |
e11d6c5f BB |
1045 | dnl # Proposed API change, |
1046 | dnl # This symbol is not available in stock kernels. You may build a | |
1047 | dnl # custom kernel with the *-spl-export-symbols.patch which will export | |
1048 | dnl # these symbols for use. If your already rolling a custom kernel for | |
1049 | dnl # your environment this is recommended. | |
36b313da BB |
1050 | dnl # |
1051 | AC_DEFUN([SPL_AC_NEXT_ZONE], [ | |
1052 | SPL_CHECK_SYMBOL_EXPORT( | |
1053 | [next_zone], | |
1054 | [], | |
1055 | [AC_DEFINE(HAVE_NEXT_ZONE, 1, | |
1056 | [next_zone() is available])], | |
1057 | []) | |
1058 | ]) | |
4ab13d3b | 1059 | |
5232d256 BB |
1060 | dnl # |
1061 | dnl # 2.6.17 API change, | |
1062 | dnl # See SPL_AC_PGDAT_HELPERS for details. | |
1063 | dnl # | |
1064 | AC_DEFUN([SPL_AC_PGDAT_LIST], [ | |
1065 | SPL_CHECK_SYMBOL_EXPORT( | |
1066 | [pgdat_list], | |
1067 | [], | |
1068 | [AC_DEFINE(HAVE_PGDAT_LIST, 1, | |
1069 | [pgdat_list is available])], | |
1070 | []) | |
1071 | ]) | |
1072 | ||
96dded38 BB |
1073 | dnl # |
1074 | dnl # 2.6.18 API change, | |
1075 | dnl # First introduced global_page_state() support as an inline. | |
1076 | dnl # | |
1077 | AC_DEFUN([SPL_AC_GLOBAL_PAGE_STATE], [ | |
1078 | AC_MSG_CHECKING([whether global_page_state() is available]) | |
1079 | SPL_LINUX_TRY_COMPILE([ | |
6ae7fef5 | 1080 | #include <linux/mm.h> |
96dded38 BB |
1081 | ],[ |
1082 | unsigned long state; | |
6ae7fef5 | 1083 | state = global_page_state(0); |
96dded38 BB |
1084 | ],[ |
1085 | AC_MSG_RESULT(yes) | |
1086 | AC_DEFINE(HAVE_GLOBAL_PAGE_STATE, 1, | |
1087 | [global_page_state() is available]) | |
1088 | ],[ | |
1089 | AC_MSG_RESULT(no) | |
1090 | ]) | |
1091 | ]) | |
1092 | ||
e11d6c5f | 1093 | dnl # |
6ae7fef5 BB |
1094 | dnl # 2.6.21 API change (plus subsequent naming convention changes), |
1095 | dnl # Public global zone stats now include a free page count. However | |
1096 | dnl # the enumerated names of the counters have changed since this API | |
1097 | dnl # was introduced. We need to deduce the corrent name to use. This | |
1098 | dnl # replaces the priviate get_zone_counts() interface. | |
1099 | dnl # | |
1100 | dnl # NR_FREE_PAGES was available from 2.6.21 to current kernels, which | |
1101 | dnl # is 2.6.30 as of when this was written. | |
e11d6c5f | 1102 | dnl # |
6ae7fef5 BB |
1103 | AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_FREE], [ |
1104 | AC_MSG_CHECKING([whether page state NR_FREE_PAGES is available]) | |
e11d6c5f | 1105 | SPL_LINUX_TRY_COMPILE([ |
6ae7fef5 | 1106 | #include <linux/mm.h> |
e11d6c5f | 1107 | ],[ |
6ae7fef5 BB |
1108 | enum zone_stat_item zsi; |
1109 | zsi = NR_FREE_PAGES; | |
e11d6c5f BB |
1110 | ],[ |
1111 | AC_MSG_RESULT(yes) | |
6ae7fef5 BB |
1112 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_FREE_PAGES, 1, |
1113 | [Page state NR_FREE_PAGES is available]) | |
e11d6c5f BB |
1114 | ],[ |
1115 | AC_MSG_RESULT(no) | |
1116 | ]) | |
1117 | ]) | |
a093c6a4 | 1118 | |
6ae7fef5 BB |
1119 | dnl # |
1120 | dnl # 2.6.21 API change (plus subsequent naming convention changes), | |
1121 | dnl # Public global zone stats now include an inactive page count. However | |
1122 | dnl # the enumerated names of the counters have changed since this API | |
1123 | dnl # was introduced. We need to deduce the corrent name to use. This | |
1124 | dnl # replaces the priviate get_zone_counts() interface. | |
1125 | dnl # | |
1126 | dnl # NR_INACTIVE was available from 2.6.21 to 2.6.27 and included both | |
1127 | dnl # anonymous and file inactive pages. As of 2.6.28 it was split in | |
1128 | dnl # to NR_INACTIVE_ANON and NR_INACTIVE_FILE. | |
1129 | dnl # | |
1130 | AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_INACTIVE], [ | |
1131 | AC_MSG_CHECKING([whether page state NR_INACTIVE is available]) | |
1132 | SPL_LINUX_TRY_COMPILE([ | |
1133 | #include <linux/mm.h> | |
1134 | ],[ | |
1135 | enum zone_stat_item zsi; | |
1136 | zsi = NR_INACTIVE; | |
1137 | ],[ | |
1138 | AC_MSG_RESULT(yes) | |
1139 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE, 1, | |
1140 | [Page state NR_INACTIVE is available]) | |
1141 | ],[ | |
1142 | AC_MSG_RESULT(no) | |
1143 | ]) | |
1144 | ||
1145 | AC_MSG_CHECKING([whether page state NR_INACTIVE_ANON is available]) | |
1146 | SPL_LINUX_TRY_COMPILE([ | |
1147 | #include <linux/mm.h> | |
1148 | ],[ | |
1149 | enum zone_stat_item zsi; | |
1150 | zsi = NR_INACTIVE_ANON; | |
1151 | ],[ | |
1152 | AC_MSG_RESULT(yes) | |
1153 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_ANON, 1, | |
1154 | [Page state NR_INACTIVE_ANON is available]) | |
1155 | ],[ | |
1156 | AC_MSG_RESULT(no) | |
1157 | ]) | |
1158 | ||
1159 | AC_MSG_CHECKING([whether page state NR_INACTIVE_FILE is available]) | |
1160 | SPL_LINUX_TRY_COMPILE([ | |
1161 | #include <linux/mm.h> | |
1162 | ],[ | |
1163 | enum zone_stat_item zsi; | |
1164 | zsi = NR_INACTIVE_FILE; | |
1165 | ],[ | |
1166 | AC_MSG_RESULT(yes) | |
1167 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_FILE, 1, | |
1168 | [Page state NR_INACTIVE_FILE is available]) | |
1169 | ],[ | |
1170 | AC_MSG_RESULT(no) | |
1171 | ]) | |
1172 | ]) | |
1173 | ||
1174 | dnl # | |
1175 | dnl # 2.6.21 API change (plus subsequent naming convention changes), | |
1176 | dnl # Public global zone stats now include an active page count. However | |
1177 | dnl # the enumerated names of the counters have changed since this API | |
1178 | dnl # was introduced. We need to deduce the corrent name to use. This | |
1179 | dnl # replaces the priviate get_zone_counts() interface. | |
1180 | dnl # | |
1181 | dnl # NR_ACTIVE was available from 2.6.21 to 2.6.27 and included both | |
1182 | dnl # anonymous and file active pages. As of 2.6.28 it was split in | |
1183 | dnl # to NR_ACTIVE_ANON and NR_ACTIVE_FILE. | |
1184 | dnl # | |
1185 | AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_ACTIVE], [ | |
1186 | AC_MSG_CHECKING([whether page state NR_ACTIVE is available]) | |
1187 | SPL_LINUX_TRY_COMPILE([ | |
1188 | #include <linux/mm.h> | |
1189 | ],[ | |
1190 | enum zone_stat_item zsi; | |
1191 | zsi = NR_ACTIVE; | |
1192 | ],[ | |
1193 | AC_MSG_RESULT(yes) | |
1194 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE, 1, | |
1195 | [Page state NR_ACTIVE is available]) | |
1196 | ],[ | |
1197 | AC_MSG_RESULT(no) | |
1198 | ]) | |
1199 | ||
1200 | AC_MSG_CHECKING([whether page state NR_ACTIVE_ANON is available]) | |
1201 | SPL_LINUX_TRY_COMPILE([ | |
1202 | #include <linux/mm.h> | |
1203 | ],[ | |
1204 | enum zone_stat_item zsi; | |
1205 | zsi = NR_ACTIVE_ANON; | |
1206 | ],[ | |
1207 | AC_MSG_RESULT(yes) | |
1208 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_ANON, 1, | |
1209 | [Page state NR_ACTIVE_ANON is available]) | |
1210 | ],[ | |
1211 | AC_MSG_RESULT(no) | |
1212 | ]) | |
1213 | ||
1214 | AC_MSG_CHECKING([whether page state NR_ACTIVE_FILE is available]) | |
1215 | SPL_LINUX_TRY_COMPILE([ | |
1216 | #include <linux/mm.h> | |
1217 | ],[ | |
1218 | enum zone_stat_item zsi; | |
1219 | zsi = NR_ACTIVE_FILE; | |
1220 | ],[ | |
1221 | AC_MSG_RESULT(yes) | |
1222 | AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_FILE, 1, | |
1223 | [Page state NR_ACTIVE_FILE is available]) | |
1224 | ],[ | |
1225 | AC_MSG_RESULT(no) | |
1226 | ]) | |
1227 | ]) | |
1228 | ||
1229 | dnl # | |
1230 | dnl # Proposed API change for legacy kernels. | |
1231 | dnl # This symbol is not available in older kernels. For kernels post | |
1232 | dnl # 2.6.21 the global_page_state() API is used to get free/inactive/active | |
1233 | dnl # page state information. This symbol is only used in legacy kernels | |
1234 | dnl # any only as a last resort. | |
1235 | dnl | |
1236 | AC_DEFUN([SPL_AC_GET_ZONE_COUNTS], [ | |
1237 | AC_MSG_CHECKING([whether symbol get_zone_counts is needed]) | |
1238 | SPL_LINUX_TRY_COMPILE([ | |
1239 | ],[ | |
1240 | #if !defined(HAVE_ZONE_STAT_ITEM_NR_FREE_PAGES) | |
1241 | #error "global_page_state needs NR_FREE_PAGES" | |
1242 | #endif | |
1243 | ||
1244 | #if !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE) && \ | |
1245 | !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_ANON) && \ | |
1246 | !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_FILE) | |
1247 | #error "global_page_state needs NR_ACTIVE*" | |
1248 | #endif | |
1249 | ||
1250 | #if !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE) && \ | |
1251 | !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_ANON) && \ | |
1252 | !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_FILE) | |
1253 | #error "global_page_state needs NR_INACTIVE*" | |
1254 | #endif | |
1255 | ],[ | |
1256 | AC_MSG_RESULT(no) | |
1257 | ],[ | |
1258 | AC_MSG_RESULT(yes) | |
1259 | AC_DEFINE(NEED_GET_ZONE_COUNTS, 1, | |
1260 | [get_zone_counts() is needed]) | |
1261 | ||
1262 | SPL_CHECK_SYMBOL_EXPORT( | |
1263 | [get_zone_counts], | |
1264 | [], | |
1265 | [AC_DEFINE(HAVE_GET_ZONE_COUNTS, 1, | |
1266 | [get_zone_counts() is available])], | |
1267 | []) | |
1268 | ]) | |
1269 | ]) | |
1270 | ||
51a727e9 BB |
1271 | dnl # |
1272 | dnl # Symbol available in RHEL kernels not in stock kernels. | |
1273 | dnl # | |
1274 | AC_DEFUN([SPL_AC_SET_FS_PWD], [ | |
1275 | SPL_CHECK_SYMBOL_EXPORT( | |
1276 | [set_fs_pwd], | |
1277 | [], | |
1278 | [AC_DEFINE(HAVE_SET_FS_PWD, 1, | |
1279 | [set_fs_pwd() is available])], | |
1280 | []) | |
1281 | ]) | |
1282 | ||
1283 | dnl # | |
1284 | dnl # 2.6.25 API change, | |
1285 | dnl # Simplied API by replacing mnt+dentry args with a single path arg. | |
1286 | dnl # | |
1287 | AC_DEFUN([SPL_AC_2ARGS_SET_FS_PWD], | |
1288 | [AC_MSG_CHECKING([whether set_fs_pwd() wants 2 args]) | |
1289 | SPL_LINUX_TRY_COMPILE([ | |
1290 | #include <linux/sched.h> | |
baf2979e | 1291 | #include <linux/fs_struct.h> |
51a727e9 BB |
1292 | ],[ |
1293 | set_fs_pwd(NULL, NULL); | |
1294 | ],[ | |
1295 | AC_MSG_RESULT(yes) | |
1296 | AC_DEFINE(HAVE_2ARGS_SET_FS_PWD, 1, | |
1297 | [set_fs_pwd() wants 2 args]) | |
1298 | ],[ | |
1299 | AC_MSG_RESULT(no) | |
1300 | ]) | |
1301 | ]) | |
1302 | ||
a093c6a4 BB |
1303 | dnl # |
1304 | dnl # SLES API change, never adopted in mainline, | |
1305 | dnl # Third 'struct vfsmount *' argument removed. | |
1306 | dnl # | |
1307 | AC_DEFUN([SPL_AC_2ARGS_VFS_UNLINK], | |
1308 | [AC_MSG_CHECKING([whether vfs_unlink() wants 2 args]) | |
1309 | SPL_LINUX_TRY_COMPILE([ | |
1310 | #include <linux/fs.h> | |
1311 | ],[ | |
1312 | vfs_unlink(NULL, NULL); | |
1313 | ],[ | |
1314 | AC_MSG_RESULT(yes) | |
1315 | AC_DEFINE(HAVE_2ARGS_VFS_UNLINK, 1, | |
1316 | [vfs_unlink() wants 2 args]) | |
1317 | ],[ | |
1318 | AC_MSG_RESULT(no) | |
1319 | ]) | |
1320 | ]) | |
1321 | ||
1322 | dnl # | |
1323 | dnl # SLES API change, never adopted in mainline, | |
1324 | dnl # Third and sixth 'struct vfsmount *' argument removed. | |
1325 | dnl # | |
1326 | AC_DEFUN([SPL_AC_4ARGS_VFS_RENAME], | |
1327 | [AC_MSG_CHECKING([whether vfs_rename() wants 4 args]) | |
1328 | SPL_LINUX_TRY_COMPILE([ | |
1329 | #include <linux/fs.h> | |
1330 | ],[ | |
1331 | vfs_rename(NULL, NULL, NULL, NULL); | |
1332 | ],[ | |
1333 | AC_MSG_RESULT(yes) | |
1334 | AC_DEFINE(HAVE_4ARGS_VFS_RENAME, 1, | |
1335 | [vfs_rename() wants 4 args]) | |
1336 | ],[ | |
1337 | AC_MSG_RESULT(no) | |
1338 | ]) | |
1339 | ]) | |
ec7d53e9 BB |
1340 | |
1341 | dnl # | |
1342 | dnl # 2.6.29 API change, | |
1343 | dnl # check whether 'struct cred' exists | |
1344 | dnl # | |
1345 | AC_DEFUN([SPL_AC_CRED_STRUCT], [ | |
1346 | AC_MSG_CHECKING([whether struct cred exists]) | |
1347 | SPL_LINUX_TRY_COMPILE([ | |
1348 | #include <linux/cred.h> | |
1349 | ],[ | |
1350 | struct cred *cr; | |
1351 | cr = NULL; | |
1352 | ],[ | |
1353 | AC_MSG_RESULT(yes) | |
1354 | AC_DEFINE(HAVE_CRED_STRUCT, 1, [struct cred exists]) | |
1355 | ],[ | |
1356 | AC_MSG_RESULT(no) | |
1357 | ]) | |
1358 | ]) | |
1359 | ||
1360 | dnl # | |
e811949a | 1361 | dnl # Custom SPL patch may export this symbol. |
ec7d53e9 BB |
1362 | dnl # |
1363 | AC_DEFUN([SPL_AC_GROUPS_SEARCH], [ | |
1364 | SPL_CHECK_SYMBOL_EXPORT( | |
1365 | [groups_search], | |
1366 | [], | |
1367 | [AC_DEFINE(HAVE_GROUPS_SEARCH, 1, | |
1368 | [groups_search() is available])], | |
1369 | []) | |
1370 | ]) | |
e811949a BB |
1371 | |
1372 | dnl # | |
1373 | dnl # 2.6.x API change, | |
1374 | dnl # __put_task_struct() was exported in RHEL5 but unavailable elsewhere. | |
1375 | dnl # | |
1376 | AC_DEFUN([SPL_AC_PUT_TASK_STRUCT], [ | |
1377 | SPL_CHECK_SYMBOL_EXPORT( | |
1378 | [__put_task_struct], | |
1379 | [], | |
1380 | [AC_DEFINE(HAVE_PUT_TASK_STRUCT, 1, | |
1381 | [__put_task_struct() is available])], | |
1382 | []) | |
1383 | ]) | |
3977f837 BB |
1384 | |
1385 | dnl # | |
1386 | dnl # 2.6.32 API change, | |
1387 | dnl # Unused 'struct file *' removed from prototype. | |
1388 | dnl # | |
1389 | AC_DEFUN([SPL_AC_5ARGS_PROC_HANDLER], [ | |
1390 | AC_MSG_CHECKING([whether proc_handler() wants 5 args]) | |
1391 | SPL_LINUX_TRY_COMPILE([ | |
1392 | #include <linux/sysctl.h> | |
1393 | ],[ | |
1394 | proc_dostring(NULL, 0, NULL, NULL, NULL); | |
1395 | ],[ | |
1396 | AC_MSG_RESULT(yes) | |
1397 | AC_DEFINE(HAVE_5ARGS_PROC_HANDLER, 1, | |
1398 | [proc_handler() wants 5 args]) | |
1399 | ],[ | |
1400 | AC_MSG_RESULT(no) | |
1401 | ]) | |
1402 | ]) | |
b868e22f BB |
1403 | |
1404 | dnl # | |
1405 | dnl # 2.6.x API change, | |
1406 | dnl # kvasprintf() function added. | |
1407 | dnl # | |
1408 | AC_DEFUN([SPL_AC_KVASPRINTF], [ | |
1409 | SPL_CHECK_SYMBOL_EXPORT( | |
1410 | [kvasprintf], | |
1411 | [], | |
1412 | [AC_DEFINE(HAVE_KVASPRINTF, 1, | |
1413 | [kvasprintf() is available])], | |
1414 | []) | |
1415 | ]) |