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 have cpumask_of_node])
218 LB_LINUX_TRY_COMPILE([
219 #include <linux/topology.h>
221 cpumask_t *mask = cpumask_of_node(0);
223 AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1, [have cpumask_of_node])
229 AC_MSG_CHECKING([whether have node_to_cpumask])
230 LB_LINUX_TRY_COMPILE([
231 #include <linux/topology.h>
233 cpumask_t mask = node_to_cpumask(0);
235 AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, [have node_to_cpumask])
246 # 2.6.20 API change INIT_WORK use 2 args and not
248 AC_DEFUN([LIBCFS_3ARGS_INIT_WORK],
249 [AC_MSG_CHECKING([check INIT_WORK want 3 args])
250 LB_LINUX_TRY_COMPILE([
251 #include <linux/workqueue.h>
253 struct work_struct work __attribute__ ((unused));
255 INIT_WORK(&work, NULL, NULL);
258 AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
259 [INIT_WORK use 3 args and store data inside])
265 # 2.6.21 api change. 'register_sysctl_table' use only one argument,
266 # instead of more old which need two.
267 AC_DEFUN([LIBCFS_2ARGS_REGISTER_SYSCTL],
268 [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
269 LB_LINUX_TRY_COMPILE([
270 #include <linux/sysctl.h>
272 register_sysctl_table(NULL,0);
275 AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
276 [register_sysctl_table want 2 args])
282 # 2.6.23 lost dtor argument
283 AC_DEFUN([LIBCFS_KMEM_CACHE_CREATE_DTOR],
284 [AC_MSG_CHECKING([check kmem_cache_create has dtor argument])
285 LB_LINUX_TRY_COMPILE([
286 #include <linux/slab.h>
288 kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
291 AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1,
292 [kmem_cache_create has dtor argument])
298 #2.6.23 has new shrinker API
299 AC_DEFUN([LC_REGISTER_SHRINKER],
300 [AC_MSG_CHECKING([if kernel has register_shrinker])
301 LB_LINUX_TRY_COMPILE([
302 #include <linux/mm.h>
304 register_shrinker(NULL);
307 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
308 [kernel has register_shrinker])
314 # 2.6.24 request not use real numbers for ctl_name
315 AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED],
316 [AC_MSG_CHECKING([for CTL_UNNUMBERED])
317 LB_LINUX_TRY_COMPILE([
318 #include <linux/sysctl.h>
320 #ifndef CTL_UNNUMBERED
321 #error CTL_UNNUMBERED not exist in kernel
325 AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
326 [sysctl has CTL_UNNUMBERED])
332 # 2.6.24 lost scatterlist->page
333 AC_DEFUN([LIBCFS_SCATTERLIST_SETPAGE],
334 [AC_MSG_CHECKING([for exist sg_set_page])
335 LB_LINUX_TRY_COMPILE([
336 #include <asm/types.h>
337 #include <linux/scatterlist.h>
339 sg_set_page(NULL,NULL,0,0);
342 AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1,
343 [struct scatterlist has page member])
349 # 2.6.24-rc1 sg_init_table
350 AC_DEFUN([LIBCFS_SCATTERLIST_INITTABLE],
351 [AC_MSG_CHECKING([for sg_init_table])
352 LB_LINUX_TRY_COMPILE([
353 #include <asm/types.h>
354 #include <linux/scatterlist.h>
356 sg_init_table(NULL,0);
359 AC_DEFINE(HAVE_SCATTERLIST_INITTABLE, 1,
360 [scatterlist has sg_init_table])
367 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
368 [AC_MSG_CHECKING([for network stack has namespaces])
369 LB_LINUX_TRY_COMPILE([
370 #include <net/net_namespace.h>
372 struct net *net __attribute__ ((unused));
376 AC_DEFINE(HAVE_INIT_NET, 1,
377 [kernel is support network namespaces ])
384 # LIBCFS_FUNC_DUMP_TRACE
386 # 2.6.23 exports dump_trace() so we can dump_stack() on any task
387 # 2.6.24 has stacktrace_ops.address with "reliable" parameter
389 AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
390 [LB_CHECK_SYMBOL_EXPORT([dump_trace],
391 [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c arch/x86/kernel/dumpstack_32.c arch/x86/kernel/dumpstack_64.c],[
392 tmp_flags="$EXTRA_KCFLAGS"
393 EXTRA_KCFLAGS="-Werror"
394 AC_MSG_CHECKING([whether we can really use dump_trace])
395 LB_LINUX_TRY_COMPILE([
398 #include <asm/stacktrace.h>
402 AC_DEFINE(HAVE_DUMP_TRACE, 1, [dump_trace is exported])
407 AC_MSG_CHECKING([whether print_trace_address has reliable argument])
408 LB_LINUX_TRY_COMPILE([
411 #include <asm/stacktrace.h>
413 ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
416 AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
417 [print_trace_address has reliable argument])
422 AC_MSG_CHECKING([whether stacktrace_ops.warning is exist])
423 LB_LINUX_TRY_COMPILE([
426 #include <asm/stacktrace.h>
428 ((struct stacktrace_ops *)0)->warning(NULL, NULL);
431 AC_DEFINE(HAVE_STACKTRACE_WARNING, 1, [stacktrace_ops.warning is exist])
436 AC_MSG_CHECKING([dump_trace want address])
437 LB_LINUX_TRY_COMPILE([
440 #include <asm/stacktrace.h>
442 dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
445 AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
446 [dump_trace want address argument])
452 EXTRA_KCFLAGS="$tmp_flags"
457 # 2.6.26 use int instead of atomic for sem.count
458 AC_DEFUN([LIBCFS_SEM_COUNT],
459 [AC_MSG_CHECKING([atomic sem.count])
460 LB_LINUX_TRY_COMPILE([
461 #include <asm/semaphore.h>
463 struct semaphore s __attribute__ ((unused));
465 atomic_read(&s.count);
468 AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
469 [semaphore counter is atomic])
475 # 2.6.27 have second argument to sock_map_fd
476 AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
477 [AC_MSG_CHECKING([sock_map_fd have second argument])
478 LB_LINUX_TRY_COMPILE([
479 #include <linux/net.h>
481 sock_map_fd(NULL, 0);
484 AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
485 [sock_map_fd have second argument])
491 # LIBCFS_CRED_WRAPPERS
493 # wrappers for task's credentials are in sles11
495 AC_DEFUN([LIBCFS_CRED_WRAPPERS],
496 [AC_MSG_CHECKING([if kernel has wrappers for task's credentials])
497 LB_LINUX_TRY_COMPILE([
498 #include <linux/sched.h>
502 uid = current_uid() + sizeof(uid);
505 AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
512 # LN_STRUCT_CRED_IN_TASK
514 # struct cred was introduced in 2.6.29 to streamline credentials in task struct
516 AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK],
517 [AC_MSG_CHECKING([if kernel has struct cred])
518 LB_LINUX_TRY_COMPILE([
519 #include <linux/sched.h>
521 struct task_struct *tsk = NULL;
522 tsk->real_cred = NULL;
525 AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found])
531 # LIBCFS_STRUCT_SHASH_ALG
532 # struct shash_alg was introduced in 2.6.29
534 AC_DEFUN([LIBCFS_STRUCT_SHASH_ALG],
535 [AC_MSG_CHECKING([if kernel has struct shash_alg])
536 LB_LINUX_TRY_COMPILE([
537 #include <linux/err.h>
538 #include <crypto/internal/hash.h>
540 struct shash_alg foo;
543 AC_DEFINE(HAVE_STRUCT_SHASH_ALG, 1, [kernel has struct shash_alg])
551 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
553 # unshare_fs_struct was introduced in 2.6.30 to prevent others to directly
554 # mess with copy_fs_struct
556 AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT],
557 [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()])
558 tmp_flags="$EXTRA_KCFLAGS"
559 EXTRA_KCFLAGS="-Werror"
560 LB_LINUX_TRY_COMPILE([
561 #include <linux/sched.h>
562 #include <linux/fs_struct.h>
567 AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found])
571 EXTRA_KCFLAGS="$tmp_flags"
575 # LIBCFS_HAVE_IS_COMPAT_TASK
577 # Added in 2.6.17, it wasn't until 2.6.29 that all
578 # Linux architectures have is_compat_task()
580 AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
581 [AC_MSG_CHECKING([if is_compat_task() is declared])
582 LB_LINUX_TRY_COMPILE([
583 #include <linux/compat.h>
585 int i __attribute__ ((unused));
586 i = is_compat_task();
589 AC_DEFINE(HAVE_IS_COMPAT_TASK, 1, [is_compat_task() is available])
596 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
598 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
600 AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK],
601 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
602 LB_LINUX_TRY_COMPILE([
603 #include <asm/stacktrace.h>
605 ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
608 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
614 AC_DEFUN([LIBCFS_HAVE_OOM_H],
615 [LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
616 AC_DEFINE(HAVE_LINUX_OOM_H, 1,
617 [kernel has include/oom.h])
624 # check set_mems_allowed
625 # 2.6.31 adds function set_mems_allowed in cpuset.h
627 AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED],
628 [AC_MSG_CHECKING([whether have set_mems_allowed()])
629 LB_LINUX_TRY_COMPILE([
630 #include <linux/cpuset.h>
634 set_mems_allowed(mask);
637 AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()])
645 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
647 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
648 [AC_MSG_CHECKING([shrinker want self pointer in handler])
649 LB_LINUX_TRY_COMPILE([
650 #include <linux/mm.h>
652 struct shrinker *tmp = NULL;
653 tmp->shrink(tmp, 0, 0);
656 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
657 [shrinker want self pointer in handler])
663 # 2.6.18 store oom parameters in task struct.
664 # 2.6.32 store oom parameters in signal struct
665 AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
666 [AC_MSG_CHECKING([kernel store oom parameters in task])
667 LB_LINUX_TRY_COMPILE([
668 #include <linux/sched.h>
670 ((struct signal_struct *)0)->oom_adj = 0;
673 AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
674 [kernel store a oom parameters in signal struct])
681 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
683 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME],
684 [AC_MSG_CHECKING([if ctl_table has a ctl_name field])
685 LB_LINUX_TRY_COMPILE([
686 #include <linux/sysctl.h>
689 ct.ctl_name = sizeof(ct);
692 AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
693 [ctl_table has ctl_name field])
700 # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
702 # 2.6.34 adds __add_wait_queue_exclusive
704 AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE],
705 [AC_MSG_CHECKING([if __add_wait_queue_exclusive exists])
706 LB_LINUX_TRY_COMPILE([
707 #include <linux/wait.h>
709 wait_queue_head_t queue;
712 __add_wait_queue_exclusive(&queue, &wait);
715 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
716 [__add_wait_queue_exclusive exists])
723 # 2.6.35 kernel has sk_sleep function
725 AC_DEFUN([LC_SK_SLEEP],
726 [AC_MSG_CHECKING([if kernel has sk_sleep])
727 LB_LINUX_TRY_COMPILE([
728 #include <net/sock.h>
733 AC_DEFINE(HAVE_SK_SLEEP, 1, [kernel has sk_sleep])
740 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
741 # pressure shrinker from Linux 3.0
743 AC_DEFUN([LC_SHRINK_CONTROL],
744 [AC_MSG_CHECKING([shrink_control is present])
745 LB_LINUX_TRY_COMPILE([
746 #include <linux/mm.h>
748 struct shrink_control tmp = {0};
749 tmp.nr_to_scan = sizeof(tmp);
752 AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
753 [shrink_control is present])
762 # LNet linux kernel checks
764 AC_DEFUN([LIBCFS_PROG_LINUX],
766 LIBCFS_CONFIG_PANIC_DUMPLOG
768 LIBCFS_U64_LONG_LONG_LINUX
771 LIBCFS_HAVE_IS_COMPAT_TASK
772 LIBCFS_DIGEST_SETKEY_FLAGS
774 LIBCFS_KMEM_CACHE_DESTROY_INT
776 LIBCFS_3ARGS_INIT_WORK
778 LIBCFS_2ARGS_REGISTER_SYSCTL
780 LIBCFS_KMEM_CACHE_CREATE_DTOR
783 LIBCFS_SYSCTL_UNNUMBERED
784 LIBCFS_SCATTERLIST_SETPAGE
785 LIBCFS_SCATTERLIST_INITTABLE
786 LIBCFS_NETWORK_NAMESPACE
787 LIBCFS_FUNC_DUMP_TRACE
795 LIBCFS_STRUCT_CRED_IN_TASK
797 LIBCFS_STRUCT_SHASH_ALG
799 LIBCFS_FUNC_UNSHARE_FS_STRUCT
800 LIBCFS_SOCK_MAP_FD_2ARG
802 LIBCFS_HAVE_SET_MEMS_ALLOWED
804 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
805 LC_SHRINKER_WANT_SHRINK_PTR
809 LIBCFS_SYSCTL_CTLNAME
811 LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
823 AC_DEFUN([LIBCFS_PROG_DARWIN],
824 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
828 # LIBCFS_PATH_DEFAULTS
830 # default paths for installed files
832 AC_DEFUN([LIBCFS_PATH_DEFAULTS],
839 # other configure checks
841 AC_DEFUN([LIBCFS_CONFIGURE],
842 [# lnet/utils/portals.c
843 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
846 AC_CHECK_HEADERS([linux/version.h])
848 AC_CHECK_TYPE([spinlock_t],
849 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
851 [#include <linux/spinlock.h>])
853 # lnet/utils/wirecheck.c
854 AC_CHECK_FUNCS([strnlen])
856 # lnet/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
857 AC_CHECK_FUNCS([strlcpy])
859 # libcfs/libcfs/user-prim.c, missing for RHEL5 and earlier userspace
860 AC_CHECK_FUNCS([strlcat])
862 AC_CHECK_TYPE([umode_t],
863 [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
865 [#include <asm/types.h>])
867 AC_CHECK_TYPE([__s8],
868 [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
870 [#include <asm/types.h>])
872 AC_CHECK_TYPE([__u8],
873 [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
875 [#include <asm/types.h>])
877 AC_CHECK_TYPE([__s16],
878 [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
880 [#include <asm/types.h>])
882 AC_CHECK_TYPE([__u16],
883 [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
885 [#include <asm/types.h>])
887 AC_CHECK_TYPE([__s32],
888 [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
890 [#include <asm/types.h>])
892 AC_CHECK_TYPE([__u32],
893 [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
895 [#include <asm/types.h>])
897 AC_CHECK_TYPE([__u64],
898 [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
900 [#include <asm/types.h>])
902 AC_CHECK_TYPE([__s64],
903 [AC_DEFINE(HAVE___S64, 1, [__s64 is defined])],
905 [#include <asm/types.h>])
907 # check userland __u64 type
908 AC_MSG_CHECKING([userspace __u64 is long long type])
910 CFLAGS="$CFLAGS -Werror"
913 #include <linux/types.h>
914 #include <linux/stddef.h>
916 unsigned long long *data1;
924 AC_DEFINE(HAVE_USER__U64_LONG_LONG, 1,
925 [__u64 is long long type])
931 # -------- Check for required packages --------------
934 AC_MSG_CHECKING([if efence debugging support is requested])
935 AC_ARG_ENABLE(efence,
936 AC_HELP_STRING([--enable-efence],
937 [use efence library]),
938 [],[enable_efence='no'])
939 AC_MSG_RESULT([$enable_efence])
940 if test "$enable_efence" = "yes" ; then
942 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
949 # -------- check for -lpthread support ----
950 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
951 AC_ARG_ENABLE([libpthread],
952 AC_HELP_STRING([--disable-libpthread],
953 [disable libpthread]),
954 [],[enable_libpthread=yes])
955 if test "$enable_libpthread" = "yes" ; then
956 AC_CHECK_LIB([pthread], [pthread_create],
957 [ENABLE_LIBPTHREAD="yes"],
958 [ENABLE_LIBPTHREAD="no"])
959 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
960 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
961 PTHREAD_LIBS="-lpthread"
962 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
965 AC_MSG_RESULT([no libpthread is found])
967 AC_SUBST(PTHREAD_LIBS)
969 AC_MSG_RESULT([no (disabled explicitly)])
970 ENABLE_LIBPTHREAD="no"
972 AC_SUBST(ENABLE_LIBPTHREAD)
978 # LIBCFS_CONDITIONALS
980 # AM_CONDITOINAL defines for lnet
982 AC_DEFUN([LIBCFS_CONDITIONALS],
987 # LIBCFS_CONFIG_FILES
989 # files that should be generated with AC_OUTPUT
991 AC_DEFUN([LIBCFS_CONFIG_FILES],
996 libcfs/autoconf/Makefile
997 libcfs/include/Makefile
998 libcfs/include/libcfs/Makefile
999 libcfs/include/libcfs/linux/Makefile
1000 libcfs/include/libcfs/posix/Makefile
1001 libcfs/include/libcfs/util/Makefile
1002 libcfs/libcfs/Makefile
1003 libcfs/libcfs/autoMakefile
1004 libcfs/libcfs/linux/Makefile
1005 libcfs/libcfs/posix/Makefile
1006 libcfs/libcfs/util/Makefile
1007 libcfs/include/libcfs/darwin/Makefile
1008 libcfs/libcfs/darwin/Makefile