Whamcloud - gitweb
- landing of b_hd_cleanup_merge to HEAD.
[fs/lustre-release.git] / lnet / build.m4
1 # ----------  other tests and settings ---------
2
3 AC_CHECK_TYPE([spinlock_t],
4         [AC_DEFINE(HAVE_SPINLOCK_T, 1, [spinlock_t is defined])],
5         [],
6         [#include <linux/spinlock.h>])
7
8 # ---------  unsigned long long sane? -------
9
10 AC_CHECK_SIZEOF(unsigned long long, 0)
11 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
12 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
13 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
14         AC_MSG_ERROR([** we assume that sizeof(long long) == 8.  Tell phil@clusterfs.com])
15 fi
16
17 # directories for binaries
18 ac_default_prefix=/usr
19
20 # mount.lustre
21 rootsbindir='/sbin'
22 AC_SUBST(rootsbindir)
23 sysconfdir='/etc'
24 AC_SUBST(sysconfdir)
25 # Directories for documentation and demos.
26 docdir='${datadir}/doc/$(PACKAGE)'
27 AC_SUBST(docdir)
28 demodir='$(docdir)/demo'
29 AC_SUBST(demodir)
30 pkgexampledir='${pkgdatadir}/examples'
31 AC_SUBST(pkgexampledir)
32 pymoddir='${pkglibdir}/python/Lustre'
33 AC_SUBST(pymoddir)
34
35 # ----------  BAD gcc? ------------
36 AC_PROG_RANLIB
37 AC_PROG_CC
38 AC_MSG_CHECKING([for buggy compiler])
39 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
40 bad_cc() {
41         AC_MSG_RESULT([buggy compiler found!])
42         echo
43         echo "   '$CC_VERSION'"
44         echo "  has been known to generate bad code, "
45         echo "  please get an updated compiler."
46         AC_MSG_ERROR([sorry])
47 }
48 TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
49 if test "$TMP_VERSION" = "gcc version 2.95"; then
50         bad_cc
51 fi
52 case "$CC_VERSION" in 
53         # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
54         # without "sub    $0xc,%esp" to protect the stack from being
55         # stomped on by interrupts (bug 606)
56         "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
57                 bad_cc
58                 ;;
59         # mandrake's similar sub 0xc compiler bug
60         # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2
61         "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)")
62                 bad_cc
63                 ;;
64         *)
65                 AC_MSG_RESULT([no known problems])
66                 ;;
67 esac
68 # end ------  BAD gcc? ------------
69
70 # --------  Check for required packages  --------------
71
72 # this doesn't seem to work on older autoconf
73 # AC_CHECK_LIB(readline, readline,,)
74 AC_MSG_CHECKING([for readline support])
75 AC_ARG_ENABLE(readline,
76         AC_HELP_STRING([--disable-readline],
77                         [do not use readline library]),
78         [],[enable_readline='yes'])
79 AC_MSG_RESULT([$enable_readline]) 
80 if test x$enable_readline = xyes ; then
81         LIBREADLINE="-lreadline -lncurses"
82         AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
83 else 
84         LIBREADLINE=""
85 fi
86 AC_SUBST(LIBREADLINE)
87
88 AC_MSG_CHECKING([if efence debugging support is requested])
89 AC_ARG_ENABLE(efence,
90         AC_HELP_STRING([--enable-efence],
91                         [use efence library]),
92         [],[enable_efence='no'])
93 AC_MSG_RESULT([$enable_efence])
94 if test "$enable_efence" = "yes" ; then
95         LIBEFENCE="-lefence"
96         AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
97 else 
98         LIBEFENCE=""
99 fi
100 AC_SUBST(LIBEFENCE)
101
102 # -------- enable acceptor libwrap (TCP wrappers) support? -------
103 AC_MSG_CHECKING([if libwrap support is requested])
104 AC_ARG_ENABLE([libwrap],
105         AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
106         [case "${enableval}" in
107                 yes) enable_libwrap=yes ;;
108                 no) enable_libwrap=no ;;
109                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
110         esac],[enable_libwrap=no])
111 AC_MSG_RESULT([$enable_libwrap])
112 if test x$enable_libwrap = xyes ; then
113         LIBWRAP="-lwrap"
114         AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
115 else
116         LIBWRAP=""
117 fi
118 AC_SUBST(LIBWRAP)