]>
Commit | Line | Data |
---|---|---|
c9c0d073 BB |
1 | dnl # |
2 | dnl # Default ZFS kernel configuration | |
3 | dnl # | |
4 | AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ | |
5 | ZFS_AC_KERNEL | |
6 | ZFS_AC_SPL | |
7 | ZFS_AC_KERNEL_CONFIG | |
8 | ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS | |
9 | ZFS_AC_KERNEL_TYPE_FMODE_T | |
10 | ZFS_AC_KERNEL_KOBJ_NAME_LEN | |
45066d1f | 11 | ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH |
c9c0d073 BB |
12 | ZFS_AC_KERNEL_OPEN_BDEV_EXCLUSIVE |
13 | ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS | |
14 | ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE | |
15 | ZFS_AC_KERNEL_BIO_EMPTY_BARRIER | |
2959d94a | 16 | ZFS_AC_KERNEL_BIO_FAILFAST |
f4af6bb7 BB |
17 | ZFS_AC_KERNEL_BIO_FAILFAST_DTD |
18 | ZFS_AC_KERNEL_REQ_FAILFAST_MASK | |
c9c0d073 | 19 | ZFS_AC_KERNEL_BIO_END_IO_T_ARGS |
675de5aa | 20 | ZFS_AC_KERNEL_BIO_RW_SYNC |
c9c0d073 | 21 | ZFS_AC_KERNEL_BIO_RW_SYNCIO |
675de5aa | 22 | ZFS_AC_KERNEL_REQ_SYNC |
c9c0d073 | 23 | ZFS_AC_KERNEL_BLK_END_REQUEST |
b18019d2 | 24 | ZFS_AC_KERNEL_BLK_QUEUE_FLUSH |
c9c0d073 BB |
25 | ZFS_AC_KERNEL_BLK_FETCH_REQUEST |
26 | ZFS_AC_KERNEL_BLK_REQUEUE_REQUEST | |
27 | ZFS_AC_KERNEL_BLK_RQ_BYTES | |
28 | ZFS_AC_KERNEL_BLK_RQ_POS | |
29 | ZFS_AC_KERNEL_BLK_RQ_SECTORS | |
30 | ZFS_AC_KERNEL_GET_DISK_RO | |
31 | ZFS_AC_KERNEL_RQ_IS_SYNC | |
32 | ZFS_AC_KERNEL_RQ_FOR_EACH_SEGMENT | |
777d4af8 | 33 | ZFS_AC_KERNEL_CONST_XATTR_HANDLER |
f9637c6c BB |
34 | ZFS_AC_KERNEL_XATTR_HANDLER_GET |
35 | ZFS_AC_KERNEL_XATTR_HANDLER_SET | |
47621f3d | 36 | ZFS_AC_KERNEL_SHOW_OPTIONS |
adcd70bd | 37 | ZFS_AC_KERNEL_FSYNC |
2c395def | 38 | ZFS_AC_KERNEL_EVICT_INODE |
ab26409d BB |
39 | ZFS_AC_KERNEL_NR_CACHED_OBJECTS |
40 | ZFS_AC_KERNEL_FREE_CACHED_OBJECTS | |
bdf4328b | 41 | ZFS_AC_KERNEL_INSERT_INODE_LOCKED |
055656d4 | 42 | ZFS_AC_KERNEL_D_OBTAIN_ALIAS |
df554c14 | 43 | ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE |
b3129792 | 44 | ZFS_AC_KERNEL_TRUNCATE_SETSIZE |
5c03efc3 | 45 | ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY |
166dd49d | 46 | ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY |
2cf7f52b | 47 | ZFS_AC_KERNEL_MOUNT_NODEV |
ab26409d | 48 | ZFS_AC_KERNEL_SHRINK |
76659dc1 | 49 | ZFS_AC_KERNEL_BDI |
5547c2f1 | 50 | ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER |
28eb9213 | 51 | ZFS_AC_KERNEL_SET_NLINK |
c9c0d073 | 52 | |
8366cd6a | 53 | AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ |
6283f55e | 54 | KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" |
8366cd6a | 55 | ]) |
6283f55e BB |
56 | AC_SUBST(KERNELMAKE_PARAMS) |
57 | ||
58 | ||
c9c0d073 BB |
59 | dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other |
60 | dnl # compiler options are added by the kernel build system. | |
8a7e1cee | 61 | KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE" |
c9c0d073 BB |
62 | KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL" |
63 | KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\"" | |
c9c0d073 | 64 | |
c9c0d073 BB |
65 | AC_SUBST(KERNELCPPFLAGS) |
66 | ]) | |
67 | ||
68 | dnl # | |
69 | dnl # Detect name used for Module.symvers file in kernel | |
70 | dnl # | |
71 | AC_DEFUN([ZFS_AC_MODULE_SYMVERS], [ | |
72 | modpost=$LINUX/scripts/Makefile.modpost | |
73 | AC_MSG_CHECKING([kernel file name for module symbols]) | |
8366cd6a PS |
74 | AS_IF([test -f "$modpost"], [ |
75 | AS_IF([grep -q Modules.symvers $modpost], [ | |
c9c0d073 | 76 | LINUX_SYMBOLS=Modules.symvers |
8366cd6a | 77 | ], [ |
c9c0d073 | 78 | LINUX_SYMBOLS=Module.symvers |
8366cd6a | 79 | ]) |
a60b1c0a | 80 | |
8366cd6a | 81 | AS_IF([test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"], [ |
a60b1c0a BB |
82 | AC_MSG_ERROR([ |
83 | *** Please make sure the kernel devel package for your distribution | |
84 | *** is installed. If your building with a custom kernel make sure the | |
85 | *** kernel is configured, built, and the '--with-linux=PATH' configure | |
86 | *** option refers to the location of the kernel source.]) | |
8366cd6a PS |
87 | ]) |
88 | ], [ | |
c9c0d073 | 89 | LINUX_SYMBOLS=NONE |
8366cd6a | 90 | ]) |
c9c0d073 BB |
91 | AC_MSG_RESULT($LINUX_SYMBOLS) |
92 | AC_SUBST(LINUX_SYMBOLS) | |
93 | ]) | |
94 | ||
95 | dnl # | |
96 | dnl # Detect the kernel to be built against | |
97 | dnl # | |
98 | AC_DEFUN([ZFS_AC_KERNEL], [ | |
99 | AC_ARG_WITH([linux], | |
100 | AS_HELP_STRING([--with-linux=PATH], | |
101 | [Path to kernel source]), | |
102 | [kernelsrc="$withval"]) | |
103 | ||
104 | AC_ARG_WITH(linux-obj, | |
105 | AS_HELP_STRING([--with-linux-obj=PATH], | |
106 | [Path to kernel build objects]), | |
107 | [kernelbuild="$withval"]) | |
108 | ||
109 | AC_MSG_CHECKING([kernel source directory]) | |
8366cd6a PS |
110 | AS_IF([test -z "$kernelsrc"], [ |
111 | AS_IF([test -e "/lib/modules/$(uname -r)/source"], [ | |
1b94c25c BB |
112 | headersdir="/lib/modules/$(uname -r)/source" |
113 | sourcelink=$(readlink -f "$headersdir") | |
8366cd6a | 114 | ], [test -e "/lib/modules/$(uname -r)/build"], [ |
1b94c25c | 115 | headersdir="/lib/modules/$(uname -r)/build" |
c9c0d073 | 116 | sourcelink=$(readlink -f "$headersdir") |
8366cd6a | 117 | ], [ |
c9c0d073 | 118 | sourcelink=$(ls -1d /usr/src/kernels/* \ |
8366cd6a | 119 | /usr/src/linux-* \ |
c9c0d073 | 120 | 2>/dev/null | grep -v obj | tail -1) |
8366cd6a | 121 | ]) |
c9c0d073 | 122 | |
8366cd6a | 123 | AS_IF([test -n "$sourcelink" && test -e ${sourcelink}], [ |
c9c0d073 | 124 | kernelsrc=`readlink -f ${sourcelink}` |
8366cd6a | 125 | ], [ |
c9c0d073 BB |
126 | AC_MSG_RESULT([Not found]) |
127 | AC_MSG_ERROR([ | |
128 | *** Please make sure the kernel devel package for your distribution | |
129 | *** is installed then try again. If that fails you can specify the | |
130 | *** location of the kernel source with the '--with-linux=PATH' option.]) | |
8366cd6a PS |
131 | ]) |
132 | ], [ | |
133 | AS_IF([test "$kernelsrc" = "NONE"], [ | |
c9c0d073 | 134 | kernsrcver=NONE |
8366cd6a PS |
135 | ]) |
136 | ]) | |
c9c0d073 BB |
137 | |
138 | AC_MSG_RESULT([$kernelsrc]) | |
139 | AC_MSG_CHECKING([kernel build directory]) | |
8366cd6a PS |
140 | AS_IF([test -z "$kernelbuild"], [ |
141 | AS_IF([test -e "/lib/modules/$(uname -r)/build"], [ | |
1b94c25c | 142 | kernelbuild=`readlink -f /lib/modules/$(uname -r)/build` |
8366cd6a | 143 | ], [test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}], [ |
c9c0d073 | 144 | kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu} |
8366cd6a | 145 | ], [test -d ${kernelsrc}-obj/${target_cpu}/default], [ |
c9c0d073 | 146 | kernelbuild=${kernelsrc}-obj/${target_cpu}/default |
8366cd6a | 147 | ], [test -d `dirname ${kernelsrc}`/build-${target_cpu}], [ |
c9c0d073 | 148 | kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu} |
8366cd6a | 149 | ], [ |
c9c0d073 | 150 | kernelbuild=${kernelsrc} |
8366cd6a PS |
151 | ]) |
152 | ]) | |
c9c0d073 BB |
153 | AC_MSG_RESULT([$kernelbuild]) |
154 | ||
155 | AC_MSG_CHECKING([kernel source version]) | |
156 | utsrelease1=$kernelbuild/include/linux/version.h | |
157 | utsrelease2=$kernelbuild/include/linux/utsrelease.h | |
158 | utsrelease3=$kernelbuild/include/generated/utsrelease.h | |
8366cd6a | 159 | AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [ |
c9c0d073 | 160 | utsrelease=linux/version.h |
8366cd6a | 161 | ], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [ |
c9c0d073 | 162 | utsrelease=linux/utsrelease.h |
8366cd6a | 163 | ], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [ |
c9c0d073 | 164 | utsrelease=generated/utsrelease.h |
8366cd6a | 165 | ]) |
c9c0d073 | 166 | |
8366cd6a | 167 | AS_IF([test "$utsrelease"], [ |
c9c0d073 BB |
168 | kernsrcver=`(echo "#include <$utsrelease>"; |
169 | echo "kernsrcver=UTS_RELEASE") | | |
170 | cpp -I $kernelbuild/include | | |
171 | grep "^kernsrcver=" | cut -d \" -f 2` | |
172 | ||
8366cd6a | 173 | AS_IF([test -z "$kernsrcver"], [ |
c9c0d073 BB |
174 | AC_MSG_RESULT([Not found]) |
175 | AC_MSG_ERROR([*** Cannot determine kernel version.]) | |
8366cd6a PS |
176 | ]) |
177 | ], [ | |
c9c0d073 BB |
178 | AC_MSG_RESULT([Not found]) |
179 | AC_MSG_ERROR([*** Cannot find UTS_RELEASE definition.]) | |
8366cd6a | 180 | ]) |
c9c0d073 BB |
181 | |
182 | AC_MSG_RESULT([$kernsrcver]) | |
183 | ||
184 | LINUX=${kernelsrc} | |
185 | LINUX_OBJ=${kernelbuild} | |
186 | LINUX_VERSION=${kernsrcver} | |
187 | ||
188 | AC_SUBST(LINUX) | |
189 | AC_SUBST(LINUX_OBJ) | |
190 | AC_SUBST(LINUX_VERSION) | |
191 | ||
192 | ZFS_AC_MODULE_SYMVERS | |
193 | ]) | |
194 | ||
195 | dnl # | |
196 | dnl # Detect name used for the additional SPL Module.symvers file. If one | |
197 | dnl # does not exist this is likely because the SPL has been configured | |
198 | dnl # but not built. To allow recursive builds a good guess is made as to | |
199 | dnl # what this file will be named based on what it is named in the kernel | |
200 | dnl # build products. This file will first be used at link time so if | |
201 | dnl # the guess is wrong the build will fail then. This unfortunately | |
202 | dnl # means the ZFS package does not contain a reliable mechanism to | |
203 | dnl # detect symbols exported by the SPL at configure time. | |
204 | dnl # | |
205 | AC_DEFUN([ZFS_AC_SPL_MODULE_SYMVERS], [ | |
206 | AC_MSG_CHECKING([spl file name for module symbols]) | |
8366cd6a | 207 | AS_IF([test -r $SPL_OBJ/Module.symvers], [ |
c9c0d073 | 208 | SPL_SYMBOLS=Module.symvers |
8366cd6a | 209 | ], [test -r $SPL_OBJ/Modules.symvers], [ |
c9c0d073 | 210 | SPL_SYMBOLS=Modules.symvers |
8366cd6a | 211 | ], [test -r $SPL_OBJ/module/Module.symvers], [ |
6283f55e | 212 | SPL_SYMBOLS=Module.symvers |
8366cd6a | 213 | ], [test -r $SPL_OBJ/module/Modules.symvers], [ |
6283f55e | 214 | SPL_SYMBOLS=Modules.symvers |
8366cd6a | 215 | ], [ |
c9c0d073 | 216 | SPL_SYMBOLS=$LINUX_SYMBOLS |
8366cd6a | 217 | ]) |
c9c0d073 BB |
218 | |
219 | AC_MSG_RESULT([$SPL_SYMBOLS]) | |
220 | AC_SUBST(SPL_SYMBOLS) | |
221 | ]) | |
222 | ||
223 | dnl # | |
224 | dnl # Detect the SPL module to be built against | |
225 | dnl # | |
226 | AC_DEFUN([ZFS_AC_SPL], [ | |
227 | AC_ARG_WITH([spl], | |
228 | AS_HELP_STRING([--with-spl=PATH], | |
229 | [Path to spl source]), | |
230 | [splsrc="$withval"]) | |
231 | ||
232 | AC_ARG_WITH([spl-obj], | |
233 | AS_HELP_STRING([--with-spl-obj=PATH], | |
234 | [Path to spl build objects]), | |
235 | [splbuild="$withval"]) | |
236 | ||
237 | ||
238 | AC_MSG_CHECKING([spl source directory]) | |
8366cd6a | 239 | AS_IF([test -z "$splsrc"], [ |
c9c0d073 BB |
240 | sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \ |
241 | 2>/dev/null | tail -1` | |
242 | ||
8366cd6a | 243 | AS_IF([test -z "$sourcelink" || test ! -e $sourcelink], [ |
c9c0d073 | 244 | sourcelink=../spl |
8366cd6a | 245 | ]) |
c9c0d073 | 246 | |
8366cd6a | 247 | AS_IF([test -e $sourcelink], [ |
c9c0d073 | 248 | splsrc=`readlink -f ${sourcelink}` |
8366cd6a | 249 | ], [ |
c9c0d073 BB |
250 | AC_MSG_RESULT([Not found]) |
251 | AC_MSG_ERROR([ | |
252 | *** Please make sure the spl devel package for your distribution | |
253 | *** is installed then try again. If that fails you can specify the | |
254 | *** location of the spl source with the '--with-spl=PATH' option.]) | |
8366cd6a PS |
255 | ]) |
256 | ], [ | |
257 | AS_IF([test "$splsrc" = "NONE"], [ | |
c9c0d073 BB |
258 | splbuild=NONE |
259 | splsrcver=NONE | |
8366cd6a PS |
260 | ]) |
261 | ]) | |
c9c0d073 BB |
262 | |
263 | AC_MSG_RESULT([$splsrc]) | |
264 | AC_MSG_CHECKING([spl build directory]) | |
8366cd6a | 265 | AS_IF([test -z "$splbuild"], [ |
6283f55e | 266 | splbuild=${splsrc} |
8366cd6a | 267 | ]) |
c9c0d073 BB |
268 | AC_MSG_RESULT([$splbuild]) |
269 | ||
270 | AC_MSG_CHECKING([spl source version]) | |
8366cd6a PS |
271 | AS_IF([test -r $splbuild/spl_config.h && |
272 | fgrep -q SPL_META_VERSION $splbuild/spl_config.h], [ | |
c9c0d073 BB |
273 | |
274 | splsrcver=`(echo "#include <spl_config.h>"; | |
b40a77ae | 275 | echo "splsrcver=SPL_META_VERSION-SPL_META_RELEASE") | |
5e612145 | 276 | cpp -I $splbuild | |
b40a77ae | 277 | grep "^splsrcver=" | tr -d \" | cut -d= -f2` |
8366cd6a | 278 | ]) |
c9c0d073 | 279 | |
8366cd6a | 280 | AS_IF([test -z "$splsrcver"], [ |
c9c0d073 BB |
281 | AC_MSG_RESULT([Not found]) |
282 | AC_MSG_ERROR([ | |
2984e0bb PS |
283 | *** Cannot determine the version of the spl source. |
284 | *** Please prepare the spl source before running this script]) | |
8366cd6a | 285 | ]) |
c9c0d073 BB |
286 | |
287 | AC_MSG_RESULT([$splsrcver]) | |
288 | ||
289 | SPL=${splsrc} | |
290 | SPL_OBJ=${splbuild} | |
291 | SPL_VERSION=${splsrcver} | |
292 | ||
293 | AC_SUBST(SPL) | |
294 | AC_SUBST(SPL_OBJ) | |
295 | AC_SUBST(SPL_VERSION) | |
296 | ||
297 | ZFS_AC_SPL_MODULE_SYMVERS | |
298 | ]) | |
299 | ||
15805c77 BB |
300 | dnl # |
301 | dnl # Certain kernel build options are not supported. These must be | |
302 | dnl # detected at configure time and cause a build failure. Otherwise | |
303 | dnl # modules may be successfully built that behave incorrectly. | |
304 | dnl # | |
305 | dnl # CONFIG_PREEMPT - Preempt kernels require special handling. | |
c9c0d073 BB |
306 | dnl # |
307 | dnl # There are certain kernel build options which when enabled are | |
308 | dnl # completely incompatible with non GPL kernel modules. It is best | |
309 | dnl # to detect these at configure time and fail with a clear error | |
310 | dnl # rather than build everything and fail during linking. | |
311 | dnl # | |
312 | dnl # CONFIG_DEBUG_LOCK_ALLOC - Maps mutex_lock() to mutex_lock_nested() | |
313 | dnl # | |
314 | AC_DEFUN([ZFS_AC_KERNEL_CONFIG], [ | |
315 | ||
15805c77 BB |
316 | ZFS_LINUX_CONFIG([PREEMPT], |
317 | AC_MSG_ERROR([ | |
2984e0bb PS |
318 | *** Kernel built with CONFIG_PREEMPT which is not supported. |
319 | *** You must rebuild your kernel without this option.]), []) | |
15805c77 | 320 | |
8366cd6a | 321 | AS_IF([test "$ZFS_META_LICENSE" = CDDL], [ |
c9c0d073 BB |
322 | ZFS_LINUX_CONFIG([DEBUG_LOCK_ALLOC], |
323 | AC_MSG_ERROR([ | |
2984e0bb PS |
324 | *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is |
325 | *** incompatible with the CDDL license. You must rebuild | |
326 | *** your kernel without this option.]), []) | |
8366cd6a | 327 | ]) |
c9c0d073 | 328 | |
8366cd6a | 329 | AS_IF([test "$ZFS_META_LICENSE" = GPL], [ |
c9c0d073 BB |
330 | AC_DEFINE([HAVE_GPL_ONLY_SYMBOLS], [1], |
331 | [Define to 1 if licensed under the GPL]) | |
8366cd6a | 332 | ]) |
c9c0d073 BB |
333 | ]) |
334 | ||
335 | dnl # | |
336 | dnl # ZFS_LINUX_CONFTEST | |
337 | dnl # | |
338 | AC_DEFUN([ZFS_LINUX_CONFTEST], [ | |
339 | cat confdefs.h - <<_ACEOF >conftest.c | |
340 | $1 | |
341 | _ACEOF | |
342 | ]) | |
343 | ||
344 | dnl # | |
345 | dnl # ZFS_LANG_PROGRAM(C)([PROLOGUE], [BODY]) | |
346 | dnl # | |
347 | m4_define([ZFS_LANG_PROGRAM], [ | |
348 | $1 | |
349 | int | |
350 | main (void) | |
351 | { | |
352 | dnl Do *not* indent the following line: there may be CPP directives. | |
353 | dnl Don't move the `;' right after for the same reason. | |
354 | $2 | |
355 | ; | |
356 | return 0; | |
357 | } | |
358 | ]) | |
359 | ||
360 | dnl # | |
361 | dnl # ZFS_LINUX_COMPILE_IFELSE / like AC_COMPILE_IFELSE | |
362 | dnl # | |
363 | AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [ | |
364 | m4_ifvaln([$1], [ZFS_LINUX_CONFTEST([$1])]) | |
365 | rm -Rf build && mkdir -p build | |
366 | echo "obj-m := conftest.o" >build/Makefile | |
367 | AS_IF( | |
368 | [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])], | |
369 | [$4], | |
370 | [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])] | |
371 | ) | |
372 | rm -Rf build | |
373 | ]) | |
374 | ||
375 | dnl # | |
376 | dnl # ZFS_LINUX_TRY_COMPILE like AC_TRY_COMPILE | |
377 | dnl # | |
378 | AC_DEFUN([ZFS_LINUX_TRY_COMPILE], | |
379 | [ZFS_LINUX_COMPILE_IFELSE( | |
380 | [AC_LANG_SOURCE([ZFS_LANG_PROGRAM([[$1]], [[$2]])])], | |
381 | [modules], | |
382 | [test -s build/conftest.o], | |
383 | [$3], [$4]) | |
384 | ]) | |
385 | ||
386 | dnl # | |
387 | dnl # ZFS_LINUX_CONFIG | |
388 | dnl # | |
389 | AC_DEFUN([ZFS_LINUX_CONFIG], | |
390 | [AC_MSG_CHECKING([whether Linux was built with CONFIG_$1]) | |
391 | ZFS_LINUX_TRY_COMPILE([ | |
0da78696 | 392 | #include <linux/module.h> |
c9c0d073 BB |
393 | ],[ |
394 | #ifndef CONFIG_$1 | |
395 | #error CONFIG_$1 not #defined | |
396 | #endif | |
397 | ],[ | |
398 | AC_MSG_RESULT([yes]) | |
399 | $2 | |
400 | ],[ | |
401 | AC_MSG_RESULT([no]) | |
402 | $3 | |
403 | ]) | |
404 | ]) | |
405 | ||
406 | dnl # | |
407 | dnl # ZFS_CHECK_SYMBOL_EXPORT | |
408 | dnl # check symbol exported or not | |
409 | dnl # | |
410 | AC_DEFUN([ZFS_CHECK_SYMBOL_EXPORT], | |
411 | [AC_MSG_CHECKING([whether symbol $1 is exported]) | |
412 | grep -q -E '[[[:space:]]]$1[[[:space:]]]' \ | |
413 | $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null | |
414 | rc=$? | |
8366cd6a | 415 | AS_IF([test $rc -ne 0], [ |
c9c0d073 BB |
416 | export=0 |
417 | for file in $2; do | |
418 | grep -q -E "EXPORT_SYMBOL.*($1)" "$LINUX/$file" 2>/dev/null | |
419 | rc=$? | |
8366cd6a PS |
420 | AS_IF([test $rc -eq 0], [ |
421 | export=1 | |
422 | break; | |
423 | ]) | |
c9c0d073 | 424 | done |
8366cd6a | 425 | AS_IF([test $export -eq 0], [ |
c9c0d073 BB |
426 | AC_MSG_RESULT([no]) |
427 | $4 | |
8366cd6a | 428 | ], [ |
c9c0d073 BB |
429 | AC_MSG_RESULT([yes]) |
430 | $3 | |
8366cd6a PS |
431 | ]) |
432 | ], [ | |
c9c0d073 BB |
433 | AC_MSG_RESULT([yes]) |
434 | $3 | |
8366cd6a | 435 | ]) |
c9c0d073 | 436 | ]) |