4 # whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
6 AC_DEFUN([LN_CONFIG_CDEBUG],
8 AC_MSG_CHECKING([whether to enable CDEBUG, CWARN])
9 AC_ARG_ENABLE([libcfs_cdebug],
10 AC_HELP_STRING([--disable-libcfs-cdebug],
11 [disable libcfs CDEBUG, CWARN]),
12 [],[enable_libcfs_cdebug='yes'])
13 AC_MSG_RESULT([$enable_libcfs_cdebug])
14 if test x$enable_libcfs_cdebug = xyes; then
15 AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])
17 AC_DEFINE(CDEBUG_ENABLED, 0, [disable libcfs CDEBUG, CWARN])
20 AC_MSG_CHECKING([whether to enable ENTRY/EXIT])
21 AC_ARG_ENABLE([libcfs_trace],
22 AC_HELP_STRING([--disable-libcfs-trace],
23 [disable libcfs ENTRY/EXIT]),
24 [],[enable_libcfs_trace='yes'])
25 AC_MSG_RESULT([$enable_libcfs_trace])
26 if test x$enable_libcfs_trace = xyes; then
27 AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])
29 AC_DEFINE(CDEBUG_ENTRY_EXIT, 0, [disable libcfs ENTRY/EXIT])
32 AC_MSG_CHECKING([whether to enable LASSERT, LASSERTF])
33 AC_ARG_ENABLE([libcfs_assert],
34 AC_HELP_STRING([--disable-libcfs-assert],
35 [disable libcfs LASSERT, LASSERTF]),
36 [],[enable_libcfs_assert='yes'])
37 AC_MSG_RESULT([$enable_libcfs_assert])
38 if test x$enable_libcfs_assert = xyes; then
39 AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])
44 # LIBCFS_CONFIG_PANIC_DUMPLOG
46 # check if tunable panic_dumplog is wanted
48 AC_DEFUN([LIBCFS_CONFIG_PANIC_DUMPLOG],
49 [AC_MSG_CHECKING([for tunable panic_dumplog support])
50 AC_ARG_ENABLE([panic_dumplog],
51 AC_HELP_STRING([--enable-panic_dumplog],
52 [enable panic_dumplog]),
53 [],[enable_panic_dumplog='no'])
54 if test x$enable_panic_dumplog = xyes ; then
55 AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])
56 AC_MSG_RESULT([yes (by request)])
62 # check kernel __u64 type
63 AC_DEFUN([LIBCFS_U64_LONG_LONG_LINUX],
65 AC_MSG_CHECKING([kernel __u64 is long long type])
66 tmp_flags="$EXTRA_KCFLAGS"
67 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
68 LB_LINUX_TRY_COMPILE([
69 #include <linux/types.h>
70 #include <linux/stddef.h>
72 unsigned long long *data;
74 data = (__u64*)sizeof(data);
77 AC_DEFINE(HAVE_KERN__U64_LONG_LONG, 1,
78 [kernel __u64 is long long type])
82 EXTRA_KCFLAGS="$tmp_flags"
85 # LIBCFS_TASKLIST_LOCK
86 # 2.6.18 remove tasklist_lock export
87 AC_DEFUN([LIBCFS_TASKLIST_LOCK],
88 [LB_CHECK_SYMBOL_EXPORT([tasklist_lock],
90 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
91 [tasklist_lock exported])
96 # LIBCFS_DIGEST_SETKEY_FLAGS
97 # digest_alg.dia_setkey takes 4 args (2.6.18)
99 AC_DEFUN([LIBCFS_DIGEST_SETKEY_FLAGS],
100 [AC_MSG_CHECKING([if kernel dia_setkey takes 4 args])
101 LB_LINUX_TRY_COMPILE([
102 #include <linux/err.h>
103 #include <linux/crypto.h>
105 struct digest_alg alg;
107 alg.dia_setkey(NULL, NULL, 0, NULL);
110 AC_DEFINE(HAVE_DIGEST_SETKEY_FLAGS, 1, [kernel dia_setkey takes 4 args])
117 # kmem_cache_destroy(cachep) return void instead of
119 AC_DEFUN([LIBCFS_KMEM_CACHE_DESTROY_INT],
120 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
121 LB_LINUX_TRY_COMPILE([
122 #include <linux/slab.h>
124 int i __attribute__ ((unused));
125 i = kmem_cache_destroy(NULL);
128 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
129 [kmem_cache_destroy(cachep) return int])
135 # check cpumask_size (2.6.28)
136 AC_DEFUN([LIBCFS_CPUMASK_SIZE],
137 [AC_MSG_CHECKING([whether have cpumask_size()])
138 LB_LINUX_TRY_COMPILE([
139 #include <linux/cpumask.h>
141 int size = cpumask_size();
144 AC_DEFINE(HAVE_CPUMASK_SIZE, 1, [have cpumask_size()])
150 # check cpu topology functions
152 # topology_core_cpumask (2.6.29, not on all archs)
153 # topology_core_siblings (not on all archs)
154 # topology_thread_cpumask (2.6.29, not on all archs)
155 # topology_thread_siblings (not on all archs)
156 # cpumask_of_node/node_to_cpumask (not always exported)
157 AC_DEFUN([LIBCFS_CPU_TOPOLOGY],
158 [AC_MSG_CHECKING([whether have topology.h])
159 LB_LINUX_TRY_COMPILE([
160 #include <linux/topology.h>
162 AC_DEFINE(HAVE_CPU_TOPOLOGY, 1, [have CPU topology])
165 AC_MSG_CHECKING([whether have topology_core_cpumask])
166 LB_LINUX_TRY_COMPILE([
167 #include <linux/topology.h>
169 cpumask_t *mask = topology_core_cpumask(0);
171 AC_DEFINE(HAVE_TOPOLOGY_CORE_CPUMASK, 1,
172 [have topology_core_cpumask])
178 AC_MSG_CHECKING([whether have topology_core_siblings])
179 LB_LINUX_TRY_COMPILE([
180 #include <linux/topology.h>
182 cpumask_t mask = topology_core_siblings(0);
184 AC_DEFINE(HAVE_TOPOLOGY_CORE_SIBLINGS, 1,
185 [have topology_core_siblings])
191 AC_MSG_CHECKING([whether have topology_thread_cpumask])
192 LB_LINUX_TRY_COMPILE([
193 #include <linux/topology.h>
195 cpumask_t *mask = topology_thread_cpumask(0);
197 AC_DEFINE(HAVE_TOPOLOGY_THREAD_CPUMASK, 1,
198 [have topology_thread_cpumask])
204 AC_MSG_CHECKING([whether have topology_thread_siblings])
205 LB_LINUX_TRY_COMPILE([
206 #include <linux/topology.h>
208 cpumask_t mask = topology_thread_siblings(0);
210 AC_DEFINE(HAVE_TOPOLOGY_THREAD_SIBLINGS, 1,
211 [have topology_thread_siblings])
217 AC_MSG_CHECKING([whether OFED backports have cpumask_of_node])
218 # Some OFED has cpumask_of_node backports defined in
219 # its private include/linux/cpumask.h. However, it is
220 # defined conflictingly with kernel's cpumask_of_node.
221 if test -f $OFED_BACKPORT_PATH/linux/cpumask.h; then
222 grep -q cpumask_of_node $OFED_BACKPORT_PATH/linux/cpumask.h 2>/dev/null
224 if test $rc -eq 0; then
225 AC_DEFINE(HAVE_OFED_CPUMASK_OF_NODE, 1, [have cpumask_of_node])
232 AC_MSG_CHECKING([whether have cpumask_of_node])
233 LB_LINUX_TRY_COMPILE([
234 #include <linux/topology.h>
236 cpumask_t *mask = cpumask_of_node(0);
238 AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1, [have cpumask_of_node])
244 AC_MSG_CHECKING([whether have cpumask_copy])
245 LB_LINUX_TRY_COMPILE([
246 #include <linux/cpumask.h>
248 cpumask_copy(NULL, NULL);
250 AC_DEFINE(HAVE_CPUMASK_COPY, 1, [have cpumask_copy])
256 AC_MSG_CHECKING([whether have node_to_cpumask])
257 LB_LINUX_TRY_COMPILE([
258 #include <linux/topology.h>
260 cpumask_t mask = node_to_cpumask(0);
262 AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, [have node_to_cpumask])
273 # 2.6.20 API change INIT_WORK use 2 args and not
275 AC_DEFUN([LIBCFS_3ARGS_INIT_WORK],
276 [AC_MSG_CHECKING([check INIT_WORK want 3 args])
277 LB_LINUX_TRY_COMPILE([
278 #include <linux/workqueue.h>
280 struct work_struct work __attribute__ ((unused));
282 INIT_WORK(&work, NULL, NULL);
285 AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
286 [INIT_WORK use 3 args and store data inside])
292 # 2.6.21 api change. 'register_sysctl_table' use only one argument,
293 # instead of more old which need two.
294 AC_DEFUN([LIBCFS_2ARGS_REGISTER_SYSCTL],
295 [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
296 LB_LINUX_TRY_COMPILE([
297 #include <linux/sysctl.h>
299 register_sysctl_table(NULL,0);
302 AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
303 [register_sysctl_table want 2 args])
309 # 2.6.23 lost dtor argument
310 AC_DEFUN([LIBCFS_KMEM_CACHE_CREATE_DTOR],
311 [AC_MSG_CHECKING([check kmem_cache_create has dtor argument])
312 LB_LINUX_TRY_COMPILE([
313 #include <linux/slab.h>
315 kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
318 AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1,
319 [kmem_cache_create has dtor argument])
325 #2.6.23 has new shrinker API
326 AC_DEFUN([LC_REGISTER_SHRINKER],
327 [AC_MSG_CHECKING([if kernel has register_shrinker])
328 LB_LINUX_TRY_COMPILE([
329 #include <linux/mm.h>
331 register_shrinker(NULL);
334 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
335 [kernel has register_shrinker])
341 # 2.6.24 request not use real numbers for ctl_name
342 AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED],
343 [AC_MSG_CHECKING([for CTL_UNNUMBERED])
344 LB_LINUX_TRY_COMPILE([
345 #include <linux/sysctl.h>
347 #ifndef CTL_UNNUMBERED
348 #error CTL_UNNUMBERED not exist in kernel
352 AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
353 [sysctl has CTL_UNNUMBERED])
359 # 2.6.24 lost scatterlist->page
360 AC_DEFUN([LIBCFS_SCATTERLIST_SETPAGE],
361 [AC_MSG_CHECKING([for exist sg_set_page])
362 LB_LINUX_TRY_COMPILE([
363 #include <asm/types.h>
364 #include <linux/scatterlist.h>
366 sg_set_page(NULL,NULL,0,0);
369 AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1,
370 [struct scatterlist has no page member])
376 # 2.6.24-rc1 sg_init_table
377 AC_DEFUN([LIBCFS_SCATTERLIST_INITTABLE],
378 [AC_MSG_CHECKING([for sg_init_table])
379 LB_LINUX_TRY_COMPILE([
380 #include <asm/types.h>
381 #include <linux/scatterlist.h>
383 sg_init_table(NULL,0);
386 AC_DEFINE(HAVE_SCATTERLIST_INITTABLE, 1,
387 [scatterlist has sg_init_table])
394 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
395 [AC_MSG_CHECKING([for network stack has namespaces])
396 LB_LINUX_TRY_COMPILE([
397 #include <net/net_namespace.h>
399 struct net *net __attribute__ ((unused));
403 AC_DEFINE(HAVE_INIT_NET, 1,
404 [kernel is support network namespaces ])
411 # LIBCFS_FUNC_DUMP_TRACE
413 # 2.6.23 exports dump_trace() so we can dump_stack() on any task
414 # 2.6.24 has stacktrace_ops.address with "reliable" parameter
416 AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
417 [LB_CHECK_SYMBOL_EXPORT([dump_trace],
418 [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c arch/x86/kernel/dumpstack_32.c arch/x86/kernel/dumpstack_64.c],[
419 tmp_flags="$EXTRA_KCFLAGS"
420 EXTRA_KCFLAGS="-Werror"
421 AC_MSG_CHECKING([whether we can really use dump_trace])
422 LB_LINUX_TRY_COMPILE([
425 #include <asm/stacktrace.h>
429 AC_DEFINE(HAVE_DUMP_TRACE, 1, [dump_trace is exported])
434 AC_MSG_CHECKING([whether print_trace_address has reliable argument])
435 LB_LINUX_TRY_COMPILE([
438 #include <asm/stacktrace.h>
440 ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
443 AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
444 [print_trace_address has reliable argument])
449 AC_MSG_CHECKING([whether stacktrace_ops.warning is exist])
450 LB_LINUX_TRY_COMPILE([
453 #include <asm/stacktrace.h>
455 ((struct stacktrace_ops *)0)->warning(NULL, NULL);
458 AC_DEFINE(HAVE_STACKTRACE_WARNING, 1, [stacktrace_ops.warning is exist])
463 AC_MSG_CHECKING([dump_trace want address])
464 LB_LINUX_TRY_COMPILE([
467 #include <asm/stacktrace.h>
469 dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
472 AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
473 [dump_trace want address argument])
479 EXTRA_KCFLAGS="$tmp_flags"
484 # 2.6.26 use int instead of atomic for sem.count
485 AC_DEFUN([LIBCFS_SEM_COUNT],
486 [AC_MSG_CHECKING([atomic sem.count])
487 LB_LINUX_TRY_COMPILE([
488 #include <asm/semaphore.h>
490 struct semaphore s __attribute__ ((unused));
492 atomic_read(&s.count);
495 AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
496 [semaphore counter is atomic])
502 # 2.6.27 have second argument to sock_map_fd
503 AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
504 [AC_MSG_CHECKING([sock_map_fd have second argument])
505 LB_LINUX_TRY_COMPILE([
506 #include <linux/net.h>
508 sock_map_fd(NULL, 0);
511 AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
512 [sock_map_fd have second argument])
518 # LIBCFS_CRED_WRAPPERS
520 # wrappers for task's credentials are in sles11
522 AC_DEFUN([LIBCFS_CRED_WRAPPERS],
523 [AC_MSG_CHECKING([if kernel has wrappers for task's credentials])
524 LB_LINUX_TRY_COMPILE([
525 #include <linux/sched.h>
529 uid = current_uid() + sizeof(uid);
532 AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
539 # LN_STRUCT_CRED_IN_TASK
541 # struct cred was introduced in 2.6.29 to streamline credentials in task struct
543 AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK],
544 [AC_MSG_CHECKING([if kernel has struct cred])
545 LB_LINUX_TRY_COMPILE([
546 #include <linux/sched.h>
548 struct task_struct *tsk = NULL;
549 tsk->real_cred = NULL;
552 AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found])
558 # LIBCFS_STRUCT_SHASH_ALG
559 # struct shash_alg was introduced in 2.6.29
561 AC_DEFUN([LIBCFS_STRUCT_SHASH_ALG],
562 [AC_MSG_CHECKING([if kernel has struct shash_alg])
563 LB_LINUX_TRY_COMPILE([
564 #include <linux/err.h>
565 #include <crypto/internal/hash.h>
567 struct shash_alg foo;
570 AC_DEFINE(HAVE_STRUCT_SHASH_ALG, 1, [kernel has struct shash_alg])
578 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
580 # unshare_fs_struct was introduced in 2.6.30 to prevent others to directly
581 # mess with copy_fs_struct
583 AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT],
584 [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()])
585 tmp_flags="$EXTRA_KCFLAGS"
586 EXTRA_KCFLAGS="-Werror"
587 LB_LINUX_TRY_COMPILE([
588 #include <linux/sched.h>
589 #include <linux/fs_struct.h>
594 AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found])
598 EXTRA_KCFLAGS="$tmp_flags"
602 # LIBCFS_HAVE_IS_COMPAT_TASK
604 # Added in 2.6.17, it wasn't until 2.6.29 that all
605 # Linux architectures have is_compat_task()
607 AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
608 [AC_MSG_CHECKING([if is_compat_task() is declared])
609 LB_LINUX_TRY_COMPILE([
610 #include <linux/compat.h>
612 int i __attribute__ ((unused));
613 i = is_compat_task();
616 AC_DEFINE(HAVE_IS_COMPAT_TASK, 1, [is_compat_task() is available])
623 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
625 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
627 AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK],
628 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
629 LB_LINUX_TRY_COMPILE([
630 #include <asm/stacktrace.h>
632 ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
635 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
641 AC_DEFUN([LIBCFS_HAVE_OOM_H],
642 [LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
643 AC_DEFINE(HAVE_LINUX_OOM_H, 1,
644 [kernel has include/oom.h])
650 AC_DEFUN([LIBCFS_HAVE_KEYTYPE_H],
651 [LB_CHECK_FILE([$LINUX/include/linux/key-type.h], [
652 AC_DEFINE(HAVE_LINUX_KEYTYPE_H, 1,
653 [kernel has include/key-type.h])
660 # check set_mems_allowed
661 # 2.6.31 adds function set_mems_allowed in cpuset.h
663 AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED],
664 [AC_MSG_CHECKING([whether have set_mems_allowed()])
665 LB_LINUX_TRY_COMPILE([
666 #include <linux/cpuset.h>
670 set_mems_allowed(mask);
673 AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()])
681 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
683 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
684 [AC_MSG_CHECKING([shrinker want self pointer in handler])
685 LB_LINUX_TRY_COMPILE([
686 #include <linux/mm.h>
688 struct shrinker *tmp = NULL;
689 tmp->shrink(tmp, 0, 0);
692 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
693 [shrinker want self pointer in handler])
699 # 2.6.18 store oom parameters in task struct.
700 # 2.6.32 store oom parameters in signal struct
701 AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
702 [AC_MSG_CHECKING([kernel store oom parameters in task])
703 LB_LINUX_TRY_COMPILE([
704 #include <linux/sched.h>
706 ((struct signal_struct *)0)->oom_adj = 0;
709 AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
710 [kernel store a oom parameters in signal struct])
717 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
719 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME],
720 [AC_MSG_CHECKING([if ctl_table has a ctl_name field])
721 LB_LINUX_TRY_COMPILE([
722 #include <linux/sysctl.h>
725 ct.ctl_name = sizeof(ct);
728 AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
729 [ctl_table has ctl_name field])
736 # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
738 # 2.6.34 adds __add_wait_queue_exclusive
740 AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE],
741 [AC_MSG_CHECKING([if __add_wait_queue_exclusive exists])
742 LB_LINUX_TRY_COMPILE([
743 #include <linux/wait.h>
745 wait_queue_head_t queue;
748 __add_wait_queue_exclusive(&queue, &wait);
751 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
752 [__add_wait_queue_exclusive exists])
759 # 2.6.35 kernel has sk_sleep function
761 AC_DEFUN([LC_SK_SLEEP],
762 [AC_MSG_CHECKING([if kernel has sk_sleep])
763 LB_LINUX_TRY_COMPILE([
764 #include <net/sock.h>
769 AC_DEFINE(HAVE_SK_SLEEP, 1, [kernel has sk_sleep])
776 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
777 # pressure shrinker from Linux 3.0
779 AC_DEFUN([LC_SHRINK_CONTROL],
780 [AC_MSG_CHECKING([shrink_control is present])
781 LB_LINUX_TRY_COMPILE([
782 #include <linux/mm.h>
784 struct shrink_control tmp = {0};
785 tmp.nr_to_scan = sizeof(tmp);
788 AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
789 [shrink_control is present])
798 # LNet linux kernel checks
800 AC_DEFUN([LIBCFS_PROG_LINUX],
802 LIBCFS_CONFIG_PANIC_DUMPLOG
804 LIBCFS_U64_LONG_LONG_LINUX
807 LIBCFS_HAVE_IS_COMPAT_TASK
808 LIBCFS_DIGEST_SETKEY_FLAGS
810 LIBCFS_KMEM_CACHE_DESTROY_INT
812 LIBCFS_3ARGS_INIT_WORK
814 LIBCFS_2ARGS_REGISTER_SYSCTL
816 LIBCFS_KMEM_CACHE_CREATE_DTOR
819 LIBCFS_SYSCTL_UNNUMBERED
820 LIBCFS_SCATTERLIST_SETPAGE
821 LIBCFS_SCATTERLIST_INITTABLE
822 LIBCFS_NETWORK_NAMESPACE
823 LIBCFS_FUNC_DUMP_TRACE
824 LIBCFS_HAVE_KEYTYPE_H
832 LIBCFS_STRUCT_CRED_IN_TASK
834 LIBCFS_STRUCT_SHASH_ALG
836 LIBCFS_FUNC_UNSHARE_FS_STRUCT
837 LIBCFS_SOCK_MAP_FD_2ARG
839 LIBCFS_HAVE_SET_MEMS_ALLOWED
841 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
842 LC_SHRINKER_WANT_SHRINK_PTR
846 LIBCFS_SYSCTL_CTLNAME
848 LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
860 AC_DEFUN([LIBCFS_PROG_DARWIN],
861 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
865 # LIBCFS_PATH_DEFAULTS
867 # default paths for installed files
869 AC_DEFUN([LIBCFS_PATH_DEFAULTS],
876 # other configure checks
878 AC_DEFUN([LIBCFS_CONFIGURE],
879 [# lnet/utils/portals.c
880 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
883 AC_CHECK_HEADERS([linux/version.h])
885 AC_CHECK_TYPE([spinlock_t],
886 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
888 [#include <linux/spinlock.h>])
890 # lnet/utils/wirecheck.c
891 AC_CHECK_FUNCS([strnlen])
893 # lnet/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
894 AC_CHECK_FUNCS([strlcpy])
896 # libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
897 AC_CHECK_FUNCS([strlcat])
899 AC_CHECK_TYPE([umode_t],
900 [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
902 [#include <asm/types.h>])
904 AC_CHECK_TYPE([__s8],
905 [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
907 [#include <asm/types.h>])
909 AC_CHECK_TYPE([__u8],
910 [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
912 [#include <asm/types.h>])
914 AC_CHECK_TYPE([__s16],
915 [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
917 [#include <asm/types.h>])
919 AC_CHECK_TYPE([__u16],
920 [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
922 [#include <asm/types.h>])
924 AC_CHECK_TYPE([__s32],
925 [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
927 [#include <asm/types.h>])
929 AC_CHECK_TYPE([__u32],
930 [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
932 [#include <asm/types.h>])
934 AC_CHECK_TYPE([__u64],
935 [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
937 [#include <asm/types.h>])
939 AC_CHECK_TYPE([__s64],
940 [AC_DEFINE(HAVE___S64, 1, [__s64 is defined])],
942 [#include <asm/types.h>])
944 # check userland __u64 type
945 AC_MSG_CHECKING([userspace __u64 is long long type])
947 CFLAGS="$CFLAGS -Werror"
950 #include <linux/types.h>
951 #include <linux/stddef.h>
953 unsigned long long *data1;
962 AC_DEFINE(HAVE_USER__U64_LONG_LONG, 1,
963 [__u64 is long long type])
969 # -------- Check for required packages --------------
972 AC_MSG_CHECKING([if efence debugging support is requested])
973 AC_ARG_ENABLE(efence,
974 AC_HELP_STRING([--enable-efence],
975 [use efence library]),
976 [],[enable_efence='no'])
977 AC_MSG_RESULT([$enable_efence])
978 if test "$enable_efence" = "yes" ; then
980 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
987 # -------- check for -lpthread support ----
988 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
989 AC_ARG_ENABLE([libpthread],
990 AC_HELP_STRING([--disable-libpthread],
991 [disable libpthread]),
992 [],[enable_libpthread=yes])
993 if test "$enable_libpthread" = "yes" ; then
994 AC_CHECK_LIB([pthread], [pthread_create],
995 [ENABLE_LIBPTHREAD="yes"],
996 [ENABLE_LIBPTHREAD="no"])
997 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
998 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
999 PTHREAD_LIBS="-lpthread"
1000 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
1003 AC_MSG_RESULT([no libpthread is found])
1005 AC_SUBST(PTHREAD_LIBS)
1007 AC_MSG_RESULT([no (disabled explicitly)])
1008 ENABLE_LIBPTHREAD="no"
1010 AC_SUBST(ENABLE_LIBPTHREAD)
1016 # LIBCFS_CONDITIONALS
1018 # AM_CONDITOINAL defines for lnet
1020 AC_DEFUN([LIBCFS_CONDITIONALS],
1025 # LIBCFS_CONFIG_FILES
1027 # files that should be generated with AC_OUTPUT
1029 AC_DEFUN([LIBCFS_CONFIG_FILES],
1034 libcfs/autoconf/Makefile
1035 libcfs/include/Makefile
1036 libcfs/include/libcfs/Makefile
1037 libcfs/include/libcfs/linux/Makefile
1038 libcfs/include/libcfs/posix/Makefile
1039 libcfs/include/libcfs/util/Makefile
1040 libcfs/libcfs/Makefile
1041 libcfs/libcfs/autoMakefile
1042 libcfs/libcfs/linux/Makefile
1043 libcfs/libcfs/posix/Makefile
1044 libcfs/libcfs/util/Makefile
1045 libcfs/include/libcfs/darwin/Makefile
1046 libcfs/libcfs/darwin/Makefile