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)])
63 # LIBCFS_FUNC_CPU_ONLINE
65 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
67 AC_DEFUN([LIBCFS_FUNC_CPU_ONLINE],
68 [AC_MSG_CHECKING([if kernel defines cpu_online()])
69 LB_LINUX_TRY_COMPILE([
70 #include <linux/sched.h>
75 AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
84 # check if gfp_t is typedef-ed
86 AC_DEFUN([LIBCFS_TYPE_GFP_T],
87 [AC_MSG_CHECKING([if kernel defines gfp_t])
88 LB_LINUX_TRY_COMPILE([
89 #include <linux/gfp.h>
94 AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
101 # LIBCFS_FUNC_SHOW_TASK
103 # we export show_task(), but not all kernels have it (yet)
105 AC_DEFUN([LIBCFS_FUNC_SHOW_TASK],
106 [LB_CHECK_SYMBOL_EXPORT([show_task],
107 [kernel/ksyms.c kernel/sched.c],[
108 AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
110 LB_CHECK_SYMBOL_EXPORT([sched_show_task],
111 [kernel/ksyms.c kernel/sched.c],[
112 AC_DEFINE(HAVE_SCHED_SHOW_TASK, 1, [sched_show_task is exported])
117 # check kernel __u64 type
118 AC_DEFUN([LIBCFS_U64_LONG_LONG_LINUX],
120 AC_MSG_CHECKING([kernel __u64 is long long type])
121 tmp_flags="$EXTRA_KCFLAGS"
122 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
123 LB_LINUX_TRY_COMPILE([
124 #include <linux/types.h>
125 #include <linux/stddef.h>
127 unsigned long long *data1;
133 AC_DEFINE(HAVE_KERN__U64_LONG_LONG, 1,
134 [kernel __u64 is long long type])
138 EXTRA_KCFLAGS="$tmp_flags"
141 # check if task_struct with rcu memeber
142 AC_DEFUN([LIBCFS_TASK_RCU],
143 [AC_MSG_CHECKING([if task_struct has a rcu field])
144 LB_LINUX_TRY_COMPILE([
145 #include <linux/sched.h>
147 struct task_struct tsk;
152 AC_DEFINE(HAVE_TASK_RCU, 1,
153 [task_struct has rcu field])
159 # LIBCFS_TASKLIST_LOCK
160 # 2.6.18 remove tasklist_lock export
161 AC_DEFUN([LIBCFS_TASKLIST_LOCK],
162 [LB_CHECK_SYMBOL_EXPORT([tasklist_lock],
164 AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
165 [tasklist_lock exported])
171 # kmem_cache_destroy(cachep) return void instead of
173 AC_DEFUN([LIBCFS_KMEM_CACHE_DESTROY_INT],
174 [AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
175 LB_LINUX_TRY_COMPILE([
176 #include <linux/slab.h>
178 int i = kmem_cache_destroy(NULL);
181 AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
182 [kmem_cache_destroy(cachep) return int])
189 #panic_notifier_list use atomic_notifier operations
191 AC_DEFUN([LIBCFS_ATOMIC_PANIC_NOTIFIER],
192 [AC_MSG_CHECKING([panic_notifier_list is atomic])
193 LB_LINUX_TRY_COMPILE([
194 #include <linux/notifier.h>
195 #include <linux/kernel.h>
197 struct atomic_notifier_head panic_notifier_list;
200 AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
201 [panic_notifier_list is atomic_notifier_head])
207 # since 2.6.19 nlmsg_multicast() needs 5 argument.
208 AC_DEFUN([LIBCFS_NLMSG_MULTICAST],
209 [AC_MSG_CHECKING([nlmsg_multicast needs 5 argument])
210 LB_LINUX_TRY_COMPILE([
211 #include <net/netlink.h>
213 nlmsg_multicast(NULL, NULL, 0, 0, 0);
216 AC_DEFINE(HAVE_NLMSG_MULTICAST_5ARGS, 1,
217 [nlmsg_multicast needs 5 argument])
226 # If we have netlink.h, and nlmsg_new takes 2 args (2.6.19)
228 AC_DEFUN([LIBCFS_NETLINK],
229 [AC_MSG_CHECKING([if netlink.h can be compiled])
230 LB_LINUX_TRY_COMPILE([
231 #include <net/netlink.h>
234 AC_DEFINE(HAVE_NETLINK, 1, [net/netlink.h found])
236 AC_MSG_CHECKING([if nlmsg_new takes a 2nd argument])
237 LB_LINUX_TRY_COMPILE([
238 #include <net/netlink.h>
240 nlmsg_new(100, GFP_KERNEL);
243 AC_DEFINE(HAVE_NETLINK_NL2, 1, [nlmsg_new takes 2 args])
252 # 2.6.20 API change INIT_WORK use 2 args and not
254 AC_DEFUN([LIBCFS_3ARGS_INIT_WORK],
255 [AC_MSG_CHECKING([check INIT_WORK want 3 args])
256 LB_LINUX_TRY_COMPILE([
257 #include <linux/workqueue.h>
259 struct work_struct work;
261 INIT_WORK(&work, NULL, NULL);
264 AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1,
265 [INIT_WORK use 3 args and store data inside])
271 # 2.6.21 api change. 'register_sysctl_table' use only one argument,
272 # instead of more old which need two.
273 AC_DEFUN([LIBCFS_2ARGS_REGISTER_SYSCTL],
274 [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
275 LB_LINUX_TRY_COMPILE([
276 #include <linux/sysctl.h>
278 return register_sysctl_table(NULL,0);
281 AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1,
282 [register_sysctl_table want 2 args])
288 # 2.6.21 marks kmem_cache_t deprecated and uses struct kmem_cache
290 AC_DEFUN([LIBCFS_KMEM_CACHE],
291 [AC_MSG_CHECKING([check kernel has struct kmem_cache])
292 tmp_flags="$EXTRA_KCFLAGS"
293 EXTRA_KCFLAGS="-Werror"
294 LB_LINUX_TRY_COMPILE([
295 #include <linux/slab.h>
296 typedef struct kmem_cache cache_t;
298 cache_t *cachep = NULL;
300 kmem_cache_alloc(cachep, 0);
303 AC_DEFINE(HAVE_KMEM_CACHE, 1,
304 [kernel has struct kmem_cache])
308 EXTRA_KCFLAGS="$tmp_flags"
311 # 2.6.23 lost dtor argument
312 AC_DEFUN([LIBCFS_KMEM_CACHE_CREATE_DTOR],
313 [AC_MSG_CHECKING([check kmem_cache_create has dtor argument])
314 LB_LINUX_TRY_COMPILE([
315 #include <linux/slab.h>
317 kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
320 AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1,
321 [kmem_cache_create has dtor argument])
327 #2.6.23 has new shrinker API
328 AC_DEFUN([LC_REGISTER_SHRINKER],
329 [AC_MSG_CHECKING([if kernel has register_shrinker])
330 LB_LINUX_TRY_COMPILE([
331 #include <linux/mm.h>
333 register_shrinker(NULL);
336 AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
337 [kernel has register_shrinker])
344 AC_DEFUN([LIBCFS_NETLINK_CBMUTEX],
345 [AC_MSG_CHECKING([for mutex in netlink_kernel_create])
346 LB_LINUX_TRY_COMPILE([
347 #include <linux/netlink.h>
349 struct mutex *lock = NULL;
351 netlink_kernel_create(0, 0, NULL, lock, NULL);
354 AC_DEFINE(HAVE_NETLINK_CBMUTEX, 1,
355 [netlink_kernel_create want mutex for callback])
361 # 2.6.24 request not use real numbers for ctl_name
362 AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED],
363 [AC_MSG_CHECKING([for CTL_UNNUMBERED])
364 LB_LINUX_TRY_COMPILE([
365 #include <linux/sysctl.h>
367 #ifndef CTL_UNNUMBERED
368 #error CTL_UNNUMBERED not exist in kernel
372 AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
373 [sysctl has CTL_UNNUMBERED])
379 # 2.6.24 lost scatterlist->page
380 AC_DEFUN([LIBCFS_SCATTERLIST_SETPAGE],
381 [AC_MSG_CHECKING([for exist sg_set_page])
382 LB_LINUX_TRY_COMPILE([
383 #include <asm/types.h>
384 #include <linux/scatterlist.h>
386 sg_set_page(NULL,NULL,0,0);
389 AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1,
390 [struct scatterlist has page member])
397 AC_DEFUN([LIBCFS_NETWORK_NAMESPACE],
398 [AC_MSG_CHECKING([for network stack has namespaces])
399 LB_LINUX_TRY_COMPILE([
400 #include <net/net_namespace.h>
402 struct net *net = &init_net;
405 AC_DEFINE(HAVE_INIT_NET, 1,
406 [kernel is support network namespaces ])
414 AC_DEFUN([LIBCFS_NETLINK_NETNS],
415 [AC_MSG_CHECKING([for netlink support net ns])
416 LB_LINUX_TRY_COMPILE([
417 #include <linux/netlink.h>
419 struct net *net = NULL;
420 struct mutex *lock = NULL;
422 netlink_kernel_create(net, 0, 0, NULL,
427 AC_DEFINE(HAVE_NETLINK_NS, 1,
428 [netlink is support network namespace])
430 # for now - if kernel have netlink ns - he uses cbmutex
431 AC_DEFINE(HAVE_NETLINK_CBMUTEX, 1,
432 [netlink_kernel_create want mutex for callback])
440 AC_DEFUN([LIBCFS_NL_BROADCAST_GFP],
441 [AC_MSG_CHECKING([for netlink_broadcast is want to have gfp parameter])
442 LB_LINUX_TRY_COMPILE([
443 #include <linux/netlink.h>
445 gfp_t gfp = GFP_KERNEL;
447 netlink_broadcast(NULL, NULL, 0, 0, gfp);
450 AC_DEFINE(HAVE_NL_BROADCAST_GFP, 1,
451 [netlink brouacast is want to have gfp paramter])
458 # LIBCFS_FUNC_DUMP_TRACE
460 # 2.6.23 exports dump_trace() so we can dump_stack() on any task
461 # 2.6.24 has stacktrace_ops.address with "reliable" parameter
463 AC_DEFUN([LIBCFS_FUNC_DUMP_TRACE],
464 [LB_CHECK_SYMBOL_EXPORT([dump_trace],
465 [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c arch/x86/kernel/dumpstack_32.c arch/x86/kernel/dumpstack_64.c],[
466 tmp_flags="$EXTRA_KCFLAGS"
467 EXTRA_KCFLAGS="-Werror"
468 AC_MSG_CHECKING([whether we can really use dump_trace])
469 LB_LINUX_TRY_COMPILE([
472 #include <asm/stacktrace.h>
476 AC_DEFINE(HAVE_DUMP_TRACE, 1, [dump_trace is exported])
481 AC_MSG_CHECKING([whether print_trace_address has reliable argument])
482 LB_LINUX_TRY_COMPILE([
485 void print_addr(void *data, unsigned long addr, int reliable);
486 #include <asm/stacktrace.h>
488 struct stacktrace_ops ops;
490 ops.address = print_addr;
493 AC_DEFINE(HAVE_TRACE_ADDRESS_RELIABLE, 1,
494 [print_trace_address has reliable argument])
499 EXTRA_KCFLAGS="$tmp_flags"
504 # 2.6.26 use int instead of atomic for sem.count
505 AC_DEFUN([LIBCFS_SEM_COUNT],
506 [AC_MSG_CHECKING([atomic sem.count])
507 LB_LINUX_TRY_COMPILE([
508 #include <asm/semaphore.h>
512 atomic_read(&s.count);
515 AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
516 [semaphore counter is atomic])
522 # 2.6.27 have second argument to sock_map_fd
523 AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG],
524 [AC_MSG_CHECKING([sock_map_fd have second argument])
525 LB_LINUX_TRY_COMPILE([
526 #include <linux/net.h>
528 sock_map_fd(NULL, 0);
531 AC_DEFINE(HAVE_SOCK_MAP_FD_2ARG, 1,
532 [sock_map_fd have second argument])
538 # LIBCFS_CRED_WRAPPERS
540 # wrappers for task's credentials are in sles11
542 AC_DEFUN([LIBCFS_CRED_WRAPPERS],
543 [AC_MSG_CHECKING([if kernel has wrappers for task's credentials])
544 LB_LINUX_TRY_COMPILE([
545 #include <linux/sched.h>
552 AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found])
559 # LN_STRUCT_CRED_IN_TASK
561 # struct cred was introduced in 2.6.29 to streamline credentials in task struct
563 AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK],
564 [AC_MSG_CHECKING([if kernel has struct cred])
565 LB_LINUX_TRY_COMPILE([
566 #include <linux/sched.h>
568 struct task_struct *tsk = NULL;
569 tsk->real_cred = NULL;
572 AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found])
579 # LIBCFS_FUNC_UNSHARE_FS_STRUCT
581 # unshare_fs_struct was introduced in 2.6.30 to prevent others to directly
582 # mess with copy_fs_struct
584 AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT],
585 [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()])
586 tmp_flags="$EXTRA_KCFLAGS"
587 EXTRA_KCFLAGS="-Werror"
588 LB_LINUX_TRY_COMPILE([
589 #include <linux/sched.h>
590 #include <linux/fs_struct.h>
595 AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found])
599 EXTRA_KCFLAGS="$tmp_flags"
603 # LIBCFS_HAVE_IS_COMPAT_TASK
605 # Added in 2.6.17, it wasn't until 2.6.29 that all
606 # Linux architectures have is_compat_task()
608 AC_DEFUN([LIBCFS_HAVE_IS_COMPAT_TASK],
609 [AC_MSG_CHECKING([if is_compat_task() is declared])
610 LB_LINUX_TRY_COMPILE([
611 #include <linux/compat.h>
613 int 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>
631 unsigned long walkstack(struct thread_info *tinfo,
632 unsigned long *stack,
634 const struct stacktrace_ops *ops,
639 struct stacktrace_ops ops;
641 ops.walk_stack = walkstack;
644 AC_DEFINE(STACKTRACE_OPS_HAVE_WALK_STACK, 1, ['struct stacktrace_ops' has 'walk_stack' field])
651 # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
653 # 2.6.34 adds __add_wait_queue_exclusive
655 AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE],
656 [AC_MSG_CHECKING([if __add_wait_queue_exclusive exists])
657 LB_LINUX_TRY_COMPILE([
658 #include <linux/wait.h>
660 wait_queue_head_t queue;
663 __add_wait_queue_exclusive(&queue, &wait);
666 AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
667 [__add_wait_queue_exclusive exists])
673 # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function
674 AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR],
675 [AC_MSG_CHECKING([shrinker want self pointer in handler])
676 LB_LINUX_TRY_COMPILE([
677 #include <linux/mm.h>
680 tmp.shrink(NULL, 0, 0);
683 AC_DEFINE(HAVE_SHRINKER_WANT_SHRINK_PTR, 1,
684 [shrinker want self pointer in handler])
693 # LNet linux kernel checks
695 AC_DEFUN([LIBCFS_PROG_LINUX],
697 LIBCFS_FUNC_CPU_ONLINE
699 LIBCFS_CONFIG_PANIC_DUMPLOG
701 LIBCFS_FUNC_SHOW_TASK
702 LIBCFS_U64_LONG_LONG_LINUX
706 LIBCFS_HAVE_IS_COMPAT_TASK
709 LIBCFS_NLMSG_MULTICAST
710 LIBCFS_KMEM_CACHE_DESTROY_INT
711 LIBCFS_ATOMIC_PANIC_NOTIFIER
713 LIBCFS_3ARGS_INIT_WORK
715 LIBCFS_2ARGS_REGISTER_SYSCTL
718 LIBCFS_KMEM_CACHE_CREATE_DTOR
719 LIBCFS_NETLINK_CBMUTEX
722 LIBCFS_SYSCTL_UNNUMBERED
723 LIBCFS_SCATTERLIST_SETPAGE
724 LIBCFS_NL_BROADCAST_GFP
725 LIBCFS_NETWORK_NAMESPACE
727 LIBCFS_FUNC_DUMP_TRACE
733 LIBCFS_STRUCT_CRED_IN_TASK
735 LIBCFS_FUNC_UNSHARE_FS_STRUCT
736 LIBCFS_SOCK_MAP_FD_2ARG
738 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
739 LC_SHRINKER_WANT_SHRINK_PTR
741 LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
749 AC_DEFUN([LIBCFS_PROG_DARWIN],
750 [LB_DARWIN_CHECK_FUNCS([get_preemption_level])
754 # LIBCFS_PATH_DEFAULTS
756 # default paths for installed files
758 AC_DEFUN([LIBCFS_PATH_DEFAULTS],
765 # other configure checks
767 AC_DEFUN([LIBCFS_CONFIGURE],
768 [# lnet/utils/portals.c
769 AC_CHECK_HEADERS([asm/types.h endian.h sys/ioctl.h])
772 AC_CHECK_HEADERS([linux/version.h])
774 AC_CHECK_TYPE([spinlock_t],
775 [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
777 [#include <linux/spinlock.h>])
779 # lnet/utils/wirecheck.c
780 AC_CHECK_FUNCS([strnlen])
782 AC_CHECK_TYPE([umode_t],
783 [AC_DEFINE(HAVE_UMODE_T, 1, [umode_t is defined])],
785 [#include <asm/types.h>])
787 AC_CHECK_TYPE([__s8],
788 [AC_DEFINE(HAVE___S8, 1, [__s8 is defined])],
790 [#include <asm/types.h>])
792 AC_CHECK_TYPE([__u8],
793 [AC_DEFINE(HAVE___U8, 1, [__u8 is defined])],
795 [#include <asm/types.h>])
797 AC_CHECK_TYPE([__s16],
798 [AC_DEFINE(HAVE___S16, 1, [__s16 is defined])],
800 [#include <asm/types.h>])
802 AC_CHECK_TYPE([__u16],
803 [AC_DEFINE(HAVE___U16, 1, [__u16 is defined])],
805 [#include <asm/types.h>])
807 AC_CHECK_TYPE([__s32],
808 [AC_DEFINE(HAVE___S32, 1, [__s32 is defined])],
810 [#include <asm/types.h>])
812 AC_CHECK_TYPE([__u32],
813 [AC_DEFINE(HAVE___U32, 1, [__u32 is defined])],
815 [#include <asm/types.h>])
817 AC_CHECK_TYPE([__u64],
818 [AC_DEFINE(HAVE___U64, 1, [__u64 is defined])],
820 [#include <asm/types.h>])
822 AC_CHECK_TYPE([__s64],
823 [AC_DEFINE(HAVE___S64, 1, [__s64 is defined])],
825 [#include <asm/types.h>])
827 # check userland __u64 type
828 AC_MSG_CHECKING([userspace __u64 is long long type])
830 CFLAGS="$CFLAGS -Werror"
833 #include <linux/types.h>
834 #include <linux/stddef.h>
836 unsigned long long *data1;
844 AC_DEFINE(HAVE_USER__U64_LONG_LONG, 1,
845 [__u64 is long long type])
851 # -------- Check for required packages --------------
854 AC_MSG_CHECKING([if efence debugging support is requested])
855 AC_ARG_ENABLE(efence,
856 AC_HELP_STRING([--enable-efence],
857 [use efence library]),
858 [],[enable_efence='no'])
859 AC_MSG_RESULT([$enable_efence])
860 if test "$enable_efence" = "yes" ; then
862 AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
869 # -------- check for -lpthread support ----
870 AC_MSG_CHECKING([whether to use libpthread for libcfs library])
871 AC_ARG_ENABLE([libpthread],
872 AC_HELP_STRING([--disable-libpthread],
873 [disable libpthread]),
874 [],[enable_libpthread=yes])
875 if test "$enable_libpthread" = "yes" ; then
876 AC_CHECK_LIB([pthread], [pthread_create],
877 [ENABLE_LIBPTHREAD="yes"],
878 [ENABLE_LIBPTHREAD="no"])
879 if test "$ENABLE_LIBPTHREAD" = "yes" ; then
880 AC_MSG_RESULT([$ENABLE_LIBPTHREAD])
881 PTHREAD_LIBS="-lpthread"
882 AC_DEFINE([HAVE_LIBPTHREAD], 1, [use libpthread])
885 AC_MSG_RESULT([no libpthread is found])
887 AC_SUBST(PTHREAD_LIBS)
889 AC_MSG_RESULT([no (disabled explicitly)])
890 ENABLE_LIBPTHREAD="no"
892 AC_SUBST(ENABLE_LIBPTHREAD)
898 # LIBCFS_CONDITIONALS
900 # AM_CONDITOINAL defines for lnet
902 AC_DEFUN([LIBCFS_CONDITIONALS],
907 # LIBCFS_CONFIG_FILES
909 # files that should be generated with AC_OUTPUT
911 AC_DEFUN([LIBCFS_CONFIG_FILES],
916 libcfs/autoconf/Makefile
917 libcfs/include/Makefile
918 libcfs/include/libcfs/Makefile
919 libcfs/include/libcfs/linux/Makefile
920 libcfs/include/libcfs/posix/Makefile
921 libcfs/include/libcfs/util/Makefile
922 libcfs/libcfs/Makefile
923 libcfs/libcfs/autoMakefile
924 libcfs/libcfs/linux/Makefile
925 libcfs/libcfs/posix/Makefile
926 libcfs/libcfs/util/Makefile
927 libcfs/include/libcfs/darwin/Makefile
928 libcfs/libcfs/darwin/Makefile