Whamcloud - gitweb
12efc01547f02e1420c19fb8cb5380c58ebb01f0
[fs/lustre-release.git] / libcfs / autoconf / lustre-libcfs.m4
1 #
2 # LIBCFS_CONFIG_CDEBUG
3 #
4 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
5 #
6 AC_DEFUN([LIBCFS_CONFIG_CDEBUG], [
7 AC_MSG_CHECKING([whether to enable CDEBUG, CWARN])
8 AC_ARG_ENABLE([libcfs_cdebug],
9         AC_HELP_STRING([--disable-libcfs-cdebug],
10                 [disable libcfs CDEBUG, CWARN]),
11         [], [enable_libcfs_cdebug="yes"])
12 AC_MSG_RESULT([$enable_libcfs_cdebug])
13 AS_IF([test "x$enable_libcfs_cdebug" = xyes],
14         [AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])])
15
16 AC_MSG_CHECKING([whether to enable ENTRY/EXIT])
17 AC_ARG_ENABLE([libcfs_trace],
18         AC_HELP_STRING([--disable-libcfs-trace],
19                 [disable libcfs ENTRY/EXIT]),
20         [], [enable_libcfs_trace="yes"])
21 AC_MSG_RESULT([$enable_libcfs_trace])
22 AS_IF([test "x$enable_libcfs_trace" = xyes],
23         [AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])])
24
25 AC_MSG_CHECKING([whether to enable LASSERT, LASSERTF])
26 AC_ARG_ENABLE([libcfs_assert],
27         AC_HELP_STRING([--disable-libcfs-assert],
28                 [disable libcfs LASSERT, LASSERTF]),
29         [], [enable_libcfs_assert="yes"])
30 AC_MSG_RESULT([$enable_libcfs_assert])
31 AS_IF([test x$enable_libcfs_assert = xyes],
32         [AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])])
33 ]) # LIBCFS_CONFIG_CDEBUG
34
35 #
36 # LIBCFS_CONFIG_PANIC_DUMPLOG
37 #
38 # check if tunable panic_dumplog is wanted
39 #
40 AC_DEFUN([LIBCFS_CONFIG_PANIC_DUMPLOG], [
41 AC_MSG_CHECKING([whether to use tunable 'panic_dumplog' support])
42 AC_ARG_ENABLE([panic_dumplog],
43         AC_HELP_STRING([--enable-panic_dumplog],
44                 [enable panic_dumplog]),
45         [], [enable_panic_dumplog="no"])
46 AC_MSG_RESULT([$enable_panic_dumplog])
47 AS_IF([test "x$enable_panic_dumplog" = xyes],
48         [AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])])
49 ]) # LIBCFS_CONFIG_PANIC_DUMPLOG
50
51 #
52 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
53 #
54 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
55 #
56 AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK], [
57 LB_CHECK_COMPILE([if 'struct stacktrace_ops' has 'walk_stack' field],
58 stacktrace_ops_walk_stack, [
59         #include <asm/stacktrace.h>
60 ],[
61         ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
62 ],[
63         AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1,
64                 ['struct stacktrace_ops' has 'walk_stack' field])
65 ])
66 ]) # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
67
68 #
69 # LIBCFS_STACKTRACE_WARNING
70 #
71 # 3.0 removes stacktrace_ops warning* functions
72 #
73 AC_DEFUN([LIBCFS_STACKTRACE_WARNING], [
74 LB_CHECK_COMPILE([if 'stacktrace_ops.warning' is exist],
75 stacktrace_ops_warning, [
76         struct task_struct;
77         struct pt_regs;
78         #include <asm/stacktrace.h>
79 ],[
80         ((struct stacktrace_ops *)0)->warning(NULL, NULL);
81 ],[
82         AC_DEFINE(HAVE_STACKTRACE_WARNING, 1,
83                 [stacktrace_ops.warning is exist])
84 ])
85 ]) # LIBCFS_STACKTRACE_WARNING
86
87 #
88 # LC_SHRINKER_WANT_SHRINK_PTR
89 #
90 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
91 #
92 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR], [
93 LB_CHECK_COMPILE([if 'shrinker' want self pointer in handler],
94 shrink_self_pointer, [
95         #include <linux/mm.h>
96 ],[
97         struct shrinker *tmp = NULL;
98         tmp->shrink(tmp, 0, 0);
99 ],[
100         AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
101                 [shrinker want self pointer in handler])
102 ])
103 ]) # LC_SHRINKER_WANT_SHRINK_PTR
104
105 #
106 # LIBCFS_SYSCTL_CTLNAME
107 #
108 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
109 #
110 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME], [
111 LB_CHECK_COMPILE([if 'ctl_table' has a 'ctl_name' field],
112 ctl_table_ctl_name, [
113         #include <linux/sysctl.h>
114 ],[
115         struct ctl_table ct;
116         ct.ctl_name = sizeof(ct);
117 ],[
118         AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
119                 [ctl_table has ctl_name field])
120 ])
121 ]) # LIBCFS_SYSCTL_CTLNAME
122
123 #
124 # LIBCFS_MODULE_LOCKING
125 #
126 # 2.6.36 introduced locking to module params. RHEL6 lacks this support
127 #
128 AC_DEFUN([LIBCFS_MODULE_LOCKING],[
129 LB_CHECK_COMPILE([does the kernel support module param locking],
130 module_param_locking, [
131         #include <linux/moduleparam.h>
132 ],[
133         __kernel_param_lock(NULL);
134         __kernel_param_unlock(NULL);
135 ],[
136         AC_DEFINE(HAVE_MODULE_PARAM_LOCKING, 1,
137                 [locking module param is supported])
138 ])
139 ]) # LIBCFS_MODULE_LOCKING
140
141 #
142 # LIBCFS_KSTRTOUL
143 #
144 # 2.6.38 kstrtoul is added
145 #
146 AC_DEFUN([LIBCFS_KSTRTOUL], [
147 LB_CHECK_COMPILE([if Linux kernel has 'kstrtoul'],
148 kstrtoul, [
149         #include <linux/kernel.h>
150 ],[
151         unsigned long result;
152         return kstrtoul("12345", 0, &result);
153 ],[
154         AC_DEFINE(HAVE_KSTRTOUL, 1,
155                 [kernel has kstrtoul])
156 ])
157 ]) # LIBCFS_KSTRTOUL
158
159 #
160 # LIBCFS_DUMP_TRACE_ADDRESS
161 #
162 # 2.6.39 adds a base pointer address argument to dump_trace
163 #
164 AC_DEFUN([LIBCFS_DUMP_TRACE_ADDRESS], [
165 LB_CHECK_COMPILE([if 'dump_trace' want address],
166 dump_trace_address, [
167         struct task_struct;
168         struct pt_regs;
169         #include <asm/stacktrace.h>
170 ],[
171         dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
172 ],[
173         AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
174                 [dump_trace want address argument])
175 ])
176 ]) # LIBCFS_DUMP_TRACE_ADDRESS
177
178 #
179 # LC_SHRINK_CONTROL
180 #
181 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
182 # pressure shrinker from Linux 3.0
183 #
184 AC_DEFUN([LC_SHRINK_CONTROL], [
185 LB_CHECK_COMPILE([if 'shrink_control' is present],
186 shrink_control, [
187         #include <linux/atomic.h>
188         #include <linux/mm.h>
189 ],[
190         struct shrink_control tmp = {0};
191         tmp.nr_to_scan = sizeof(tmp);
192 ],[
193         AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
194                 [shrink_control is present])
195 ])
196 ]) # LC_SHRINK_CONTROL
197
198 #
199 # LIBCFS_PROCESS_NAMESPACE
200 #
201 # 3.5 introduced process namespace
202 AC_DEFUN([LIBCFS_PROCESS_NAMESPACE], [
203 LB_CHECK_LINUX_HEADER([linux/uidgid.h], [
204         AC_DEFINE(HAVE_UIDGID_HEADER, 1,
205                 [uidgid.h is present])])
206 ]) # LIBCFS_PROCESS_NAMESPACE
207
208 #
209 # LIBCFS_I_UID_READ
210 #
211 # 3.5 added helpers to read the new uid/gid types from VFS structures
212 # SLE11 SP3 has uidgid.h but not the helpers
213 #
214 AC_DEFUN([LIBCFS_I_UID_READ], [
215 LB_CHECK_COMPILE([if 'i_uid_read' is present],
216 i_uid_read, [
217         #include <linux/fs.h>
218 ],[
219         i_uid_read(NULL);
220 ],[
221         AC_DEFINE(HAVE_I_UID_READ, 1, [i_uid_read is present])
222 ])
223 ]) # LIBCFS_I_UID_READ
224
225 #
226 # LIBCFS_HAVE_CRC32
227 #
228 AC_DEFUN([LIBCFS_HAVE_CRC32], [
229 LB_CHECK_CONFIG_IM([CRC32],
230         [have_crc32="yes"], [have_crc32="no"])
231 AS_IF([test "x$have_crc32" = xyes],
232         [AC_DEFINE(HAVE_CRC32, 1,
233                 [kernel compiled with CRC32 functions])])
234 ]) # LIBCFS_HAVE_CRC32
235
236 #
237 # LIBCFS_ENABLE_CRC32_ACCEL
238 #
239 AC_DEFUN([LIBCFS_ENABLE_CRC32_ACCEL], [
240 LB_CHECK_CONFIG_IM([CRYPTO_CRC32_PCLMUL],
241         [enable_crc32_crypto="no"], [enable_crc32_crypto="yes"])
242 AS_IF([test "x$have_crc32" = xyes -a "x$enable_crc32_crypto" = xyes], [
243         AC_DEFINE(NEED_CRC32_ACCEL, 1, [need pclmulqdq based crc32])
244         AC_MSG_WARN([No crc32 pclmulqdq crypto api found, enable internal pclmulqdq based crc32])])
245 ]) # LIBCFS_ENABLE_CRC32_ACCEL
246
247 #
248 # LIBCFS_ENABLE_CRC32C_ACCEL
249 #
250 AC_DEFUN([LIBCFS_ENABLE_CRC32C_ACCEL], [
251 LB_CHECK_CONFIG_IM([CRYPTO_CRC32C_INTEL],
252         [enable_crc32c_crypto="no"], [enable_crc32c_crypto="yes"])
253 AS_IF([test "x$enable_crc32c_crypto" = xyes], [
254         AC_DEFINE(NEED_CRC32C_ACCEL, 1, [need pclmulqdq based crc32c])
255         AC_MSG_WARN([No crc32c pclmulqdq crypto api found, enable internal pclmulqdq based crc32c])])
256 ]) # LIBCFS_ENABLE_CRC32C_ACCEL
257
258 #
259 # Kernel version 3.11 introduced ktime_get_ts64
260 #
261 AC_DEFUN([LIBCFS_KTIME_GET_TS64],[
262 LB_CHECK_COMPILE([does function 'ktime_get_ts64' exist],
263 ktime_get_ts64, [
264         #include <linux/hrtimer.h>
265         #include <linux/ktime.h>
266 ],[
267         struct timespec64 *ts = NULL;
268
269         ktime_get_ts64(ts);
270 ],[
271         AC_DEFINE(HAVE_KTIME_GET_TS64, 1,
272                 ['ktime_get_ts64' is available])
273 ])
274 ]) # LIBCFS_KTIME_GET_TS64
275
276 #
277 # Linux kernel 3.12 introduced struct kernel_param_ops
278 # This has been backported to all lustre supported
279 # clients except RHEL6. We have to handle the differences.
280 #
281 AC_DEFUN([LIBCFS_KERNEL_PARAM_OPS],[
282 LB_CHECK_COMPILE([does 'struct kernel_param_ops' exist],
283 kernel_param_ops, [
284         #include <linux/module.h>
285 ],[
286         struct kernel_param_ops ops;
287
288         ops.set = NULL;
289 ],[
290         AC_DEFINE(HAVE_KERNEL_PARAM_OPS, 1,
291                 ['struct kernel_param_ops' is available])
292 ])
293 ]) # LIBCFS_KERNEL_PARAM_OPS
294
295 #
296 # Kernel version 3.12 introduced ktime_add
297 #
298 AC_DEFUN([LIBCFS_KTIME_ADD],[
299 LB_CHECK_COMPILE([does function 'ktime_add' exist],
300 ktime_add, [
301         #include <linux/hrtimer.h>
302         #include <linux/ktime.h>
303 ],[
304         ktime_t start = ktime_set(0, 0);
305         ktime_t end = start;
306         ktime_t total;
307
308         total = ktime_add(start, end);
309 ],[
310         AC_DEFINE(HAVE_KTIME_ADD, 1,
311                 [ktime_add is available])
312 ])
313 ]) # LIBCFS_KTIME_ADD
314
315 #
316 # Kernel version 3.12 introduced ktime_after
317 #
318 AC_DEFUN([LIBCFS_KTIME_AFTER],[
319 LB_CHECK_COMPILE([does function 'ktime_after' exist],
320 ktime_after, [
321         #include <linux/hrtimer.h>
322         #include <linux/ktime.h>
323 ],[
324         ktime_t start = ktime_set(0, 0);
325         ktime_t end = start;
326
327         ktime_after(start, end);
328 ],[
329         AC_DEFINE(HAVE_KTIME_AFTER, 1,
330                 [ktime_after is available])
331 ])
332 ]) # LIBCFS_KTIME_AFTER
333
334 #
335 # Kernel version 3.12 introduced ktime_before
336 # See linux commit 67cb9366ff5f99868100198efba5ca88aaa6ad25
337 #
338 AC_DEFUN([LIBCFS_KTIME_BEFORE],[
339 LB_CHECK_COMPILE([does function 'ktime_before' exist],
340 ktime_before, [
341         #include <linux/hrtimer.h>
342         #include <linux/ktime.h>
343 ],[
344         ktime_t start = ktime_set(0, 0);
345         ktime_t end = start;
346
347         ktime_before(start, end);
348 ],[
349         AC_DEFINE(HAVE_KTIME_BEFORE, 1,
350                 [ktime_before is available])
351 ])
352 ]) # LIBCFS_KTIME_BEFORE
353
354 #
355 # Kernel version 3.12 introduced ktime_compare
356 #
357 AC_DEFUN([LIBCFS_KTIME_COMPARE],[
358 LB_CHECK_COMPILE([does function 'ktime_compare' exist],
359 ktime_compare, [
360         #include <linux/hrtimer.h>
361         #include <linux/ktime.h>
362 ],[
363         ktime_t start = ktime_set(0, 0);
364         ktime_t end = start;
365
366         ktime_compare(start, end);
367 ],[
368         AC_DEFINE(HAVE_KTIME_COMPARE, 1,
369                 [ktime_compare is available])
370 ])
371 ]) # LIBCFS_KTIME_COMPARE
372
373 #
374 # FC19 3.12 kernel struct shrinker change
375 #
376 AC_DEFUN([LIBCFS_SHRINKER_COUNT],[
377 LB_CHECK_COMPILE([shrinker has 'count_objects'],
378 shrinker_count_objects, [
379         #include <linux/mmzone.h>
380         #include <linux/shrinker.h>
381 ],[
382         struct shrinker shrinker;
383
384         shrinker.count_objects = NULL;
385 ],[
386         AC_DEFINE(HAVE_SHRINKER_COUNT, 1,
387                 [shrinker has count_objects member])
388 ])
389 ]) # LIBCFS_SHRINKER_COUNT
390
391 #
392 # Kernel version 3.17 changed hlist_add_after to
393 # hlist_add_behind
394 #
395 AC_DEFUN([LIBCFS_HLIST_ADD_AFTER],[
396 LB_CHECK_COMPILE([does function 'hlist_add_after' exist],
397 hlist_add_after, [
398         #include <linux/list.h>
399 ],[
400         hlist_add_after(NULL, NULL);
401 ],[
402         AC_DEFINE(HAVE_HLIST_ADD_AFTER, 1,
403                 [hlist_add_after is available])
404 ])
405 ]) # LIBCFS_HLIST_ADD_AFTER
406
407 #
408 # Kernel version 3.17 introduced struct timespec64
409 #
410 AC_DEFUN([LIBCFS_TIMESPEC64],[
411 LB_CHECK_COMPILE([does 'struct timespec64' exist],
412 timespec64, [
413         #include <linux/time.h>
414 ],[
415         struct timespec64 ts;
416
417         ts.tv_sec = 0;
418         ts.tv_nsec = 0;
419 ],[
420         AC_DEFINE(HAVE_TIMESPEC64, 1,
421                 ['struct timespec64' is available])
422 ])
423 ]) # LIBCFS_TIMESPEC64
424
425 #
426 # Kernel version 3.17 introduced ktime_get_real_ts64
427 #
428 AC_DEFUN([LIBCFS_KTIME_GET_REAL_TS64],[
429 LB_CHECK_COMPILE([does function 'ktime_get_real_ts64' exist],
430 ktime_get_real_ts64, [
431         #include <linux/ktime.h>
432 ],[
433         struct timespec64 *ts = NULL;
434
435         ktime_get_real_ts64(ts);
436 ],[
437         AC_DEFINE(HAVE_KTIME_GET_REAL_TS64, 1,
438                 ['ktime_get_real_ts64' is available])
439 ])
440 ]) # LIBCFS_KTIME_GET_REAL_TS64
441
442 #
443 # Kernel version 3.17 introduced ktime_get_real_seconds
444 #
445 AC_DEFUN([LIBCFS_KTIME_GET_REAL_SECONDS],[
446 LB_CHECK_COMPILE([does function 'ktime_get_real_seconds' exist],
447 ktime_get_real_seconds, [
448         #include <linux/hrtimer.h>
449         #include <linux/ktime.h>
450 ],[
451         time64_t now;
452
453         now = ktime_get_real_seconds();
454 ],[
455         AC_DEFINE(HAVE_KTIME_GET_REAL_SECONDS, 1,
456                 ['ktime_get_real_seconds' is available])
457 ])
458 ]) # LIBCFS_KTIME_GET_REAL_SECONDS
459
460 #
461 # Kernel version 3.17 created ktime_get_ns wrapper
462 #
463 AC_DEFUN([LIBCFS_KTIME_GET_NS],[
464 LB_CHECK_COMPILE([does function 'ktime_get_ns' exist],
465 ktime_get_ns, [
466         #include <linux/hrtimer.h>
467         #include <linux/ktime.h>
468 ],[
469         u64 nanoseconds;
470
471         nanoseconds = ktime_get_ns();
472 ],[],[
473         AC_DEFINE(NEED_KTIME_GET_NS, 1,
474                 ['ktime_get_ns' is not available])
475 ])
476 ]) # LIBCFS_KTIME_GET_NS
477
478 #
479 # Kernel version 3.17 created ktime_get_real_ns wrapper
480 #
481 AC_DEFUN([LIBCFS_KTIME_GET_REAL_NS],[
482 LB_CHECK_COMPILE([does function 'ktime_get_real_ns' exist],
483 ktime_get_real_ns, [
484         #include <linux/hrtimer.h>
485         #include <linux/ktime.h>
486 ],[
487         u64 nanoseconds;
488
489         nanoseconds = ktime_get_real_ns();
490 ],[],[
491         AC_DEFINE(NEED_KTIME_GET_REAL_NS, 1,
492                 ['ktime_get_real_ns' is not available])
493 ])
494 ]) # LIBCFS_KTIME_GET_REAL_NS
495
496 #
497 # Kernel version 3.17 introduced ktime_to_timespec64
498 #
499 AC_DEFUN([LIBCFS_KTIME_TO_TIMESPEC64],[
500 LB_CHECK_COMPILE([does function 'ktime_to_timespec64' exist],
501 ktime_to_timespec64, [
502         #include <linux/hrtimer.h>
503         #include <linux/ktime.h>
504 ],[
505         ktime_t now = ktime_set(0, 0);
506         struct timespec64 ts;
507
508         ts = ktime_to_timespec64(now);
509 ],[
510         AC_DEFINE(HAVE_KTIME_TO_TIMESPEC64, 1,
511                 ['ktime_to_timespec64' is available])
512 ])
513 ]) # LIBCFS_KTIME_TO_TIMESPEC64
514
515 #
516 # Kernel version 3.17 introduced timespec64_sub
517 #
518 AC_DEFUN([LIBCFS_TIMESPEC64_SUB],[
519 LB_CHECK_COMPILE([does function 'timespec64_sub' exist],
520 timespec64_sub, [
521         #include <linux/time.h>
522 ],[
523         struct timespec64 later = { }, earlier = { }, diff;
524
525         diff = timespec64_sub(later, earlier);
526 ],[
527         AC_DEFINE(HAVE_TIMESPEC64_SUB, 1,
528                 ['timespec64_sub' is available])
529 ])
530 ]) # LIBCFS_TIMESPEC64_SUB
531
532 #
533 # Kernel version 3.17 introduced timespec64_to_ktime
534 #
535 AC_DEFUN([LIBCFS_TIMESPEC64_TO_KTIME],[
536 LB_CHECK_COMPILE([does function 'timespec64_to_ktime' exist],
537 timespec64_to_ktime, [
538         #include <linux/ktime.h>
539 ],[
540         struct timespec64 ts;
541         ktime_t now;
542
543         now = timespec64_to_ktime(ts);
544 ],[
545         AC_DEFINE(HAVE_TIMESPEC64_TO_KTIME, 1,
546                 ['timespec64_to_ktime' is available])
547 ])
548 ]) # LIBCFS_TIMESPEC64_TO_KTIME
549
550 #
551 # Kernel version 3.19 introduced ktime_get_seconds
552 #
553 AC_DEFUN([LIBCFS_KTIME_GET_SECONDS],[
554 LB_CHECK_COMPILE([does function 'ktime_get_seconds' exist],
555 ktime_get_seconds, [
556         #include <linux/ktime.h>
557 ],[
558         time64_t now;
559
560         now = ktime_get_seconds();
561 ],[
562         AC_DEFINE(HAVE_KTIME_GET_SECONDS, 1,
563                 ['ktime_get_seconds' is available])
564 ])
565 ]) # LIBCFS_KTIME_GET_SECONDS
566
567 #
568 # Kernel version 4.0 commit 41fbf3b39d5eca01527338b4d0ee15ee1ae1023c
569 # introduced the helper function ktime_ms_delta.
570 #
571 AC_DEFUN([LIBCFS_KTIME_MS_DELTA],[
572 LB_CHECK_COMPILE([does function 'ktime_ms_delta' exist],
573 ktime_ms_delta, [
574         #include <linux/ktime.h>
575 ],[
576         ktime_t start = ktime_set(0, 0);
577         ktime_t end = start;
578
579         ktime_ms_delta(start, end);
580 ],[
581         AC_DEFINE(HAVE_KTIME_MS_DELTA, 1,
582                 ['ktime_ms_delta' is available])
583 ])
584 ]) # LIBCFS_KTIME_MS_DELTA
585
586 #
587 # Kernel version 4.1 commit b51d23e4e9fea6f264d39535c2a62d1f51e7ccc3
588 # create per module locks which added kernel_param_[un]lock(). Older
589 # kernels you have to use __kernel_param_[un]lock(). In that case its
590 # a global lock for all modules but that is okay since its a rare event.
591 #
592 AC_DEFUN([LIBCFS_KERNEL_PARAM_LOCK],[
593 LB_CHECK_COMPILE([does function 'kernel_param_[un]lock' exist],
594 kernel_param_lock, [
595         #include <linux/moduleparam.h>
596 ],[
597         kernel_param_lock(NULL);
598         kernel_param_unlock(NULL);
599 ],[
600         AC_DEFINE(HAVE_KERNEL_PARAM_LOCK, 1,
601                 ['kernel_param_[un]lock' is available])
602 ])
603 ]) # LIBCFS_KERNEL_PARAM_LOCK
604
605 #
606 # Kernel version 4.2 changed topology_thread_cpumask
607 # to topology_sibling_cpumask
608 #
609 AC_DEFUN([LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK],[
610 LB_CHECK_COMPILE([does function 'topology_sibling_cpumask' exist],
611 topology_sibling_cpumask, [
612         #include <linux/topology.h>
613 ],[
614         const struct cpumask *mask;
615
616         mask = topology_sibling_cpumask(0);
617 ],[
618         AC_DEFINE(HAVE_TOPOLOGY_SIBLING_CPUMASK, 1,
619                 [topology_sibling_cpumask is available])
620 ])
621 ]) # LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
622
623 #
624 # Kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
625 # header file i387.h was renamed to fpu/api.h
626 #
627 AC_DEFUN([LIBCFS_FPU_API], [
628 LB_CHECK_LINUX_HEADER([asm/fpu/api.h], [
629         AC_DEFINE(HAVE_FPU_API_HEADER, 1,
630                 [fpu/api.h is present])])
631 ]) # LIBCFS_FPU_API
632
633 #
634 # Kernel version 4.4 commit ef951599074ba4fad2d0efa0a977129b41e6d203
635 # introduced kstrtobool and kstrtobool_from_user.
636 #
637 AC_DEFUN([LIBCFS_KSTRTOBOOL_FROM_USER], [
638 LB_CHECK_COMPILE([if Linux kernel has 'kstrtobool_from_user'],
639 kstrtobool_from_user, [
640         #include <linux/kernel.h>
641 ],[
642         bool result;
643         return kstrtobool_from_user(NULL, 0, &result);
644 ],[
645         AC_DEFINE(HAVE_KSTRTOBOOL_FROM_USER, 1,
646                 [kernel has kstrtobool_from_user])
647 ])
648 ]) # LIBCFS_KSTRTOBOOL_FROM_USER
649
650 #
651 # Kernel version 4.5-rc1 commit d12481bc58fba89427565f8592e88446ec084a24
652 # added crypto hash helpers
653 #
654 AC_DEFUN([LIBCFS_CRYPTO_HASH_HELPERS], [
655 LB_CHECK_COMPILE([does crypto hash helper functions exist],
656 crypto_hash_helpers, [
657         #include <crypto/hash.h>
658 ],[
659         crypto_ahash_alg_name(NULL);
660         crypto_ahash_driver_name(NULL);
661 ],[
662         AC_DEFINE(HAVE_CRYPTO_HASH_HELPERS, 1,
663                 [crypto hash helper functions are available])
664 ])
665 ]) # LIBCFS_CRYPTO_HASH_HELPERS
666
667 #
668 # Kernerl version 4.5-rc3 commit 2fe829aca9d7bed5fd6b49c6a1452e5e486b6cc3dd
669 # made kset_find_obj() exportable to modules
670 #
671 AC_DEFUN([LIBCFS_EXPORT_KSET_FIND_OBJ], [
672 LB_CHECK_EXPORT([kset_find_obj], [lib/kobject.c],
673         [AC_DEFINE(HAVE_KSET_FIND_OBJ, 1,
674                 [kset_find_obj is exported by the kernel])])
675 ]) # LIBCFS_EXPORT_KSET_FIND_OBJ
676
677 #
678 # Kernel version 4.6+ commit ef703f49a6c5b909a85149bb6625c4ed0d697186
679 # fixed the brokenness of hash_64(). The fix removed GOLDEN_RATIO_PRIME_64
680 # since it was a poor prime value.
681 #
682 AC_DEFUN([LIBCFS_BROKEN_HASH_64], [
683 LB_CHECK_COMPILE([kernel has fixed hash_64()],
684 broken_hash_64, [
685         #include <linux/hash.h>
686 ],[
687         int tmp = GOLDEN_RATIO_PRIME_64;
688 ],[
689         AC_DEFINE(HAVE_BROKEN_HASH_64, 1, [kernel hash_64() is broken])
690 ])
691 ]) # LIBCFS_BROKEN_HASH_64
692
693 #
694 # LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
695 #
696 # linux 4.6 kernel changed stacktrace_ops address to return an int
697 #
698 AC_DEFUN([LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT], [
699 LB_CHECK_COMPILE([if 'struct stacktrace_ops' address function returns an int],
700 stacktrace_ops_address_return_int, [
701         #include <asm/stacktrace.h>
702 ],[
703         int rc;
704
705         rc = ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
706 ],[
707         AC_DEFINE(STACKTRACE_OPS_ADDRESS_RETURN_INT, 1,
708                 ['struct stacktrace_ops' address function returns an int])
709 ])
710 ]) # LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
711
712 #
713 # Kernel version 4.6 removed both struct task_struct and struct mm_struct
714 # arguments to get_user_pages
715 #
716 AC_DEFUN([LIBCFS_GET_USER_PAGES_6ARG], [
717 LB_CHECK_COMPILE([if 'get_user_pages()' takes 6 arguments],
718 get_user_pages_6arg, [
719         #include <linux/mm.h>
720 ],[
721         int rc;
722
723         rc = get_user_pages(0, 0, 0, 0, NULL, NULL);
724 ],[
725         AC_DEFINE(HAVE_GET_USER_PAGES_6ARG, 1,
726                 [get_user_pages takes 6 arguments])
727 ])
728 ]) # LIBCFS_GET_USER_PAGES_6ARG
729
730 #
731 # LIBCFS_STRINGHASH
732 #
733 # 4.6 kernel created stringhash.h which moved stuff out of dcache.h
734 # commit f4bcbe792b8f434e32487cff9d9e30ab45a3ce02
735 #
736 AC_DEFUN([LIBCFS_STRINGHASH], [
737 LB_CHECK_LINUX_HEADER([linux/stringhash.h], [
738         AC_DEFINE(HAVE_STRINGHASH, 1,
739                 [stringhash.h is present])])
740 ]) # LIBCFS_STRINGHASH
741
742 #
743 # LIBCFS_RHASHTABLE_INSERT_FAST
744 #
745 # 4.7+ kernel commit 5ca8cc5bf11faed257c762018aea9106d529232f
746 # changed __rhashtable_insert_fast to support the new function
747 # rhashtable_lookup_get_insert_key().
748 #
749 AC_DEFUN([LIBCFS_RHASHTABLE_INSERT_FAST], [
750 tmp_flags="$EXTRA_KCFLAGS"
751 EXTRA_KCFLAGS="-Werror"
752 LB_CHECK_COMPILE([if internal '__rhashtable_insert_fast()' returns int],
753 rhashtable_insert_fast, [
754         #include <linux/rhashtable.h>
755 ],[
756         const struct rhashtable_params params = { 0 };
757         int rc;
758
759         rc = __rhashtable_insert_fast(NULL, NULL, NULL, params);
760 ],[
761         AC_DEFINE(HAVE_HASHTABLE_INSERT_FAST_RETURN_INT, 1,
762                   ['__rhashtable_insert_fast()' returns int])
763 ])
764 EXTRA_KCFLAGS="$tmp_flags"
765 ]) # LIBCFS_RHASHTABLE_INSERT_FAST
766
767 #
768 # Kernel version 4.8-rc6 commit ca26893f05e86497a86732768ec53cd38c0819ca
769 # introduced rhashtable_lookup
770 #
771 AC_DEFUN([LIBCFS_RHASHTABLE_LOOKUP], [
772 LB_CHECK_COMPILE([if 'rhashtable_lookup' exist],
773 rhashtable_lookup, [
774         #include <linux/rhashtable.h>
775 ],[
776         const struct rhashtable_params params = { 0 };
777         void *ret;
778
779         ret = rhashtable_lookup(NULL, NULL, params);
780 ],[
781         AC_DEFINE(HAVE_RHASHTABLE_LOOKUP, 1,
782                 [rhashtable_lookup() is available])
783 ])
784 ]) # LIBCFS_RHASHTABLE_LOOKUP
785
786 #
787 # LIBCFS_RHLTABLE
788 # Kernel version 4.8-rc6 commit ca26893f05e86497a86732768ec53cd38c0819ca
789 # created the rhlist interface to allow inserting duplicate objects
790 # into the same table.
791 #
792 AC_DEFUN([LIBCFS_RHLTABLE], [
793 LB_CHECK_COMPILE([does 'struct rhltable' exist],
794 rhtable, [
795         #include <linux/rhashtable.h>
796 ],[
797         struct rhltable *hlt;
798
799         rhltable_destroy(hlt);
800 ],[
801         AC_DEFINE(HAVE_RHLTABLE, 1,
802                   [struct rhltable exist])
803 ])
804 ]) # LIBCFS_RHLTABLE
805
806 #
807 # LIBCFS_STACKTRACE_OPS
808 #
809 # Kernel version 4.8 commit c8fe4609827aedc9c4b45de80e7cdc8ccfa8541b
810 # removed both struct stacktrace_ops and dump_trace() function
811 #
812 AC_DEFUN([LIBCFS_STACKTRACE_OPS], [
813 LB_CHECK_COMPILE([if 'struct stacktrace_ops' exists],
814 stacktrace_ops, [
815         struct task_struct;
816         struct pt_regs;
817         #include <asm/stacktrace.h>
818 ],[
819         struct stacktrace_ops ops;
820         ops.stack = NULL;
821 ],[
822         AC_DEFINE(HAVE_STACKTRACE_OPS, 1,
823                 [struct stacktrace_ops exists])
824 ])
825 ]) # LIBCFS_STACKTRACE_OPS
826
827 #
828 # Kernel version 4.9 commit 768ae309a96103ed02eb1e111e838c87854d8b51
829 # mm: replace get_user_pages() write/force parameters with gup_flags
830 #
831 AC_DEFUN([LIBCFS_GET_USER_PAGES_GUP_FLAGS], [
832 LB_CHECK_COMPILE([if 'get_user_pages()' takes gup_flags in arguments],
833 get_user_pages_gup_flags, [
834         #include <linux/mm.h>
835 ],[
836         int rc;
837         rc = get_user_pages(0, 0, FOLL_WRITE, NULL, NULL);
838 ],[
839         AC_DEFINE(HAVE_GET_USER_PAGES_GUP_FLAGS, 1,
840                 [get_user_pages takes gup_flags in arguments])
841 ])
842 ]) # LIBCFS_GET_USER_PAGES_GUP_FLAGS
843
844 #
845 # Kernel version 4.10 commit 7b737965b33188bd3dbb44e938535c4006d97fbb
846 # libcfs: Convert to hotplug state machine
847 #
848 AC_DEFUN([LIBCFS_HOTPLUG_STATE_MACHINE], [
849 LB_CHECK_COMPILE([if libcfs supports CPU hotplug state machine],
850 cpu_hotplug_state_machine, [
851         #include <linux/cpuhotplug.h>
852 ],[
853         cpuhp_remove_state(CPUHP_LUSTRE_CFS_DEAD);
854 ],[
855         AC_DEFINE(HAVE_HOTPLUG_STATE_MACHINE, 1,
856                 [hotplug state machine is supported])
857 ])
858 ]) # LIBCFS_HOTPLUG_STATE_MACHINE
859
860 #
861 # LIBCFS_SCHED_HEADERS
862 #
863 # 4.11 has broken up sched.h into more headers.
864 #
865 AC_DEFUN([LIBCFS_SCHED_HEADERS], [
866 LB_CHECK_LINUX_HEADER([linux/sched/signal.h], [
867         AC_DEFINE(HAVE_SCHED_HEADERS, 1,
868                 [linux/sched header directory exist])])
869 ]) # LIBCFS_SCHED_HEADERS
870
871 #
872 # Kernel version 4.11 commit f9fe1c12d126f9887441fa5bb165046f30ddd4b5
873 # introduced rhashtable_lookup_get_insert_fast
874 #
875 AC_DEFUN([LIBCFS_RHASHTABLE_LOOKUP_GET_INSERT_FAST], [
876 LB_CHECK_COMPILE([if 'rhashtable_lookup_get_insert_fast' exist],
877 rhashtable_lookup_get_insert_fast, [
878         #include <linux/rhashtable.h>
879 ],[
880         const struct rhashtable_params params = { 0 };
881         void *ret;
882
883         ret = rhashtable_lookup_get_insert_fast(NULL, NULL, params);
884 ],[
885         AC_DEFINE(HAVE_RHASHTABLE_LOOKUP_GET_INSERT_FAST, 1,
886                 [rhashtable_lookup_get_insert_fast() is available])
887 ])
888 ]) # LIBCFS_RHASHTABLE_LOOKUP_GET_INSERT_FAST
889
890 #
891 # Kernel version 4.12-rc3 f9727a17db9bab71ddae91f74f11a8a2f9a0ece6
892 # renamed uuid_be to uuid_t
893 #
894 AC_DEFUN([LIBCFS_UUID_T], [
895 LB_CHECK_COMPILE([if 'uuid_t' exist],
896 uuid_t, [
897         #include <linux/uuid.h>
898 ],[
899         uuid_t uuid;
900
901         memset(uuid.b, 0, 16);
902 ],[
903         AC_DEFINE(HAVE_UUID_T, 1, ['uuid_t' exist])
904 ])
905 ]) # LIBCFS_UUID_T
906
907 #
908 # Kernel version 4.12-rc3 commit fd851a3cdc196bfc1d229b5f22369069af532bf8
909 # introduce processor.h
910 #
911 AC_DEFUN([LIBCFS_HAVE_PROCESSOR_HEADER], [
912 LB_CHECK_LINUX_HEADER([linux/processor.h], [
913         AC_DEFINE(HAVE_PROCESSOR_H, 1,
914                 [processor.h is present])])
915 ]) # LIBCFS_HAVE_PROCESSOR_HEADER
916
917
918 #
919 # LIBCFS_WAIT_QUEUE_ENTRY
920 #
921 # Kernel version 4.13 ac6424b981bce1c4bc55675c6ce11bfe1bbfa64f
922 # Rename wait_queue_t => wait_queue_entry_t
923 #
924 AC_DEFUN([LIBCFS_WAIT_QUEUE_ENTRY], [
925 LB_CHECK_COMPILE([if 'wait_queue_entry_t' exists],
926 wait_queue_entry, [
927         #include <linux/wait.h>
928 ],[
929         wait_queue_entry_t e;
930
931         e.flags = 0;
932 ],[
933         AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY, 1,
934                 ['wait_queue_entry_t' is available])
935 ])
936 ]) # LIBCFS_WAIT_QUEUE_ENTRY
937
938 #
939 # LIBCFS_NEW_KERNEL_WRITE
940 #
941 # Kernel version 4.14 e13ec939e96b13e664bb6cee361cc976a0ee621a
942 # changed kernel_write prototype to make is plug compatible
943 # with the unexported vfs_write()
944 #
945 AC_DEFUN([LIBCFS_NEW_KERNEL_WRITE], [
946 tmp_flags="$EXTRA_KCFLAGS"
947 EXTRA_KCFLAGS="-Werror"
948 LB_CHECK_COMPILE([if 'kernel_write' matches other read/write helpers],
949 kernel_write_match, [
950         #include <linux/fs.h>
951 ],[
952         const void *buf = NULL;
953         loff_t pos = 0;
954         return kernel_write(NULL, buf, 0, &pos);
955 ],[
956         AC_DEFINE(HAVE_NEW_KERNEL_WRITE, 1,
957                 ['kernel_write' aligns with read/write helpers])
958 ])
959 EXTRA_KCFLAGS="$tmp_flags"
960 ]) # LIBCFS_NEW_KERNEL_WRITE
961
962 #
963 # LIBCFS_DEFINE_TIMER
964 #
965 # Kernel version 4.14 commit 1d27e3e2252ba9d949ca82fbdb73cde102cb2067
966 # remove expires and data arguments from DEFINE_TIMER. Also the callback
967 # when from using unsigned long argument to using struct timer_list pointer.
968 #
969 AC_DEFUN([LIBCFS_DEFINE_TIMER], [
970 LB_CHECK_COMPILE([if DEFINE_TIMER takes only 2 arguments],
971 define_timer, [
972         #include <linux/timer.h>
973 ],[
974         static DEFINE_TIMER(my_timer, NULL);
975 ],[
976         AC_DEFINE(HAVE_NEW_DEFINE_TIMER, 1,
977                 [DEFINE_TIMER uses only 2 arguements])
978 ])
979 ]) # LIBCFS_DEFINE_TIMER
980
981 #
982 # LIBCFS_TIMER_SETUP
983 #
984 # Kernel version 4.15 commit e99e88a9d2b067465adaa9c111ada99a041bef9a
985 # setup_timer() was replaced by timer_setup(), where the callback
986 # argument is the structure already holding the struct timer_list.
987 #
988 AC_DEFUN([LIBCFS_TIMER_SETUP], [
989 LB_CHECK_COMPILE([if setup_timer has been replaced with timer_setup],
990 timer_setup, [
991         #include <linux/timer.h>
992 ],[
993         timer_setup(NULL, NULL, 0);
994 ],[
995         AC_DEFINE(HAVE_TIMER_SETUP, 1,
996                 [timer_setup has replaced setup_timer])
997 ])
998 ]) # LIBCFS_TIMER_SETUP
999
1000 #
1001 # LIBCFS_PROG_LINUX
1002 #
1003 # LibCFS linux kernel checks
1004 #
1005 AC_DEFUN([LIBCFS_PROG_LINUX], [
1006 AC_MSG_NOTICE([LibCFS kernel checks
1007 ==============================================================================])
1008 LIBCFS_CONFIG_PANIC_DUMPLOG
1009
1010 # 2.6.32
1011 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
1012 LC_SHRINKER_WANT_SHRINK_PTR
1013 # 2.6.33
1014 LIBCFS_SYSCTL_CTLNAME
1015 # 2.6.36
1016 LIBCFS_MODULE_LOCKING
1017 # 2.6.38
1018 LIBCFS_KSTRTOUL
1019 # 2.6.39
1020 LIBCFS_DUMP_TRACE_ADDRESS
1021 # 2.6.40 fc15
1022 LC_SHRINK_CONTROL
1023 # 3.0
1024 LIBCFS_STACKTRACE_WARNING
1025 # 3.5
1026 LIBCFS_PROCESS_NAMESPACE
1027 LIBCFS_I_UID_READ
1028 # 3.8
1029 LIBCFS_HAVE_CRC32
1030 LIBCFS_ENABLE_CRC32_ACCEL
1031 # 3.10
1032 LIBCFS_ENABLE_CRC32C_ACCEL
1033 # 3.11
1034 LIBCFS_KTIME_GET_TS64
1035 # 3.12
1036 LIBCFS_KERNEL_PARAM_OPS
1037 LIBCFS_KTIME_ADD
1038 LIBCFS_KTIME_AFTER
1039 LIBCFS_KTIME_BEFORE
1040 LIBCFS_KTIME_COMPARE
1041 LIBCFS_SHRINKER_COUNT
1042 # 3.17
1043 LIBCFS_HLIST_ADD_AFTER
1044 LIBCFS_TIMESPEC64
1045 LIBCFS_KTIME_GET_NS
1046 LIBCFS_KTIME_GET_REAL_TS64
1047 LIBCFS_KTIME_GET_REAL_SECONDS
1048 LIBCFS_KTIME_GET_REAL_NS
1049 LIBCFS_KTIME_TO_TIMESPEC64
1050 LIBCFS_TIMESPEC64_SUB
1051 LIBCFS_TIMESPEC64_TO_KTIME
1052 # 3.19
1053 LIBCFS_KTIME_GET_SECONDS
1054 # 4.0
1055 LIBCFS_KTIME_MS_DELTA
1056 # 4.1
1057 LIBCFS_KERNEL_PARAM_LOCK
1058 # 4.2
1059 LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
1060 LIBCFS_FPU_API
1061 # 4.4
1062 LIBCFS_KSTRTOBOOL_FROM_USER
1063 # 4.5
1064 LIBCFS_CRYPTO_HASH_HELPERS
1065 LIBCFS_EXPORT_KSET_FIND_OBJ
1066 # 4.6
1067 LIBCFS_BROKEN_HASH_64
1068 LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
1069 LIBCFS_GET_USER_PAGES_6ARG
1070 LIBCFS_STRINGHASH
1071 # 4.7
1072 LIBCFS_RHASHTABLE_INSERT_FAST
1073 # 4.8
1074 LIBCFS_RHASHTABLE_LOOKUP
1075 LIBCFS_RHLTABLE
1076 LIBCFS_STACKTRACE_OPS
1077 # 4.9
1078 LIBCFS_GET_USER_PAGES_GUP_FLAGS
1079 # 4.10
1080 LIBCFS_HOTPLUG_STATE_MACHINE
1081 # 4.11
1082 LIBCFS_RHASHTABLE_LOOKUP_GET_INSERT_FAST
1083 LIBCFS_SCHED_HEADERS
1084 # 4.12
1085 LIBCFS_HAVE_PROCESSOR_HEADER
1086 LIBCFS_UUID_T
1087 # 4.13
1088 LIBCFS_WAIT_QUEUE_ENTRY
1089 # 4.14
1090 LIBCFS_DEFINE_TIMER
1091 LIBCFS_NEW_KERNEL_WRITE
1092 # 4.15
1093 LIBCFS_TIMER_SETUP
1094 ]) # LIBCFS_PROG_LINUX
1095
1096 #
1097 # LIBCFS_PATH_DEFAULTS
1098 #
1099 # default paths for installed files
1100 #
1101 AC_DEFUN([LIBCFS_PATH_DEFAULTS], [
1102 ]) # LIBCFS_PATH_DEFAULTS
1103
1104 #
1105 # LIBCFS_CONFIGURE
1106 #
1107 # other configure checks
1108 #
1109 AC_DEFUN([LIBCFS_CONFIGURE], [
1110 AC_MSG_NOTICE([LibCFS core checks
1111 ==============================================================================])
1112
1113 # libcfs/libcfs/util/nidstrings.c
1114 AC_CHECK_HEADERS([netdb.h asm/types.h endian.h])
1115 AC_CHECK_FUNCS([gethostbyname])
1116
1117 # --------  Check for required packages  --------------
1118
1119 AC_MSG_NOTICE([LibCFS required packages checks
1120 ==============================================================================])
1121
1122 AC_MSG_CHECKING([whether to enable readline support])
1123 AC_ARG_ENABLE(readline,
1124         AC_HELP_STRING([--disable-readline],
1125                 [disable readline support]),
1126         [], [enable_readline="yes"])
1127 AC_MSG_RESULT([$enable_readline])
1128
1129 LIBREADLINE=""
1130 AS_IF([test "x$enable_readline" = xyes], [
1131         AC_CHECK_LIB([readline], [readline], [
1132                 LIBREADLINE="-lreadline"
1133                 AC_DEFINE(HAVE_LIBREADLINE, 1,
1134                         [readline library is available])
1135         ])
1136 ])
1137 AC_SUBST(LIBREADLINE)
1138
1139 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
1140 AC_ARG_ENABLE([libpthread],
1141         AC_HELP_STRING([--disable-libpthread],
1142                 [disable libpthread]),
1143         [], [enable_libpthread="yes"])
1144 AC_MSG_RESULT([$enable_libpthread])
1145
1146 PTHREAD_LIBS=""
1147 AS_IF([test "x$enable_libpthread" = xyes], [
1148         AC_CHECK_LIB([pthread], [pthread_create], [
1149                 PTHREAD_LIBS="-lpthread"
1150                 AC_DEFINE([HAVE_LIBPTHREAD], 1,
1151                         [use libpthread for libcfs library])
1152         ])
1153 ], [
1154         AC_MSG_WARN([Using libpthread for libcfs library is disabled explicitly])
1155 ])
1156 AC_SUBST(PTHREAD_LIBS)
1157 ]) # LIBCFS_CONFIGURE
1158
1159 #
1160 # LIBCFS_CONDITIONALS
1161 #
1162 AC_DEFUN([LIBCFS_CONDITIONALS], [
1163 AM_CONDITIONAL(HAVE_CRC32, [test "x$have_crc32" = xyes])
1164 AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32,  [test "x$have_crc32" = xyes -a "x$enable_crc32_crypto" = xyes])
1165 AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32C, [test "x$enable_crc32c_crypto" = xyes])
1166 ]) # LIBCFS_CONDITIONALS
1167
1168 #
1169 # LIBCFS_CONFIG_FILES
1170 #
1171 # files that should be generated with AC_OUTPUT
1172 #
1173 AC_DEFUN([LIBCFS_CONFIG_FILES], [
1174 AC_CONFIG_FILES([
1175 libcfs/Makefile
1176 libcfs/autoMakefile
1177 libcfs/autoconf/Makefile
1178 libcfs/include/Makefile
1179 libcfs/include/libcfs/Makefile
1180 libcfs/include/libcfs/linux/Makefile
1181 libcfs/include/libcfs/util/Makefile
1182 libcfs/libcfs/Makefile
1183 libcfs/libcfs/autoMakefile
1184 libcfs/libcfs/linux/Makefile
1185 libcfs/libcfs/util/Makefile
1186 ])
1187 ]) # LIBCFS_CONFIG_FILES