Whamcloud - gitweb
landing b_cmobd_merge on HEAD
[fs/lustre-release.git] / lustre / portals / 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=
19 bindir='${exec_prefix}/usr/bin'
20 sbindir='${exec_prefix}/usr/sbin'
21 includedir='${prefix}/usr/include'
22
23 rootsbindir='${exec_prefix}/sbin'
24 AC_SUBST(rootsbindir)
25
26 # Directories for documentation and demos.
27 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
28 AC_SUBST(docdir)
29 demodir='$(docdir)/demo'
30 AC_SUBST(demodir)
31 pkgexampledir='${prefix}/usr/lib/$(PACKAGE)/examples'
32 AC_SUBST(pkgexampledir)
33 pymoddir='${prefix}/usr/lib/${PACKAGE}/python/Lustre'
34 AC_SUBST(pymoddir)
35 # for substitution in lconf
36 PYMOD_DIR="/usr/lib/$PACKAGE/python"
37 AC_SUBST(PYMOD_DIR)
38 modulenetdir='$(moduledir)/net/$(PACKAGE)'
39 AC_SUBST(modulenetdir)
40
41
42 # ----------  BAD gcc? ------------
43 AC_PROG_RANLIB
44 AC_PROG_CC
45 AC_MSG_CHECKING([for buggy compiler])
46 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
47 bad_cc() {
48         AC_MSG_RESULT([buggy compiler found!])
49         echo
50         echo "   '$CC_VERSION'"
51         echo "  has been known to generate bad code, "
52         echo "  please get an updated compiler."
53         AC_MSG_ERROR([sorry])
54 }
55 TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
56 if test "$TMP_VERSION" = "gcc version 2.95"; then
57         bad_cc
58 fi
59 case "$CC_VERSION" in 
60         # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
61         # without "sub    $0xc,%esp" to protect the stack from being
62         # stomped on by interrupts (bug 606)
63         "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
64                 bad_cc
65                 ;;
66         # mandrake's similar sub 0xc compiler bug
67         # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2
68         "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)")
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)