Whamcloud - gitweb
merge b_devel into HEAD, which will become 0.7.3
[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 # Directories for documentation and demos.
20 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
21 AC_SUBST(docdir)
22 demodir='$(docdir)/demo'
23 AC_SUBST(demodir)
24 pkgexampledir='${prefix}/usr/lib/$(PACKAGE)/examples'
25 AC_SUBST(pkgexampledir)
26 pymoddir='${prefix}/usr/lib/${PACKAGE}/python/Lustre'
27 AC_SUBST(pymoddir)
28 modulenetdir='$(moduledir)/net/$(PACKAGE)'
29 AC_SUBST(modulenetdir)
30
31
32 # ----------  BAD gcc? ------------
33 AC_PROG_RANLIB
34 AC_PROG_CC
35 AC_MSG_CHECKING(for buggy compiler)
36 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
37 bad_cc() {
38         echo
39         echo "   '$CC_VERSION'"
40         echo "  has been known to generate bad code, "
41         echo "  please get an updated compiler."
42         AC_MSG_ERROR(sorry)
43 }
44 TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
45 if test "$TMP_VERSION" = "gcc version 2.95"; then
46         bad_cc
47 fi
48 case "$CC_VERSION" in 
49         # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
50         # without "sub    $0xc,%esp" to protect the stack from being
51         # stomped on by interrupts (bug 606)
52         "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
53                 bad_cc
54                 ;;
55         # mandrake's similar sub 0xc compiler bug
56         # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2
57         "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)")
58                 bad_cc
59                 ;;
60         *)
61                 AC_MSG_RESULT(no known problems)
62                 ;;
63 esac
64 # end ------  BAD gcc? ------------
65
66 # --------  Check for required packages  --------------
67
68 # this doesn't seem to work on older autoconf
69 # AC_CHECK_LIB(readline, readline,,)
70 AC_ARG_ENABLE(readline, [  --enable-readline  use readline library],,
71                         enable_readline="yes")
72  
73 if test "$enable_readline" = "yes" ; then
74    LIBREADLINE="-lreadline -lncurses"
75    HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
76 else 
77    LIBREADLINE=""
78    HAVE_LIBREADLINE=""
79 fi
80 AC_SUBST(LIBREADLINE)
81 AC_SUBST(HAVE_LIBREADLINE)
82
83 AC_ARG_ENABLE(efence,  [  --enable-efence  use efence library],,
84                         enable_efence="no")
85  
86 if test "$enable_efence" = "yes" ; then
87    LIBEFENCE="-lefence"
88    HAVE_LIBEFENCE="-DHAVE_LIBEFENCE=1"
89 else 
90    LIBEFENCE=""
91    HAVE_LIBEFENCE=""
92 fi
93 AC_SUBST(LIBEFENCE)
94 AC_SUBST(HAVE_LIBEFENCE)
95