4 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
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])])
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])])
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
36 # LIBCFS_CONFIG_PANIC_DUMPLOG
38 # check if tunable panic_dumplog is wanted
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
52 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
54 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
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>
61 ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
63 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1,
64 ['struct stacktrace_ops' has 'walk_stack' field])
66 ]) # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
69 # LIBCFS_STACKTRACE_WARNING
71 # 3.0 removes stacktrace_ops warning* functions
73 AC_DEFUN([LIBCFS_STACKTRACE_WARNING], [
74 LB_CHECK_COMPILE([if 'stacktrace_ops.warning' is exist],
75 stacktrace_ops_warning, [
78 #include <asm/stacktrace.h>
80 ((struct stacktrace_ops *)0)->warning(NULL, NULL);
82 AC_DEFINE(HAVE_STACKTRACE_WARNING, 1,
83 [stacktrace_ops.warning is exist])
85 ]) # LIBCFS_STACKTRACE_WARNING
88 # LIBCFS_REINIT_COMPLETION
90 AC_DEFUN([LIBCFS_REINIT_COMPLETION], [
91 LB_CHECK_COMPILE([if 'reinit_completion' exists],
93 #include <linux/completion.h>
96 reinit_completion(&x);
98 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
99 [reinit_completion is exist])
101 ]) # LIBCFS_REINIT_COMPLETION
104 # LC_SHRINKER_WANT_SHRINK_PTR
106 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
108 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR], [
109 LB_CHECK_COMPILE([if 'shrinker' want self pointer in handler],
110 shrink_self_pointer, [
111 #include <linux/mm.h>
113 struct shrinker *tmp = NULL;
114 tmp->shrink(tmp, 0, 0);
116 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
117 [shrinker want self pointer in handler])
119 ]) # LC_SHRINKER_WANT_SHRINK_PTR
122 # LIBCFS_SYSCTL_CTLNAME
124 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
126 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME], [
127 LB_CHECK_COMPILE([if 'ctl_table' has a 'ctl_name' field],
128 ctl_table_ctl_name, [
129 #include <linux/sysctl.h>
132 ct.ctl_name = sizeof(ct);
134 AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
135 [ctl_table has ctl_name field])
137 ]) # LIBCFS_SYSCTL_CTLNAME
142 # 2.6.38 kstrtoul is added
144 AC_DEFUN([LIBCFS_KSTRTOUL], [
145 LB_CHECK_COMPILE([if Linux kernel has 'kstrtoul'],
147 #include <linux/kernel.h>
149 unsigned long result;
150 return kstrtoul("12345", 0, &result);
152 AC_DEFINE(HAVE_KSTRTOUL, 1,
153 [kernel has kstrtoul])
158 # LIBCFS_DUMP_TRACE_ADDRESS
160 # 2.6.39 adds a base pointer address argument to dump_trace
162 AC_DEFUN([LIBCFS_DUMP_TRACE_ADDRESS], [
163 LB_CHECK_COMPILE([if 'dump_trace' want address],
164 dump_trace_address, [
167 #include <asm/stacktrace.h>
169 dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
171 AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
172 [dump_trace want address argument])
174 ]) # LIBCFS_DUMP_TRACE_ADDRESS
179 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
180 # pressure shrinker from Linux 3.0
182 AC_DEFUN([LC_SHRINK_CONTROL], [
183 LB_CHECK_COMPILE([if 'shrink_control' is present],
185 #include <linux/atomic.h>
186 #include <linux/mm.h>
188 struct shrink_control tmp = {0};
189 tmp.nr_to_scan = sizeof(tmp);
191 AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
192 [shrink_control is present])
194 ]) # LC_SHRINK_CONTROL
197 # LIBCFS_PROCESS_NAMESPACE
199 # 3.5 introduced process namespace
200 AC_DEFUN([LIBCFS_PROCESS_NAMESPACE], [
201 LB_CHECK_LINUX_HEADER([linux/uidgid.h], [
202 AC_DEFINE(HAVE_UIDGID_HEADER, 1,
203 [uidgid.h is present])])
204 ]) # LIBCFS_PROCESS_NAMESPACE
209 # 3.5 added helpers to read the new uid/gid types from VFS structures
210 # SLE11 SP3 has uidgid.h but not the helpers
212 AC_DEFUN([LIBCFS_I_UID_READ], [
213 LB_CHECK_COMPILE([if 'i_uid_read' is present],
215 #include <linux/fs.h>
219 AC_DEFINE(HAVE_I_UID_READ, 1, [i_uid_read is present])
221 ]) # LIBCFS_I_UID_READ
224 # LIBCFS_SOCK_ALLOC_FILE
226 # FC18 3.7.2-201 unexport sock_map_fd() change to
227 # use sock_alloc_file().
228 # upstream commit 56b31d1c9f1e6a3ad92e7bfe252721e05d92b285
230 AC_DEFUN([LIBCFS_SOCK_ALLOC_FILE], [
231 LB_CHECK_EXPORT([sock_alloc_file], [net/socket.c], [
232 LB_CHECK_COMPILE([if 'sock_alloc_file' takes 3 arguments],
233 sock_alloc_file_3args, [
234 #include <linux/net.h>
236 sock_alloc_file(NULL, 0, NULL);
238 AC_DEFINE(HAVE_SOCK_ALLOC_FILE_3ARGS, 1,
239 [sock_alloc_file takes 3 arguments])
241 AC_DEFINE(HAVE_SOCK_ALLOC_FILE, 1,
242 [sock_alloc_file is exported])
245 ]) # LIBCFS_SOCK_ALLOC_FILE
250 AC_DEFUN([LIBCFS_HAVE_CRC32], [
251 LB_CHECK_CONFIG_IM([CRC32],
252 [have_crc32="yes"], [have_crc32="no"])
253 AS_IF([test "x$have_crc32" = xyes],
254 [AC_DEFINE(HAVE_CRC32, 1,
255 [kernel compiled with CRC32 functions])])
256 ]) # LIBCFS_HAVE_CRC32
259 # LIBCFS_ENABLE_CRC32_ACCEL
261 AC_DEFUN([LIBCFS_ENABLE_CRC32_ACCEL], [
262 LB_CHECK_CONFIG_IM([CRYPTO_CRC32_PCLMUL],
263 [enable_crc32_crypto="no"], [enable_crc32_crypto="yes"])
264 AS_IF([test "x$have_crc32" = xyes -a "x$enable_crc32_crypto" = xyes], [
265 AC_DEFINE(NEED_CRC32_ACCEL, 1, [need pclmulqdq based crc32])
266 AC_MSG_WARN([No crc32 pclmulqdq crypto api found, enable internal pclmulqdq based crc32])])
267 ]) # LIBCFS_ENABLE_CRC32_ACCEL
270 # LIBCFS_ENABLE_CRC32C_ACCEL
272 AC_DEFUN([LIBCFS_ENABLE_CRC32C_ACCEL], [
273 LB_CHECK_CONFIG_IM([CRYPTO_CRC32C_INTEL],
274 [enable_crc32c_crypto="no"], [enable_crc32c_crypto="yes"])
275 AS_IF([test "x$enable_crc32c_crypto" = xyes], [
276 AC_DEFINE(NEED_CRC32C_ACCEL, 1, [need pclmulqdq based crc32c])
277 AC_MSG_WARN([No crc32c pclmulqdq crypto api found, enable internal pclmulqdq based crc32c])])
278 ]) # LIBCFS_ENABLE_CRC32C_ACCEL
281 # Kernel version 3.11 introduced ktime_get_ts64
283 AC_DEFUN([LIBCFS_KTIME_GET_TS64],[
284 LB_CHECK_COMPILE([does function 'ktime_get_ts64' exist],
286 #include <linux/ktime.h>
288 struct timespec64 *ts = NULL;
292 AC_DEFINE(HAVE_KTIME_GET_TS64, 1,
293 ['ktime_get_ts64' is available])
295 ]) # LIBCFS_KTIME_GET_TS64
298 # Kernel version 3.12 introduced ktime_add
300 AC_DEFUN([LIBCFS_KTIME_ADD],[
301 LB_CHECK_COMPILE([does function 'ktime_add' exist],
303 #include <linux/ktime.h>
305 ktime_t start = ktime_set(0, 0);
309 total = ktime_add(start, end);
311 AC_DEFINE(HAVE_KTIME_ADD, 1,
312 [ktime_add is available])
314 ]) # LIBCFS_KTIME_ADD
317 # Kernel version 3.12 introduced ktime_after
319 AC_DEFUN([LIBCFS_KTIME_AFTER],[
320 LB_CHECK_COMPILE([does function 'ktime_after' exist],
322 #include <linux/ktime.h>
324 ktime_t start = ktime_set(0, 0);
327 ktime_after(start, end);
329 AC_DEFINE(HAVE_KTIME_AFTER, 1,
330 [ktime_after is available])
332 ]) # LIBCFS_KTIME_AFTER
335 # FC19 3.12 kernel struct shrinker change
337 AC_DEFUN([LIBCFS_SHRINKER_COUNT],[
338 LB_CHECK_COMPILE([shrinker has 'count_objects'],
339 shrinker_count_objects, [
340 #include <linux/mmzone.h>
341 #include <linux/shrinker.h>
343 ((struct shrinker*)0)->count_objects(NULL, NULL);
345 AC_DEFINE(HAVE_SHRINKER_COUNT, 1,
346 [shrinker has count_objects member])
348 ]) # LIBCFS_SHRINKER_COUNT
351 # Kernel version 3.17 changed hlist_add_after to
354 AC_DEFUN([LIBCFS_HLIST_ADD_AFTER],[
355 LB_CHECK_COMPILE([does function 'hlist_add_after' exist],
357 #include <linux/list.h>
359 hlist_add_after(NULL, NULL);
361 AC_DEFINE(HAVE_HLIST_ADD_AFTER, 1,
362 [hlist_add_after is available])
364 ]) # LIBCFS_HLIST_ADD_AFTER
367 # Kernel version 3.17 introduced struct timespec64
369 AC_DEFUN([LIBCFS_TIMESPEC64],[
370 LB_CHECK_COMPILE([does 'struct timespec64' exist],
372 #include <linux/time.h>
374 struct timespec64 ts;
379 AC_DEFINE(HAVE_TIMESPEC64, 1,
380 ['struct timespec64' is available])
382 ]) # LIBCFS_TIMESPEC64
385 # Kernel version 3.17 introduced ktime_get_real_ts64
387 AC_DEFUN([LIBCFS_KTIME_GET_REAL_TS64],[
388 LB_CHECK_COMPILE([does function 'ktime_get_real_ts64' exist],
389 ktime_get_real_ts64, [
390 #include <linux/ktime.h>
392 struct timespec64 *ts = NULL;
394 ktime_get_real_ts64(ts);
396 AC_DEFINE(HAVE_KTIME_GET_REAL_TS64, 1,
397 ['ktime_get_real_ts64' is available])
399 ]) # LIBCFS_KTIME_GET_REAL_TS64
402 # Kernel version 3.17 introduced ktime_get_real_seconds
404 AC_DEFUN([LIBCFS_KTIME_GET_REAL_SECONDS],[
405 LB_CHECK_COMPILE([does function 'ktime_get_real_seconds' exist],
406 ktime_get_real_seconds, [
407 #include <linux/ktime.h>
411 now = ktime_get_real_seconds();
413 AC_DEFINE(HAVE_KTIME_GET_REAL_SECONDS, 1,
414 ['ktime_get_real_seconds' is available])
416 ]) # LIBCFS_KTIME_GET_REAL_SECONDS
419 # Kernel version 3.17 created ktime_get_real_ns wrapper
421 AC_DEFUN([LIBCFS_KTIME_GET_REAL_NS],[
422 LB_CHECK_COMPILE([does function 'ktime_get_real_ns' exist],
424 #include <linux/ktime.h>
428 nanoseconds = ktime_get_real_ns();
430 AC_DEFINE(NEED_KTIME_GET_REAL_NS, 1,
431 ['ktime_get_real_ns' is not available])
433 ]) # LIBCFS_KTIME_GET_REAL_NS
436 # Kernel version 3.17 introduced ktime_to_timespec64
438 AC_DEFUN([LIBCFS_KTIME_TO_TIMESPEC64],[
439 LB_CHECK_COMPILE([does function 'ktime_to_timespec64' exist],
440 ktime_to_timespec64, [
441 #include <linux/ktime.h>
443 struct timespec64 ts;
446 ts = ktime_to_timespec64(now);
448 AC_DEFINE(HAVE_KTIME_TO_TIMESPEC64, 1,
449 ['ktime_to_timespec64' is available])
451 ]) # LIBCFS_KTIME_TO_TIMESPEC64
454 # Kernel version 3.17 introduced timespec64_sub
456 AC_DEFUN([LIBCFS_TIMESPEC64_SUB],[
457 LB_CHECK_COMPILE([does function 'timespec64_sub' exist],
459 #include <linux/time.h>
461 struct timespec64 later,earlier,diff;
463 diff = timespec64_sub(later, earlier);
465 AC_DEFINE(HAVE_TIMESPEC64_SUB, 1,
466 ['timespec64_sub' is available])
468 ]) # LIBCFS_TIMESPEC64_SUB
471 # Kernel version 3.17 introduced timespec64_to_ktime
473 AC_DEFUN([LIBCFS_TIMESPEC64_TO_KTIME],[
474 LB_CHECK_COMPILE([does function 'timespec64_to_ktime' exist],
475 timespec64_to_ktime, [
476 #include <linux/ktime.h>
478 struct timespec64 ts;
481 now = timespec64_to_ktime(ts);
483 AC_DEFINE(HAVE_TIMESPEC64_TO_KTIME, 1,
484 ['timespec64_to_ktime' is available])
486 ]) # LIBCFS_TIMESPEC64_TO_KTIME
489 # Kernel version 3.19 introduced ktime_get_seconds
491 AC_DEFUN([LIBCFS_KTIME_GET_SECONDS],[
492 LB_CHECK_COMPILE([does function 'ktime_get_seconds' exist],
494 #include <linux/ktime.h>
498 now = ktime_get_seconds();
500 AC_DEFINE(HAVE_KTIME_GET_SECONDS, 1,
501 ['ktime_get_seconds' is available])
503 ]) # LIBCFS_KTIME_GET_SECONDS
506 # Kernel version 3.19 commit 5aaba36318e5995e8c95d077a46d9a4d00fcc1cd
507 # This patch creates a new helper function cpumap_print_to_pagebuf in
508 # cpumask.h using newly added bitmap_print_to_pagebuf and consolidates
509 # most of those sysfs functions using the new helper function.
511 AC_DEFUN([LIBCFS_HAVE_CPUMASK_PRINT_TO_PAGEBUF],[
512 LB_CHECK_COMPILE([does function 'cpumap_print_to_pagebuf' exist],
513 cpumap_print_to_pagebuf, [
514 #include <linux/topology.h>
518 const struct cpumask *mask = NULL;
519 n = cpumap_print_to_pagebuf(true, buf, mask);
521 AC_DEFINE(HAVE_CPUMASK_PRINT_TO_PAGEBUF, 1,
522 [cpumap_print_to_pagebuf is available])
524 ]) # LIBCFS_HAVE_CPUMASK_PRINT_TO_PAGEBUF
527 # Kernel version 4.2 changed topology_thread_cpumask
528 # to topology_sibling_cpumask
530 AC_DEFUN([LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK],[
531 LB_CHECK_COMPILE([does function 'topology_sibling_cpumask' exist],
532 topology_sibling_cpumask, [
533 #include <linux/topology.h>
535 const struct cpumask *mask;
537 mask = topology_sibling_cpumask(0);
539 AC_DEFINE(HAVE_TOPOLOGY_SIBLING_CPUMASK, 1,
540 [topology_sibling_cpumask is available])
542 ]) # LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
545 # Kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
546 # header file i387.h was renamed to fpu/api.h
548 AC_DEFUN([LIBCFS_FPU_API], [
549 LB_CHECK_LINUX_HEADER([asm/fpu/api.h], [
550 AC_DEFINE(HAVE_FPU_API_HEADER, 1,
551 [fpu/api.h is present])])
555 # Kernel version 4.5-rc1 commit d12481bc58fba89427565f8592e88446ec084a24
556 # added crypto hash helpers
558 AC_DEFUN([LIBCFS_CRYPTO_HASH_HELPERS], [
559 LB_CHECK_COMPILE([does crypto hash helper functions exist],
560 crypto_hash_helpers, [
561 #include <crypto/hash.h>
563 crypto_ahash_alg_name(NULL);
564 crypto_ahash_driver_name(NULL);
566 AC_DEFINE(HAVE_CRYPTO_HASH_HELPERS, 1,
567 [crypto hash helper functions are available])
569 ]) # LIBCFS_CRYPTO_HASH_HELPERS
572 # LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
574 # linux 4.6 kernel changed stacktrace_ops address to return an int
576 AC_DEFUN([LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT], [
577 LB_CHECK_COMPILE([if 'struct stacktrace_ops' address function returns an int],
578 stacktrace_ops_address_return_int, [
579 #include <asm/stacktrace.h>
583 rc = ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
585 AC_DEFINE(STACKTRACE_OPS_ADDRESS_RETURN_INT, 1,
586 ['struct stacktrace_ops' address function returns an int])
588 ]) # LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
591 # Kernel version 4.6 removed both struct task_struct and struct mm_struct
592 # arguments to get_user_pages
594 AC_DEFUN([LIBCFS_GET_USER_PAGES_6ARG], [
595 LB_CHECK_COMPILE([if 'get_user_pages()' takes 6 arguments],
596 get_user_pages_6arg, [
597 #include <linux/mm.h>
601 rc = get_user_pages(0, 0, 0, 0, NULL, NULL);
603 AC_DEFINE(HAVE_GET_USER_PAGES_6ARG, 1,
604 [get_user_pages takes 6 arguments])
606 ]) # LIBCFS_GET_USER_PAGES_6ARG
609 # LIBCFS_STACKTRACE_OPS
611 # Kernel version 4.8 commit c8fe4609827aedc9c4b45de80e7cdc8ccfa8541b
612 # removed both struct stacktrace_ops and dump_trace() function
614 AC_DEFUN([LIBCFS_STACKTRACE_OPS], [
615 LB_CHECK_COMPILE([if 'struct stacktrace_ops' exists],
619 #include <asm/stacktrace.h>
621 struct stacktrace_ops ops;
624 AC_DEFINE(HAVE_STACKTRACE_OPS, 1,
625 [struct stacktrace_ops exists])
627 ]) # LIBCFS_STACKTRACE_OPS
630 # Kernel version 4.9 commit 768ae309a96103ed02eb1e111e838c87854d8b51
631 # mm: replace get_user_pages() write/force parameters with gup_flags
633 AC_DEFUN([LIBCFS_GET_USER_PAGES_GUP_FLAGS], [
634 LB_CHECK_COMPILE([if 'get_user_pages()' takes gup_flags in arguments],
635 get_user_pages_gup_flags, [
636 #include <linux/mm.h>
639 rc = get_user_pages(0, 0, FOLL_WRITE, NULL, NULL);
641 AC_DEFINE(HAVE_GET_USER_PAGES_GUP_FLAGS, 1,
642 [get_user_pages takes gup_flags in arguments])
644 ]) # LIBCFS_GET_USER_PAGES_GUP_FLAGS
647 # Kernel version 4.10 commit 7b737965b33188bd3dbb44e938535c4006d97fbb
648 # libcfs: Convert to hotplug state machine
650 AC_DEFUN([LIBCFS_HOTPLUG_STATE_MACHINE], [
651 LB_CHECK_COMPILE([if libcfs supports CPU hotplug state machine],
652 cpu_hotplug_state_machine, [
653 #include <linux/cpuhotplug.h>
655 cpuhp_remove_state(CPUHP_LUSTRE_CFS_DEAD);
657 AC_DEFINE(HAVE_HOTPLUG_STATE_MACHINE, 1,
658 [hotplug state machine is supported])
660 ]) # LIBCFS_HOTPLUG_STATE_MACHINE
665 # LibCFS linux kernel checks
667 AC_DEFUN([LIBCFS_PROG_LINUX], [
668 AC_MSG_NOTICE([LibCFS kernel checks
669 ==============================================================================])
670 LIBCFS_CONFIG_PANIC_DUMPLOG
673 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
674 LC_SHRINKER_WANT_SHRINK_PTR
676 LIBCFS_SYSCTL_CTLNAME
680 LIBCFS_DUMP_TRACE_ADDRESS
684 LIBCFS_STACKTRACE_WARNING
685 LIBCFS_REINIT_COMPLETION
687 LIBCFS_PROCESS_NAMESPACE
690 LIBCFS_SOCK_ALLOC_FILE
693 LIBCFS_ENABLE_CRC32_ACCEL
695 LIBCFS_ENABLE_CRC32C_ACCEL
697 LIBCFS_KTIME_GET_TS64
701 LIBCFS_SHRINKER_COUNT
703 LIBCFS_HLIST_ADD_AFTER
705 LIBCFS_KTIME_GET_REAL_TS64
706 LIBCFS_KTIME_GET_REAL_SECONDS
707 LIBCFS_KTIME_GET_REAL_NS
708 LIBCFS_KTIME_TO_TIMESPEC64
709 LIBCFS_TIMESPEC64_SUB
710 LIBCFS_TIMESPEC64_TO_KTIME
712 LIBCFS_KTIME_GET_SECONDS
713 LIBCFS_HAVE_CPUMASK_PRINT_TO_PAGEBUF
715 LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
718 LIBCFS_CRYPTO_HASH_HELPERS
720 LIBCFS_STACKTRACE_OPS_ADDRESS_RETURN_INT
721 LIBCFS_GET_USER_PAGES_6ARG
723 LIBCFS_STACKTRACE_OPS
725 LIBCFS_GET_USER_PAGES_GUP_FLAGS
727 LIBCFS_HOTPLUG_STATE_MACHINE
728 ]) # LIBCFS_PROG_LINUX
731 # LIBCFS_PATH_DEFAULTS
733 # default paths for installed files
735 AC_DEFUN([LIBCFS_PATH_DEFAULTS], [
736 ]) # LIBCFS_PATH_DEFAULTS
741 # other configure checks
743 AC_DEFUN([LIBCFS_CONFIGURE], [
744 AC_MSG_NOTICE([LibCFS core checks
745 ==============================================================================])
747 # lnet/utils/portals.c
748 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
751 AC_CHECK_HEADERS([linux/version.h])
753 AC_CHECK_TYPE([spinlock_t],
754 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
756 [#include <linux/spinlock.h>])
758 # lnet/utils/wirecheck.c
759 AC_CHECK_FUNCS([strnlen])
761 # lnet/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
762 AC_CHECK_FUNCS([strlcpy])
764 # libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
765 AC_CHECK_FUNCS([strlcat])
767 # libcfs/include/libcfs/linux/linux-prim.h, ...
768 AC_CHECK_HEADERS([linux/types.h sys/types.h linux/unistd.h unistd.h])
770 # libcfs/include/libcfs/linux/linux-prim.h
771 AC_CHECK_HEADERS([linux/random.h], [], [],
772 [#ifdef HAVE_LINUX_TYPES_H
773 #include <linux/types.h>
777 # libcfs/include/libcfs/linux/libcfs.h
778 # libcfs/include/libcfs/byteorder.h
779 # libcfs/libcfs/util/nidstrings.c
780 AC_CHECK_HEADERS([netdb.h asm/types.h endian.h])
781 AC_CHECK_FUNCS([gethostbyname])
783 # -------- Check for required packages --------------
785 AC_MSG_NOTICE([LibCFS required packages checks
786 ==============================================================================])
788 AC_MSG_CHECKING([whether to enable readline support])
789 AC_ARG_ENABLE(readline,
790 AC_HELP_STRING([--disable-readline],
791 [disable readline support]),
792 [], [enable_readline="yes"])
793 AC_MSG_RESULT([$enable_readline])
796 AS_IF([test "x$enable_readline" = xyes], [
797 AC_CHECK_LIB([readline], [readline], [
798 LIBREADLINE="-lreadline"
799 AC_DEFINE(HAVE_LIBREADLINE, 1,
800 [readline library is available])
803 AC_SUBST(LIBREADLINE)
805 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
806 AC_ARG_ENABLE([libpthread],
807 AC_HELP_STRING([--disable-libpthread],
808 [disable libpthread]),
809 [], [enable_libpthread="yes"])
810 AC_MSG_RESULT([$enable_libpthread])
813 AS_IF([test "x$enable_libpthread" = xyes], [
814 AC_CHECK_LIB([pthread], [pthread_create], [
815 PTHREAD_LIBS="-lpthread"
816 AC_DEFINE([HAVE_LIBPTHREAD], 1,
817 [use libpthread for libcfs library])
820 AC_MSG_WARN([Using libpthread for libcfs library is disabled explicitly])
822 AC_SUBST(PTHREAD_LIBS)
823 ]) # LIBCFS_CONFIGURE
826 # LIBCFS_CONDITIONALS
828 AC_DEFUN([LIBCFS_CONDITIONALS], [
829 AM_CONDITIONAL(HAVE_CRC32, [test "x$have_crc32" = xyes])
830 AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32, [test "x$have_crc32" = xyes -a "x$enable_crc32_crypto" = xyes])
831 AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32C, [test "x$enable_crc32c_crypto" = xyes])
832 ]) # LIBCFS_CONDITIONALS
835 # LIBCFS_CONFIG_FILES
837 # files that should be generated with AC_OUTPUT
839 AC_DEFUN([LIBCFS_CONFIG_FILES], [
843 libcfs/autoconf/Makefile
844 libcfs/include/Makefile
845 libcfs/include/libcfs/Makefile
846 libcfs/include/libcfs/linux/Makefile
847 libcfs/include/libcfs/util/Makefile
848 libcfs/libcfs/Makefile
849 libcfs/libcfs/autoMakefile
850 libcfs/libcfs/linux/Makefile
851 libcfs/libcfs/util/Makefile
853 ]) # LIBCFS_CONFIG_FILES