Whamcloud - gitweb
f15839671035014d872fcfb04731afc286ee5293
[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         # unpatched 'gcc' on rh9.  miscompiles a
65         #        struct = (type) { .member = value, };
66         # asignment in the iibnal where the struct is a mix
67         # of u64 and u32 bit-fields.
68         "gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)")
69                 bad_cc
70                 ;;
71         *)
72                 AC_MSG_RESULT([no known problems])
73                 ;;
74 esac
75 # end ------  BAD gcc? ------------
76
77 # --------  Check for required packages  --------------
78
79 # this doesn't seem to work on older autoconf
80 # AC_CHECK_LIB(readline, readline,,)
81 AC_MSG_CHECKING([for readline support])
82 AC_ARG_ENABLE(readline,
83         AC_HELP_STRING([--disable-readline],
84                         [do not use readline library]),
85         [],[enable_readline='yes'])
86 AC_MSG_RESULT([$enable_readline]) 
87 if test x$enable_readline = xyes ; then
88         LIBREADLINE="-lreadline -lncurses"
89         AC_DEFINE(HAVE_LIBREADLINE, 1, [readline library is available])
90 else 
91         LIBREADLINE=""
92 fi
93 AC_SUBST(LIBREADLINE)
94
95 AC_MSG_CHECKING([if efence debugging support is requested])
96 AC_ARG_ENABLE(efence,
97         AC_HELP_STRING([--enable-efence],
98                         [use efence library]),
99         [],[enable_efence='no'])
100 AC_MSG_RESULT([$enable_efence])
101 if test "$enable_efence" = "yes" ; then
102         LIBEFENCE="-lefence"
103         AC_DEFINE(HAVE_LIBEFENCE, 1, [libefence support is requested])
104 else 
105         LIBEFENCE=""
106 fi
107 AC_SUBST(LIBEFENCE)
108
109 # -------- enable acceptor libwrap (TCP wrappers) support? -------
110 AC_MSG_CHECKING([if libwrap support is requested])
111 AC_ARG_ENABLE([libwrap],
112         AC_HELP_STRING([--enable-libwrap], [use TCP wrappers]),
113         [case "${enableval}" in
114                 yes) enable_libwrap=yes ;;
115                 no) enable_libwrap=no ;;
116                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
117         esac],[enable_libwrap=no])
118 AC_MSG_RESULT([$enable_libwrap])
119 if test x$enable_libwrap = xyes ; then
120         LIBWRAP="-lwrap"
121         AC_DEFINE(HAVE_LIBWRAP, 1, [libwrap support is requested])
122 else
123         LIBWRAP=""
124 fi
125 AC_SUBST(LIBWRAP)
126
127 AC_SUBST(LIBS)