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])
97 # kmem_cache_destroy(cachep) return void instead of
99 AC_DEFUN([LIBCFS_KMEM_CACHE_DESTROY_INT],
100 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
101 LB_LINUX_TRY_COMPILE([
102 #include <linux/slab.h>
104 int i __attribute__ ((unused));
105 i = kmem_cache_destroy(NULL);
108 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
109 [kmem_cache_destroy(cachep) return int])
115 # check cpumask_size (2.6.28)
116 AC_DEFUN([LIBCFS_CPUMASK_SIZE],
117 [AC_MSG_CHECKING([whether have cpumask_size()])
118 LB_LINUX_TRY_COMPILE([
119 #include <linux/cpumask.h>
121 int size = cpumask_size();
124 AC_DEFINE(HAVE_CPUMASK_SIZE, 1, [have cpumask_size()])
130 # check cpu topology functions
132 # topology_core_cpumask (2.6.29, not on all archs)
133 # topology_core_siblings (not on all archs)
134 # topology_thread_cpumask (2.6.29, not on all archs)
135 # topology_thread_siblings (not on all archs)
136 # cpumask_of_node/node_to_cpumask (not always exported)
137 AC_DEFUN([LIBCFS_CPU_TOPOLOGY],
138 [AC_MSG_CHECKING([whether have topology.h])
139 LB_LINUX_TRY_COMPILE([
140 #include <linux/topology.h>
142 AC_DEFINE(HAVE_CPU_TOPOLOGY, 1, [have CPU topology])
145 AC_MSG_CHECKING([whether have topology_core_cpumask])
146 LB_LINUX_TRY_COMPILE([
147 #include <linux/topology.h>
149 cpumask_t *mask = topology_core_cpumask(0);
151 AC_DEFINE(HAVE_TOPOLOGY_CORE_CPUMASK, 1,
152 [have topology_core_cpumask])
158 AC_MSG_CHECKING([whether have topology_core_siblings])
159 LB_LINUX_TRY_COMPILE([
160 #include <linux/topology.h>
162 cpumask_t mask = topology_core_siblings(0);
164 AC_DEFINE(HAVE_TOPOLOGY_CORE_SIBLINGS, 1,
165 [have topology_core_siblings])
171 AC_MSG_CHECKING([whether have topology_thread_cpumask])
172 LB_LINUX_TRY_COMPILE([
173 #include <linux/topology.h>
175 cpumask_t *mask = topology_thread_cpumask(0);
177 AC_DEFINE(HAVE_TOPOLOGY_THREAD_CPUMASK, 1,
178 [have topology_thread_cpumask])
184 AC_MSG_CHECKING([whether have topology_thread_siblings])
185 LB_LINUX_TRY_COMPILE([
186 #include <linux/topology.h>
188 cpumask_t mask = topology_thread_siblings(0);
190 AC_DEFINE(HAVE_TOPOLOGY_THREAD_SIBLINGS, 1,
191 [have topology_thread_siblings])
197 AC_MSG_CHECKING([whether have cpumask_of_node])
198 LB_LINUX_TRY_COMPILE([
199 #include <linux/topology.h>
201 cpumask_t *mask = cpumask_of_node(0);
203 AC_DEFINE(HAVE_CPUMASK_OF_NODE, 1, [have cpumask_of_node])
209 AC_MSG_CHECKING([whether have node_to_cpumask])
210 LB_LINUX_TRY_COMPILE([
211 #include <linux/topology.h>
213 cpumask_t mask = node_to_cpumask(0);
215 AC_DEFINE(HAVE_NODE_TO_CPUMASK, 1, [have node_to_cpumask])
225 # 2.6.20 API change INIT_WORK use 2 args and not
227 AC_DEFUN([LIBCFS_3ARGS_INIT_WORK],
228 [AC_MSG_CHECKING([check INIT_WORK want 3 args])
229 LB_LINUX_TRY_COMPILE([
230 #include <linux/workqueue.h>
232 struct work_struct work __attribute__ ((unused));
234 INIT_WORK(&work, NULL, NULL);
237 AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
238 [INIT_WORK use 3 args and store data inside])
244 # 2.6.21 api change. 'register_sysctl_table' use only one argument,
245 # instead of more old which need two.
246 AC_DEFUN([LIBCFS_2ARGS_REGISTER_SYSCTL],
247 [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
248 LB_LINUX_TRY_COMPILE([
249 #include <linux/sysctl.h>
251 register_sysctl_table(NULL,0);
254 AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
255 [register_sysctl_table want 2 args])
261 # 2.6.23 lost dtor argument
262 AC_DEFUN([LIBCFS_KMEM_CACHE_CREATE_DTOR],
263 [AC_MSG_CHECKING([check kmem_cache_create has dtor argument])
264 LB_LINUX_TRY_COMPILE([
265 #include <linux/slab.h>
267 kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
270 AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1,
271 [kmem_cache_create has dtor argument])
277 #2.6.23 has new shrinker API
278 AC_DEFUN([LC_REGISTER_SHRINKER],
279 [AC_MSG_CHECKING([if kernel has register_shrinker])
280 LB_LINUX_TRY_COMPILE([
281 #include <linux/mm.h>
283 register_shrinker(NULL);
286 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
287 [kernel has register_shrinker])
293 # 2.6.24 request not use real numbers for ctl_name
294 AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED],
295 [AC_MSG_CHECKING([for CTL_UNNUMBERED])
296 LB_LINUX_TRY_COMPILE([
297 #include <linux/sysctl.h>
299 #ifndef CTL_UNNUMBERED
300 #error CTL_UNNUMBERED not exist in kernel
304 AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
305 [sysctl has CTL_UNNUMBERED])
311 # 2.6.24 lost scatterlist->page
312 AC_DEFUN([LIBCFS_SCATTERLIST_SETPAGE],
313 [AC_MSG_CHECKING([for exist sg_set_page])
314 LB_LINUX_TRY_COMPILE([
315 #include <asm/types.h>
316 #include <linux/scatterlist.h>
318 sg_set_page(NULL,NULL,0,0);
321 AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1,
322 [struct scatterlist has page member])
329 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
330 [AC_MSG_CHECKING([for network stack has namespaces])
331 LB_LINUX_TRY_COMPILE([
332 #include <net/net_namespace.h>
334 struct net *net __attribute__ ((unused));
338 AC_DEFINE(HAVE_INIT_NET, 1,
339 [kernel is support network namespaces ])
346 # LIBCFS_FUNC_DUMP_TRACE
348 # 2.6.23 exports dump_trace() so we can dump_stack() on any task
349 # 2.6.24 has stacktrace_ops.address with "reliable" parameter
351 AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
352 [LB_CHECK_SYMBOL_EXPORT([dump_trace],
353 [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c arch/x86/kernel/dumpstack_32.c arch/x86/kernel/dumpstack_64.c],[
354 tmp_flags="$EXTRA_KCFLAGS"
355 EXTRA_KCFLAGS="-Werror"
356 AC_MSG_CHECKING([whether we can really use dump_trace])
357 LB_LINUX_TRY_COMPILE([
360 #include <asm/stacktrace.h>
364 AC_DEFINE(HAVE_DUMP_TRACE, 1, [dump_trace is exported])
369 AC_MSG_CHECKING([whether print_trace_address has reliable argument])
370 LB_LINUX_TRY_COMPILE([
373 #include <asm/stacktrace.h>
375 ((struct stacktrace_ops *)0)->address(NULL, 0, 0);
378 AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
379 [print_trace_address has reliable argument])
384 AC_MSG_CHECKING([whether stacktrace_ops.warning is exist])
385 LB_LINUX_TRY_COMPILE([
388 #include <asm/stacktrace.h>
390 ((struct stacktrace_ops *)0)->warning(NULL, NULL);
393 AC_DEFINE(HAVE_STACKTRACE_WARNING, 1, [stacktrace_ops.warning is exist])
398 AC_MSG_CHECKING([dump_trace want address])
399 LB_LINUX_TRY_COMPILE([
402 #include <asm/stacktrace.h>
404 dump_trace(NULL, NULL, NULL, 0, NULL, NULL);
407 AC_DEFINE(HAVE_DUMP_TRACE_ADDRESS, 1,
408 [dump_trace want address argument])
414 EXTRA_KCFLAGS="$tmp_flags"
419 # 2.6.26 use int instead of atomic for sem.count
420 AC_DEFUN([LIBCFS_SEM_COUNT],
421 [AC_MSG_CHECKING([atomic sem.count])
422 LB_LINUX_TRY_COMPILE([
423 #include <asm/semaphore.h>
425 struct semaphore s __attribute__ ((unused));
427 atomic_read(&s.count);
430 AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
431 [semaphore counter is atomic])
437 # 2.6.27 have second argument to sock_map_fd
438 AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
439 [AC_MSG_CHECKING([sock_map_fd have second argument])
440 LB_LINUX_TRY_COMPILE([
441 #include <linux/net.h>
443 sock_map_fd(NULL, 0);
446 AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
447 [sock_map_fd have second argument])
453 # LIBCFS_CRED_WRAPPERS
455 # wrappers for task's credentials are in sles11
457 AC_DEFUN([LIBCFS_CRED_WRAPPERS],
458 [AC_MSG_CHECKING([if kernel has wrappers for task's credentials])
459 LB_LINUX_TRY_COMPILE([
460 #include <linux/sched.h>
464 uid = current_uid() + sizeof(uid);
467 AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
474 # LN_STRUCT_CRED_IN_TASK
476 # struct cred was introduced in 2.6.29 to streamline credentials in task struct
478 AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK],
479 [AC_MSG_CHECKING([if kernel has struct cred])
480 LB_LINUX_TRY_COMPILE([
481 #include <linux/sched.h>
483 struct task_struct *tsk = NULL;
484 tsk->real_cred = NULL;
487 AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found])
494 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
496 # unshare_fs_struct was introduced in 2.6.30 to prevent others to directly
497 # mess with copy_fs_struct
499 AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT],
500 [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()])
501 tmp_flags="$EXTRA_KCFLAGS"
502 EXTRA_KCFLAGS="-Werror"
503 LB_LINUX_TRY_COMPILE([
504 #include <linux/sched.h>
505 #include <linux/fs_struct.h>
510 AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found])
514 EXTRA_KCFLAGS="$tmp_flags"
518 # LIBCFS_HAVE_IS_COMPAT_TASK
520 # Added in 2.6.17, it wasn't until 2.6.29 that all
521 # Linux architectures have is_compat_task()
523 AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
524 [AC_MSG_CHECKING([if is_compat_task() is declared])
525 LB_LINUX_TRY_COMPILE([
526 #include <linux/compat.h>
528 int i __attribute__ ((unused));
529 i = is_compat_task();
532 AC_DEFINE(HAVE_IS_COMPAT_TASK, 1, [is_compat_task() is available])
539 # LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
541 # 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
543 AC_DEFUN([LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK],
544 [AC_MSG_CHECKING([if 'struct stacktrace_ops' has 'walk_stack' field])
545 LB_LINUX_TRY_COMPILE([
546 #include <asm/stacktrace.h>
548 ((struct stacktrace_ops *)0)->walk_stack(NULL, NULL, 0, NULL, NULL, NULL, NULL);
551 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
557 AC_DEFUN([LIBCFS_HAVE_OOM_H],
558 [LB_CHECK_FILE([$LINUX/include/linux/oom.h], [
559 AC_DEFINE(HAVE_LINUX_OOM_H, 1,
560 [kernel has include/oom.h])
567 # check set_mems_allowed
568 # 2.6.31 adds function set_mems_allowed in cpuset.h
570 AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED],
571 [AC_MSG_CHECKING([whether have set_mems_allowed()])
572 LB_LINUX_TRY_COMPILE([
573 #include <linux/cpuset.h>
577 set_mems_allowed(mask);
580 AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()])
588 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
590 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
591 [AC_MSG_CHECKING([shrinker want self pointer in handler])
592 LB_LINUX_TRY_COMPILE([
593 #include <linux/mm.h>
595 struct shrinker *tmp = NULL;
596 tmp->shrink(tmp, 0, 0);
599 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
600 [shrinker want self pointer in handler])
606 # 2.6.18 store oom parameters in task struct.
607 # 2.6.32 store oom parameters in signal struct
608 AC_DEFUN([LIBCFS_OOMADJ_IN_SIG],
609 [AC_MSG_CHECKING([kernel store oom parameters in task])
610 LB_LINUX_TRY_COMPILE([
611 #include <linux/sched.h>
613 ((struct signal_struct *)0)->oom_adj = 0;
616 AC_DEFINE(HAVE_OOMADJ_IN_SIG, 1,
617 [kernel store a oom parameters in signal struct])
624 # 2.6.33 no longer has ctl_name & strategy field in struct ctl_table.
626 AC_DEFUN([LIBCFS_SYSCTL_CTLNAME],
627 [AC_MSG_CHECKING([if ctl_table has a ctl_name field])
628 LB_LINUX_TRY_COMPILE([
629 #include <linux/sysctl.h>
632 ct.ctl_name = sizeof(ct);
635 AC_DEFINE(HAVE_SYSCTL_CTLNAME, 1,
636 [ctl_table has ctl_name field])
643 # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
645 # 2.6.34 adds __add_wait_queue_exclusive
647 AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE],
648 [AC_MSG_CHECKING([if __add_wait_queue_exclusive exists])
649 LB_LINUX_TRY_COMPILE([
650 #include <linux/wait.h>
652 wait_queue_head_t queue;
655 __add_wait_queue_exclusive(&queue, &wait);
658 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
659 [__add_wait_queue_exclusive exists])
666 # 2.6.35 kernel has sk_sleep function
668 AC_DEFUN([LC_SK_SLEEP],
669 [AC_MSG_CHECKING([if kernel has sk_sleep])
670 LB_LINUX_TRY_COMPILE([
671 #include <net/sock.h>
676 AC_DEFINE(HAVE_SK_SLEEP, 1, [kernel has sk_sleep])
683 # FC15 2.6.40-5 backported the "shrink_control" parameter to the memory
684 # pressure shrinker from Linux 3.0
686 AC_DEFUN([LC_SHRINK_CONTROL],
687 [AC_MSG_CHECKING([shrink_control is present])
688 LB_LINUX_TRY_COMPILE([
689 #include <linux/mm.h>
691 struct shrink_control tmp = {0};
692 tmp.nr_to_scan = sizeof(tmp);
695 AC_DEFINE(HAVE_SHRINK_CONTROL, 1,
696 [shrink_control is present])
705 # LNet linux kernel checks
707 AC_DEFUN([LIBCFS_PROG_LINUX],
709 LIBCFS_CONFIG_PANIC_DUMPLOG
711 LIBCFS_U64_LONG_LONG_LINUX
714 LIBCFS_HAVE_IS_COMPAT_TASK
716 LIBCFS_KMEM_CACHE_DESTROY_INT
718 LIBCFS_3ARGS_INIT_WORK
720 LIBCFS_2ARGS_REGISTER_SYSCTL
722 LIBCFS_KMEM_CACHE_CREATE_DTOR
725 LIBCFS_SYSCTL_UNNUMBERED
726 LIBCFS_SCATTERLIST_SETPAGE
727 LIBCFS_NETWORK_NAMESPACE
728 LIBCFS_FUNC_DUMP_TRACE
736 LIBCFS_STRUCT_CRED_IN_TASK
739 LIBCFS_FUNC_UNSHARE_FS_STRUCT
740 LIBCFS_SOCK_MAP_FD_2ARG
742 LIBCFS_HAVE_SET_MEMS_ALLOWED
744 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
745 LC_SHRINKER_WANT_SHRINK_PTR
749 LIBCFS_SYSCTL_CTLNAME
751 LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
763 AC_DEFUN([LIBCFS_PROG_DARWIN],
764 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
768 # LIBCFS_PATH_DEFAULTS
770 # default paths for installed files
772 AC_DEFUN([LIBCFS_PATH_DEFAULTS],
779 # other configure checks
781 AC_DEFUN([LIBCFS_CONFIGURE],
782 [# lnet/utils/portals.c
783 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
786 AC_CHECK_HEADERS([linux/version.h])
788 AC_CHECK_TYPE([spinlock_t],
789 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
791 [#include <linux/spinlock.h>])
793 # lnet/utils/wirecheck.c
794 AC_CHECK_FUNCS([strnlen])
796 AC_CHECK_TYPE([umode_t],
797 [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
799 [#include <asm/types.h>])
801 AC_CHECK_TYPE([__s8],
802 [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
804 [#include <asm/types.h>])
806 AC_CHECK_TYPE([__u8],
807 [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
809 [#include <asm/types.h>])
811 AC_CHECK_TYPE([__s16],
812 [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
814 [#include <asm/types.h>])
816 AC_CHECK_TYPE([__u16],
817 [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
819 [#include <asm/types.h>])
821 AC_CHECK_TYPE([__s32],
822 [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
824 [#include <asm/types.h>])
826 AC_CHECK_TYPE([__u32],
827 [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
829 [#include <asm/types.h>])
831 AC_CHECK_TYPE([__u64],
832 [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
834 [#include <asm/types.h>])
836 AC_CHECK_TYPE([__s64],
837 [AC_DEFINE(HAVE___S64, 1, [__s64 is defined])],
839 [#include <asm/types.h>])
841 # check userland __u64 type
842 AC_MSG_CHECKING([userspace __u64 is long long type])
844 CFLAGS="$CFLAGS -Werror"
847 #include <linux/types.h>
848 #include <linux/stddef.h>
850 unsigned long long *data1;
858 AC_DEFINE(HAVE_USER__U64_LONG_LONG, 1,
859 [__u64 is long long type])
865 # -------- Check for required packages --------------
868 AC_MSG_CHECKING([if efence debugging support is requested])
869 AC_ARG_ENABLE(efence,
870 AC_HELP_STRING([--enable-efence],
871 [use efence library]),
872 [],[enable_efence='no'])
873 AC_MSG_RESULT([$enable_efence])
874 if test "$enable_efence" = "yes" ; then
876 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
883 # -------- check for -lpthread support ----
884 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
885 AC_ARG_ENABLE([libpthread],
886 AC_HELP_STRING([--disable-libpthread],
887 [disable libpthread]),
888 [],[enable_libpthread=yes])
889 if test "$enable_libpthread" = "yes" ; then
890 AC_CHECK_LIB([pthread], [pthread_create],
891 [ENABLE_LIBPTHREAD="yes"],
892 [ENABLE_LIBPTHREAD="no"])
893 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
894 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
895 PTHREAD_LIBS="-lpthread"
896 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
899 AC_MSG_RESULT([no libpthread is found])
901 AC_SUBST(PTHREAD_LIBS)
903 AC_MSG_RESULT([no (disabled explicitly)])
904 ENABLE_LIBPTHREAD="no"
906 AC_SUBST(ENABLE_LIBPTHREAD)
912 # LIBCFS_CONDITIONALS
914 # AM_CONDITOINAL defines for lnet
916 AC_DEFUN([LIBCFS_CONDITIONALS],
921 # LIBCFS_CONFIG_FILES
923 # files that should be generated with AC_OUTPUT
925 AC_DEFUN([LIBCFS_CONFIG_FILES],
930 libcfs/autoconf/Makefile
931 libcfs/include/Makefile
932 libcfs/include/libcfs/Makefile
933 libcfs/include/libcfs/linux/Makefile
934 libcfs/include/libcfs/posix/Makefile
935 libcfs/include/libcfs/util/Makefile
936 libcfs/libcfs/Makefile
937 libcfs/libcfs/autoMakefile
938 libcfs/libcfs/linux/Makefile
939 libcfs/libcfs/posix/Makefile
940 libcfs/libcfs/util/Makefile
941 libcfs/include/libcfs/darwin/Makefile
942 libcfs/libcfs/darwin/Makefile