Whamcloud - gitweb
b=19674
[fs/lustre-release.git] / ldiskfs / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 AC_INIT([Lustre ldiskfs], 3.0.9, [https://bugzilla.lustre.org/])
4 AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
5
6 # Don't look for install-sh, etc. in ..
7 AC_CONFIG_AUX_DIR([.])
8
9 AC_CANONICAL_SYSTEM
10
11 AM_INIT_AUTOMAKE
12
13 AC_PROG_CC
14
15 LB_CANONICAL_SYSTEM
16 LB_INCLUDE_RULES
17 LB_PROG_CC
18
19
20 #
21 # LC_TARGET_SUPPORTED
22 #
23 # is the target os supported?
24 #
25 AC_DEFUN([LC_TARGET_SUPPORTED],
26 [case $target_os in
27         linux* | darwin*)
28 $1
29                 ;;
30         *)
31 $2
32                 ;;
33 esac
34 ])
35
36 AC_DEFUN([LC_KERNEL_WITH_EXT4],
37 [if test -f $LINUX/fs/ext4/ext4.h ; then
38 $1
39 else
40 $2
41 fi
42 ])
43
44 AC_MSG_CHECKING([whether to build kernel modules])
45 AC_ARG_ENABLE([modules],
46               AC_HELP_STRING([--disable-modules],
47                              [disable building of Lustre kernel modules]),[],
48                              [LC_TARGET_SUPPORTED([enable_modules='yes'],
49                              [enable_modules='no'])])
50 AC_MSG_RESULT([$enable_modules])
51
52 if test x$enable_modules = xyes ; then
53         LB_PROG_LINUX
54 if test x$linux25 = xyes ; then
55         LB_LINUX_MODPOST
56 fi
57 fi
58
59 LB_CONFIG_HEADERS
60
61 # These allow Lustre Makefiles and autoMakefiles to be used unchanged.
62 AM_CONDITIONAL(MODULES, true)
63 AM_CONDITIONAL(LINUX, true)
64 AM_CONDITIONAL(DARWIN, true)
65 AM_CONDITIONAL(LINUX25, true)
66
67 LDISKFSDIR="$PWD/ldiskfs"
68 AC_SUBST(LDISKFSDIR)
69
70 AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
71 AC_ARG_ENABLE([quilt],
72               AC_HELP_STRING([--disable-quilt],
73                              [disable use of quilt for ldiskfs]),[],
74                              [enable_quilt='yes'])
75 AC_MSG_RESULT([$enable_quilt])
76
77 AC_PATH_PROG(PATCH, patch, [no])
78
79 if test x$enable_quilt = xno ; then
80     QUILT="no"
81 else
82     AC_PATH_PROG(QUILT, quilt, [no])
83 fi
84
85 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
86         AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
87 fi
88
89 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
90
91 LB_DEFINE_LDISKFS_OPTIONS
92
93 AC_MSG_CHECKING([whether to build ldisk based on ext4])
94 AC_ARG_ENABLE([ext4],
95               AC_HELP_STRING([--disable-ext4],
96                              [enable building of ldiskfs based on ext4]),[],
97                              [LC_KERNEL_WITH_EXT4([enable_ext4='yes'],
98                              [enable_ext4='no'])])
99 AC_MSG_RESULT([$enable_ext4])
100
101 # Remove this part when RHEL5 ext4 patches landed.
102 case $LINUXRELEASE in
103 2.6.18*) if test x$RHEL_KENEL = xyes; then
104         enable_ext4=no
105         fi
106 ;;
107 esac
108
109 if test x$enable_ext4 = xyes ; then
110         AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [ldiskfs based on ext4])
111         BACKFS=ext4
112 else
113         BACKFS=ext3
114 fi
115 AC_SUBST(BACKFS)
116 BACKFSU=${BACKFS/ext/EXT}
117 AC_SUBST(BACKFSU) # We need a Upper string
118
119 AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
120
121 AC_MSG_CHECKING([which ldiskfs series to use])
122 case $LINUXRELEASE in
123 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
124 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
125 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
126 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
127 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
128 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
129 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
130 2.6.18*)
131         if test x$RHEL_KENEL = xyes; then
132                 if test x$enable_ext4 = xyes; then
133                         LDISKFS_SERIES="2.6-rhel5-ext4.series"
134                 else
135                         LDISKFS_SERIES="2.6-rhel5.series"
136                 fi
137         else
138                 LDISKFS_SERIES="2.6.18-vanilla.series"
139         fi
140         ;;
141 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
142 2.6.27*) LDISKFS_SERIES="2.6-sles11.series";;
143 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
144 esac
145 AC_MSG_RESULT([$LDISKFS_SERIES])
146 AC_SUBST(LDISKFS_SERIES)
147
148 AC_SUBST(ac_configure_args)
149
150 LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
151                        [fs/dcache.c],
152                        [AC_DEFINE(HAVE_D_REHASH_COND, 1,
153                                   [d_rehash_cond is exported by the kernel])],
154                                   [])
155
156 LB_CHECK_SYMBOL_EXPORT([__d_rehash],
157                        [fs/dcache.c],
158                        [AC_DEFINE(HAVE___D_REHASH, 1,
159                                   [__d_rehash is exported by the kernel])],
160                                   [])
161
162 LB_CHECK_SYMBOL_EXPORT([d_move_locked],
163                        [fs/dcache.c],
164                        [AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
165                                   [d_move_locked is exported by the kernel])],
166                                   [])
167
168 LB_CHECK_SYMBOL_EXPORT([__d_move],
169                        [fs/dcache.c],
170                        [AC_DEFINE(HAVE___D_MOVE, 1,
171                                   [__d_move exported by the kernel])],
172                                   [])
173
174 LB_CONFIG_FILES
175 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
176
177 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
178 AC_SUBST(MOSTLYCLEANFILES)
179
180 AC_OUTPUT