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