Whamcloud - gitweb
- move the peter branch changes to the head
[fs/lustre-release.git] / lustre / configure.in
1 AC_INIT
2 AC_CANONICAL_SYSTEM
3
4 # Copyright (C) 2001  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 AC_PROG_CC
13 AC_PROG_RANLIB
14
15
16 # Check for required packages
17
18 AC_PATH_PROG([XML2_CONFIG], [xml2-config], [],)
19 if test -z "$XML2_CONFIG"; then
20         AC_MSG_ERROR([xml2-config not found; libxml2-dev libraries must be installed.])
21 fi
22 XML2_CFLAGS=$($XML2_CONFIG --cflags)
23 XML2_LIBS=$($XML2_CONFIG --libs)
24 AC_SUBST(XML2_CFLAGS)
25 AC_SUBST(XML2_LIBS)
26
27 # this doesn't seem to work on older autoconf
28 # AC_CHECK_LIB(readline, readline,,)
29
30 AC_ARG_ENABLE(readline, [  --enable-readline  use readline library],,
31                         enable_readline="yes")
32  
33 if test "$enable_readline" = "yes" ; then
34    LIBREADLINE="-lreadline -lncurses"
35    HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
36 else 
37    LIBREADLINE=""
38    HAVE_LIBREADLINE=""
39 fi
40 AC_SUBST(LIBREADLINE)
41 AC_SUBST(HAVE_LIBREADLINE)
42
43 # Kernel build environment.
44 ac_default_prefix=
45 bindir='${exec_prefix}/usr/bin'
46 sbindir='${exec_prefix}/usr/sbin'
47
48 linuxdir_def=/usr/src/linux
49 AC_ARG_ENABLE(linuxdir, [  --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
50
51 LINUX=$enable_linuxdir
52 AC_SUBST(LINUX)
53
54 sinclude(archdep.m4)
55
56 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
57 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
58
59 portalsdir_def='$(top_srcdir)/../portals'
60 AC_ARG_ENABLE(portalsdir, [  --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
61 PORTALS=$enable_portalsdir
62 AC_SUBST(PORTALS)
63
64 AC_MSG_CHECKING(if make dep has been run in kernel source)
65 if test -f $LINUX/include/linux/config.h ; then
66         AC_MSG_RESULT(yes)
67 else
68         AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
69 fi
70
71 AC_MSG_CHECKING(if autoconf.h is in kernel source)
72 if test -f $LINUX/include/linux/autoconf.h ; then
73         AC_MSG_RESULT(yes)
74 else
75         AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
76 fi
77
78
79 AC_MSG_CHECKING(for Linux release)
80
81 dnl We need to rid ourselves of the nasty [ ] quotes.
82 changequote(, )
83 dnl Get release from version.h
84 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
85 changequote([, ])
86
87 moduledir='$(libdir)/modules/'$RELEASE/kernel
88 AC_SUBST(moduledir)
89
90 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
91 AC_SUBST(modulefsdir)
92
93 AC_MSG_RESULT($RELEASE)
94 AC_SUBST(RELEASE)
95
96 # Directories for documentation and demos.
97 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
98 AC_SUBST(docdir)
99
100 demodir='$(docdir)/demo'
101 AC_SUBST(demodir)
102
103 # not needed until the AC_CHECK_LIB(readline) above works
104 # AM_CONFIG_HEADER(include/config.h)
105
106 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile \
107          obdecho/Makefile ptlrpc/Makefile \
108         lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
109         tests/Makefile obdfilter/Makefile obdclass/Makefile \
110         llite/Makefile obdfs/Makefile demos/Makefile \
111         doc/Makefile scripts/Makefile scripts/lustre.spec \
112         extN/Makefile)