Whamcloud - gitweb
Initial lustretop import
[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(obd, 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 # Kernel build environment.
16 ac_default_prefix=
17 bindir='${exec_prefix}/usr/bin'
18 sbindir='${exec_prefix}/usr/sbin'
19
20 linuxdir_def=/usr/src/linux
21 AC_ARG_ENABLE(linuxdir, [  --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
22
23 LINUX=$enable_linuxdir
24 AC_SUBST(LINUX)
25
26 sinclude(archdep.m4)
27
28 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
29 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
30
31 portalsdir_def='$(top_srcdir)/../portals'
32 AC_ARG_ENABLE(portalsdir, [  --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
33 PORTALS=$enable_portalsdir
34 AC_SUBST(PORTALS)
35
36 AC_MSG_CHECKING(if make dep has been run in kernel source)
37 if test -f $LINUX/include/linux/config.h ; then
38         AC_MSG_RESULT(yes)
39 else
40         AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
41 fi
42
43 AC_MSG_CHECKING(if autoconf.h is in kernel source)
44 if test -f $LINUX/include/linux/autoconf.h ; then
45         AC_MSG_RESULT(yes)
46 else
47         AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
48 fi
49
50
51 AC_MSG_CHECKING(for Linux release)
52
53 dnl We need to rid ourselves of the nasty [ ] quotes.
54 changequote(, )
55 LVERSION="`sed -ne 's/^VERSION[         ]*=[    ]*//gp' $LINUX/Makefile`"
56 PATCHLEVEL="`sed -ne 's/^PATCHLEVEL[    ]*=[    ]*//gp' $LINUX/Makefile`"
57 SUBLEVEL="`sed -ne 's/^SUBLEVEL[        ]*=[    ]*//gp' $LINUX/Makefile`"
58 EXTRAVERSION="`sed -ne 's/^EXTRAVERSION[        ]*=[    ]*//gp' $LINUX/Makefile`"
59 changequote([, ])
60
61 RELEASE="$LVERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
62 moduledir='$(libdir)/modules/'$RELEASE
63 AC_SUBST(moduledir)
64 AC_SUBST(EXTRAVERSION)
65
66 modulefsdir='$(moduledir)/fs'
67 AC_SUBST(modulefsdir)
68
69 AC_MSG_RESULT($RELEASE)
70 AC_SUBST(RELEASE)
71
72 # Directories for documentation and demos.
73 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
74 AC_SUBST(docdir)
75
76 demodir='$(docdir)/demo'
77 AC_SUBST(demodir)
78
79 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile rpc/Makefile \
80         osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
81         tests/Makefile filterobd/Makefile class/Makefile ext2obd/Makefile \
82         llight/Makefile obdfs/Makefile obdtrace/Makefile demos/Makefile \
83         snap/Makefile doc/Makefile scripts/Makefile scripts/lustre.spec \
84         extN/Makefile)