Whamcloud - gitweb
Merge b_md into HEAD
[fs/lustre-release.git] / lustre / configure.in
1 AC_INIT
2 AC_CANONICAL_SYSTEM
3
4 # Copyright (C) 2001-2003 Cluster File Systems, Inc.
5 #
6 # This code is issued under the GNU General Public License.
7 # See the file COPYING in this distribution
8
9 # Automake variables.  Steal the version number from lustre.spec.in.
10 AM_INIT_AUTOMAKE(lustre, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
11 #AM_MAINTAINER_MODE
12
13 AC_PROG_CC
14 AC_MSG_CHECKING(for buggy compiler)
15 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
16 bad_cc() {
17         echo
18         echo "   '$CC_VERSION'"
19         echo "  has been known to generate bad code, "
20         echo "  please get an updated compiler."
21         AC_MSG_ERROR(sorry)
22 }
23 case "$CC_VERSION" in 
24         # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
25         # without "sub    $0xc,%esp" to protect the stack from being
26         # stomped on by interrupts (bug 606)
27         "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
28                 bad_cc
29                 ;;
30         *)
31                 AC_MSG_RESULT(no known problems)
32                 ;;
33 esac
34
35 AC_PROG_RANLIB
36
37
38 # Check for required packages
39
40 # this doesn't seem to work on older autoconf
41 # AC_CHECK_LIB(readline, readline,,)
42
43 AC_ARG_ENABLE(readline, [  --enable-readline  use readline library],,
44                         enable_readline="yes")
45  
46 if test "$enable_readline" = "yes" ; then
47    LIBREADLINE="-lreadline -lncurses"
48    HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
49 else 
50    LIBREADLINE=""
51    HAVE_LIBREADLINE=""
52 fi
53 AC_SUBST(LIBREADLINE)
54 AC_SUBST(HAVE_LIBREADLINE)
55
56 # Kernel build environment.
57 ac_default_prefix=
58 bindir='${exec_prefix}/usr/bin'
59 sbindir='${exec_prefix}/usr/sbin'
60
61 linuxdir_def=/usr/src/linux
62 AC_ARG_WITH(linux, [  --with-linux=[path] set path to Linux source (default=/usr/src/linux)], enable_linuxdir=$withval)
63 AC_ARG_ENABLE(linuxdir, [  --enable-linuxdir=[path] (deprecated) set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
64
65 LINUX=$enable_linuxdir
66 AC_SUBST(LINUX)
67
68 sinclude(archdep.m4)
69
70 AC_MSG_CHECKING(if you are running linux 2.5...)
71 if test -e $LINUX/include/linux/namei.h ; then
72         linux25=yes
73         AC_MSG_RESULT(yes)
74 else
75         linux25=no
76         AC_MSG_RESULT(no)
77 fi
78 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
79
80 # Changed by Amrut Joshi on 01/13/2003
81 #KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
82 KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
83 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
84
85 portalsdir_def='$(top_srcdir)/../portals'
86 AC_ARG_WITH(portals, [  --with-portals=[path] set path to Portals source (default=../portals)], enable_portalsdir=$withval)
87 AC_ARG_ENABLE(portalsdir, [  --enable-portalsdir=[path] (deprecated) set path to Portals source (default=$portalsdir_def],, enable_portalsdir=$portalsdir_def)
88 PORTALS=$enable_portalsdir
89
90 if test $PORTALS = $portalsdir_def; then
91         PORTALSLOC='../portals'
92 else
93         PORTALSLOC=$PORTALS
94 fi
95
96 AC_SUBST(PORTALS)
97 AC_SUBST(PORTALSLOC)
98
99 portalslib_def=$enable_portalsdir/linux/utils
100 AC_ARG_WITH(portalslib, [  --with-portalslib=[path] set path to Portals library (default=../portals/linux/utils)], enable_portalslib=$withval)
101 AC_ARG_ENABLE(portalslib, [  --enable-portalslib=[path] (deprecated) set path to Portals lib (default=../portals/linux/utils)],, enable_portalslib=$portalslib_def)
102
103
104 if ! test -z "$enable_portalslib"; then
105         PORTALSLIB=${enable_portalslib}
106 fi
107
108
109 AC_SUBST(PORTALSLIB)
110
111 AC_MSG_CHECKING(if make dep has been run in kernel source)
112 if test -f $LINUX/include/linux/config.h ; then
113         AC_MSG_RESULT(yes)
114 else
115         AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
116 fi
117
118 AC_MSG_CHECKING(if autoconf.h is in kernel source)
119 if test -f $LINUX/include/linux/autoconf.h ; then
120         AC_MSG_RESULT(yes)
121 else
122         AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
123 fi
124
125
126 AC_MSG_CHECKING(for Linux release)
127
128 dnl We need to rid ourselves of the nasty [ ] quotes.
129 changequote(, )
130 dnl Get release from version.h
131 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
132 changequote([, ])
133
134 moduledir='$(libdir)/modules/'$RELEASE/kernel
135 AC_SUBST(moduledir)
136
137 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
138 AC_SUBST(modulefsdir)
139
140 AC_MSG_RESULT($RELEASE)
141 AC_SUBST(RELEASE)
142
143 # Directories for documentation and demos.
144 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
145 AC_SUBST(docdir)
146
147 demodir='$(docdir)/demo'
148 AC_SUBST(demodir)
149
150 # not needed until the AC_CHECK_LIB(readline) above works
151 # AM_CONFIG_HEADER(include/config.h)
152
153 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
154         lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
155         cobd/Makefile ptlbd/Makefile conf/Makefile \
156         utils/Makefile utils/lconf tests/Makefile obdfilter/Makefile \
157         obdclass/Makefile llite/Makefile doc/Makefile scripts/Makefile \
158         scripts/lustre.spec extN/Makefile, chmod +x utils/lconf)