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])
350 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
351 [AC_MSG_CHECKING([for network stack has namespaces])
352 LB_LINUX_TRY_COMPILE([
353 #include <net/net_namespace.h>
355 struct net *net __attribute__ ((unused));
359 AC_DEFINE(HAVE_INIT_NET, 1,
360 [kernel is support network namespaces ])
367 # LIBCFS_FUNC_DUMP_TRACE
369 # 2.6.23 exports dump_trace() so we can dump_stack() on any task
370 # 2.6.24 has stacktrace_ops.address with "reliable" parameter
372 AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
373 [LB_CHECK_SYMBOL_EXPORT([dump_trace],
374 [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c arch/x86/kernel/dumpstack_32.c arch/x86/kernel/dumpstack_64.c],[
375 tmp_flags="$EXTRA_KCFLAGS"
376 EXTRA_KCFLAGS="-Werror"
377 AC_MSG_CHECKING([whether we can really use dump_trace])
378 LB_LINUX_TRY_COMPILE([
381 #include <asm/stacktrace.h>
385 AC_DEFINE(HAVE_DUMP_TRACE, 1, [dump_trace is exported])
390 AC_MSG_CHECKING([whether print_trace_address has reliable argument])
391 LB_LINUX_TRY_COMPILE([
394 #include <asm/stacktrace.h>
396 ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
399 AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
400 [print_trace_address has reliable argument])
405 AC_MSG_CHECKING([whether stacktrace_ops.warning is exist])
406 LB_LINUX_TRY_COMPILE([
409 #include <asm/stacktrace.h>
411 ((struct stacktrace_ops *)0)->warning(NULL, NULL);
414 AC_DEFINE(HAVE_STACKTRACE_WARNING, 1, [stacktrace_ops.warning is exist])
419 AC_MSG_CHECKING([dump_trace want address])
420 LB_LINUX_TRY_COMPILE([
423 #include <asm/stacktrace.h>
425 dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
428 AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
429 [dump_trace want address argument])
435 EXTRA_KCFLAGS="$tmp_flags"
440 # 2.6.26 use int instead of atomic for sem.count
441 AC_DEFUN([LIBCFS_SEM_COUNT],
442 [AC_MSG_CHECKING([atomic sem.count])
443 LB_LINUX_TRY_COMPILE([
444 #include <asm/semaphore.h>
446 struct semaphore s __attribute__ ((unused));
448 atomic_read(&s.count);
451 AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
452 [semaphore counter is atomic])
458 # 2.6.27 have second argument to sock_map_fd
459 AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
460 [AC_MSG_CHECKING([sock_map_fd have second argument])
461 LB_LINUX_TRY_COMPILE([
462 #include <linux/net.h>
464 sock_map_fd(NULL, 0);
467 AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
468 [sock_map_fd have second argument])
474 # LIBCFS_CRED_WRAPPERS
476 # wrappers for task's credentials are in sles11
478 AC_DEFUN([LIBCFS_CRED_WRAPPERS],
479 [AC_MSG_CHECKING([if kernel has wrappers for task's credentials])
480 LB_LINUX_TRY_COMPILE([
481 #include <linux/sched.h>
485 uid = current_uid() + sizeof(uid);
488 AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
495 # LN_STRUCT_CRED_IN_TASK
497 # struct cred was introduced in 2.6.29 to streamline credentials in task struct
499 AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK],
500 [AC_MSG_CHECKING([if kernel has struct cred])
501 LB_LINUX_TRY_COMPILE([
502 #include <linux/sched.h>
504 struct task_struct *tsk = NULL;
505 tsk->real_cred = NULL;
508 AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found])
514 # LIBCFS_STRUCT_SHASH_ALG
515 # struct shash_alg was introduced in 2.6.29
517 AC_DEFUN([LIBCFS_STRUCT_SHASH_ALG],
518 [AC_MSG_CHECKING([if kernel has struct shash_alg])
519 LB_LINUX_TRY_COMPILE([
520 #include <linux/err.h>
521 #include <crypto/internal/hash.h>
523 struct shash_alg foo;
526 AC_DEFINE(HAVE_STRUCT_SHASH_ALG, 1, [kernel has struct shash_alg])
534 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
536 # unshare_fs_struct was introduced in 2.6.30 to prevent others to directly
537 # mess with copy_fs_struct
539 AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT],
540 [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()])
541 tmp_flags="$EXTRA_KCFLAGS"
542 EXTRA_KCFLAGS="-Werror"
543 LB_LINUX_TRY_COMPILE([
544 #include <linux/sched.h>
545 #include <linux/fs_struct.h>
550 AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found])
554 EXTRA_KCFLAGS="$tmp_flags"
558 # LIBCFS_HAVE_IS_COMPAT_TASK
560 # Added in 2.6.17, it wasn't until 2.6.29 that all
561 # Linux architectures have is_compat_task()
563 AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
564 [AC_MSG_CHECKING([if is_compat_task() is declared])
565 LB_LINUX_TRY_COMPILE([
566 #include <linux/compat.h>
568 int i __attribute__ ((unused));
569 i = is_compat_task();
572 AC_DEFINE(HAVE_IS_COMPAT_TASK, 1, [is_compat_task() is available])
579 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
581 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
583 AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK],
584 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
585 LB_LINUX_TRY_COMPILE([
586 #include <asm/stacktrace.h>
588 ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
591 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
597 AC_DEFUN([LIBCFS_HAVE_OOM_H],
598 [LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
599 AC_DEFINE(HAVE_LINUX_OOM_H, 1,
600 [kernel has include/oom.h])
607 # check set_mems_allowed
608 # 2.6.31 adds function set_mems_allowed in cpuset.h
610 AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED],
611 [AC_MSG_CHECKING([whether have set_mems_allowed()])
612 LB_LINUX_TRY_COMPILE([
613 #include <linux/cpuset.h>
617 set_mems_allowed(mask);
620 AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()])
628 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
630 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
631 [AC_MSG_CHECKING([shrinker want self pointer in handler])
632 LB_LINUX_TRY_COMPILE([
633 #include <linux/mm.h>
635 struct shrinker *tmp = NULL;
636 tmp->shrink(tmp, 0, 0);
639 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
640 [shrinker want self pointer in handler])
646 # 2.6.18 store oom parameters in task struct.
647 # 2.6.32 store oom parameters in signal struct
648 AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
649 [AC_MSG_CHECKING([kernel store oom parameters in task])
650 LB_LINUX_TRY_COMPILE([
651 #include <linux/sched.h>
653 ((struct signal_struct *)0)->oom_adj = 0;
656 AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
657 [kernel store a oom parameters in signal struct])
664 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
666 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME],
667 [AC_MSG_CHECKING([if ctl_table has a ctl_name field])
668 LB_LINUX_TRY_COMPILE([
669 #include <linux/sysctl.h>
672 ct.ctl_name = sizeof(ct);
675 AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
676 [ctl_table has ctl_name field])
683 # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
685 # 2.6.34 adds __add_wait_queue_exclusive
687 AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE],
688 [AC_MSG_CHECKING([if __add_wait_queue_exclusive exists])
689 LB_LINUX_TRY_COMPILE([
690 #include <linux/wait.h>
692 wait_queue_head_t queue;
695 __add_wait_queue_exclusive(&queue, &wait);
698 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
699 [__add_wait_queue_exclusive exists])
706 # 2.6.35 kernel has sk_sleep function
708 AC_DEFUN([LC_SK_SLEEP],
709 [AC_MSG_CHECKING([if kernel has sk_sleep])
710 LB_LINUX_TRY_COMPILE([
711 #include <net/sock.h>
716 AC_DEFINE(HAVE_SK_SLEEP, 1, [kernel has sk_sleep])
723 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
724 # pressure shrinker from Linux 3.0
726 AC_DEFUN([LC_SHRINK_CONTROL],
727 [AC_MSG_CHECKING([shrink_control is present])
728 LB_LINUX_TRY_COMPILE([
729 #include <linux/mm.h>
731 struct shrink_control tmp = {0};
732 tmp.nr_to_scan = sizeof(tmp);
735 AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
736 [shrink_control is present])
745 # LNet linux kernel checks
747 AC_DEFUN([LIBCFS_PROG_LINUX],
749 LIBCFS_CONFIG_PANIC_DUMPLOG
751 LIBCFS_U64_LONG_LONG_LINUX
754 LIBCFS_HAVE_IS_COMPAT_TASK
755 LIBCFS_DIGEST_SETKEY_FLAGS
757 LIBCFS_KMEM_CACHE_DESTROY_INT
759 LIBCFS_3ARGS_INIT_WORK
761 LIBCFS_2ARGS_REGISTER_SYSCTL
763 LIBCFS_KMEM_CACHE_CREATE_DTOR
766 LIBCFS_SYSCTL_UNNUMBERED
767 LIBCFS_SCATTERLIST_SETPAGE
768 LIBCFS_NETWORK_NAMESPACE
769 LIBCFS_FUNC_DUMP_TRACE
777 LIBCFS_STRUCT_CRED_IN_TASK
779 LIBCFS_STRUCT_SHASH_ALG
781 LIBCFS_FUNC_UNSHARE_FS_STRUCT
782 LIBCFS_SOCK_MAP_FD_2ARG
784 LIBCFS_HAVE_SET_MEMS_ALLOWED
786 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
787 LC_SHRINKER_WANT_SHRINK_PTR
791 LIBCFS_SYSCTL_CTLNAME
793 LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
805 AC_DEFUN([LIBCFS_PROG_DARWIN],
806 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
810 # LIBCFS_PATH_DEFAULTS
812 # default paths for installed files
814 AC_DEFUN([LIBCFS_PATH_DEFAULTS],
821 # other configure checks
823 AC_DEFUN([LIBCFS_CONFIGURE],
824 [# lnet/utils/portals.c
825 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
828 AC_CHECK_HEADERS([linux/version.h])
830 AC_CHECK_TYPE([spinlock_t],
831 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
833 [#include <linux/spinlock.h>])
835 # lnet/utils/wirecheck.c
836 AC_CHECK_FUNCS([strnlen])
838 AC_CHECK_TYPE([umode_t],
839 [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
841 [#include <asm/types.h>])
843 AC_CHECK_TYPE([__s8],
844 [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
846 [#include <asm/types.h>])
848 AC_CHECK_TYPE([__u8],
849 [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
851 [#include <asm/types.h>])
853 AC_CHECK_TYPE([__s16],
854 [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
856 [#include <asm/types.h>])
858 AC_CHECK_TYPE([__u16],
859 [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
861 [#include <asm/types.h>])
863 AC_CHECK_TYPE([__s32],
864 [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
866 [#include <asm/types.h>])
868 AC_CHECK_TYPE([__u32],
869 [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
871 [#include <asm/types.h>])
873 AC_CHECK_TYPE([__u64],
874 [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
876 [#include <asm/types.h>])
878 AC_CHECK_TYPE([__s64],
879 [AC_DEFINE(HAVE___S64, 1, [__s64 is defined])],
881 [#include <asm/types.h>])
883 # check userland __u64 type
884 AC_MSG_CHECKING([userspace __u64 is long long type])
886 CFLAGS="$CFLAGS -Werror"
889 #include <linux/types.h>
890 #include <linux/stddef.h>
892 unsigned long long *data1;
900 AC_DEFINE(HAVE_USER__U64_LONG_LONG, 1,
901 [__u64 is long long type])
907 # -------- Check for required packages --------------
910 AC_MSG_CHECKING([if efence debugging support is requested])
911 AC_ARG_ENABLE(efence,
912 AC_HELP_STRING([--enable-efence],
913 [use efence library]),
914 [],[enable_efence='no'])
915 AC_MSG_RESULT([$enable_efence])
916 if test "$enable_efence" = "yes" ; then
918 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
925 # -------- check for -lpthread support ----
926 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
927 AC_ARG_ENABLE([libpthread],
928 AC_HELP_STRING([--disable-libpthread],
929 [disable libpthread]),
930 [],[enable_libpthread=yes])
931 if test "$enable_libpthread" = "yes" ; then
932 AC_CHECK_LIB([pthread], [pthread_create],
933 [ENABLE_LIBPTHREAD="yes"],
934 [ENABLE_LIBPTHREAD="no"])
935 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
936 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
937 PTHREAD_LIBS="-lpthread"
938 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
941 AC_MSG_RESULT([no libpthread is found])
943 AC_SUBST(PTHREAD_LIBS)
945 AC_MSG_RESULT([no (disabled explicitly)])
946 ENABLE_LIBPTHREAD="no"
948 AC_SUBST(ENABLE_LIBPTHREAD)
954 # LIBCFS_CONDITIONALS
956 # AM_CONDITOINAL defines for lnet
958 AC_DEFUN([LIBCFS_CONDITIONALS],
963 # LIBCFS_CONFIG_FILES
965 # files that should be generated with AC_OUTPUT
967 AC_DEFUN([LIBCFS_CONFIG_FILES],
972 libcfs/autoconf/Makefile
973 libcfs/include/Makefile
974 libcfs/include/libcfs/Makefile
975 libcfs/include/libcfs/linux/Makefile
976 libcfs/include/libcfs/posix/Makefile
977 libcfs/include/libcfs/util/Makefile
978 libcfs/libcfs/Makefile
979 libcfs/libcfs/autoMakefile
980 libcfs/libcfs/linux/Makefile
981 libcfs/libcfs/posix/Makefile
982 libcfs/libcfs/util/Makefile
983 libcfs/include/libcfs/darwin/Makefile
984 libcfs/libcfs/darwin/Makefile