1 AC_DEFUN([LDISKFS_LINUX_SERIES],
4 AC_MSG_CHECKING([which ldiskfs series to use])
7 AS_IF([test x$RHEL_KERNEL = xyes], [
8 AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32-343],[
9 AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32],[],
10 [SER="2.6-rhel6.series"],[SER="2.6-rhel6.series"])],
11 [SER="2.6-rhel6.4.series"],[SER="2.6-rhel6.4.series"])
12 ], [test x$SUSE_KERNEL = xyes], [
13 AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
14 AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
15 [SER="2.6-sles11.series"],[SER="2.6-sles11.series"])],
16 [SER="3.0-sles11.series"],[SER="3.0-sles11.series"])
20 AS_IF([test -z "$LDISKFS_SERIES"],
21 [AC_MSG_WARN([Unknown kernel version $LDISKFS_VERSIONRELEASE])])
22 AC_MSG_RESULT([$LDISKFS_SERIES])
24 AC_SUBST(LDISKFS_SERIES)
28 # 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
30 AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD],
31 [AC_MSG_CHECKING([if ext4_free_blocks needs struct buffer_head])
32 LB_LINUX_TRY_COMPILE([
34 #include "$EXT4_SRC_DIR/ext4.h"
36 ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
39 AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
40 [ext4_free_blocks do not require struct buffer_head])
47 # 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
49 AC_DEFUN([LB_EXT_PBLOCK],
50 [AC_MSG_CHECKING([if kernel has ext_pblocks])
51 LB_LINUX_TRY_COMPILE([
53 #include "$EXT4_SRC_DIR/ext4_extents.h"
58 AC_DEFINE(HAVE_EXT_PBLOCK, 1,
59 [kernel has ext_pblocks])
66 # LDISKFS_AC_PATCH_PROGRAM
68 # Determine which program should be used to apply the patches to
69 # the ext4 source code to produce the ldiskfs source code.
71 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
72 AC_ARG_ENABLE([quilt],
73 [AC_HELP_STRING([--disable-quilt],
74 [disable use of quilt for ldiskfs])],
75 [AS_IF([test "x$enableval" = xno],
81 AS_IF([test x$use_quilt = xmaybe], [
82 AC_PATH_PROG([quilt_avail], [quilt], [no])
83 AS_IF([test x$quilt_avail = xno], [
90 AS_IF([test x$use_quilt = xno], [
91 AC_PATH_PROG([patch_avail], [patch], [no])
92 AS_IF([test x$patch_avail = xno], [
93 AC_MSG_ERROR([*** Need "quilt" or "patch" command])
99 # LB_CONDITIONAL_LDISKFS
101 AC_DEFUN([LB_CONFIG_LDISKFS],
103 # --with-ldiskfs is deprecated now that ldiskfs is fully merged with lustre.
104 # However we continue to support this option through Lustre 2.5.
105 AC_ARG_WITH([ldiskfs],
107 [AC_MSG_WARN([--with-ldiskfs is deprecated, please use --enable-ldiskfs])
108 AS_IF([test x$withval != xyes -a x$withval != xno],
109 [AC_MSG_ERROR([the ldiskfs option is deprecated, and
110 no longer supports paths to external ldiskfs source])])
114 AC_ARG_ENABLE([ldiskfs],
115 [AS_HELP_STRING([--disable-ldiskfs],
116 [disable ldiskfs osd (default is enable)])],
117 [AS_IF([test x$enable_ldiskfs != xyes -a x$enable_ldiskfs != xno],
118 [AC_MSG_ERROR([ldiskfs valid options are "yes" or "no"])])],
119 [AS_IF([test "${with_ldiskfs+set}" = set],
120 [enable_ldiskfs=$with_ldiskfs],
121 [enable_ldiskfs=maybe])
125 AS_IF([test x$enable_server = xno],
126 [AS_CASE([$enable_ldiskfs],
127 [maybe], [enable_ldiskfs=no],
128 [yes], [AC_MSG_ERROR([cannot build ldiskfs when servers are disabled])]
132 AS_IF([test x$enable_ldiskfs != xno],[
133 # In the future, we chould change enable_ldiskfs from maybe to
134 # either yes or no based on additional tests, e.g. whether a patch
135 # set is available for the detected kernel. For now, we just always
137 AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes])
140 LDISKFS_AC_PATCH_PROGRAM
142 LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
144 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
145 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
146 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
147 AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
148 AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
151 AC_MSG_CHECKING([whether to build ldiskfs])
152 AC_MSG_RESULT([$enable_ldiskfs])
154 AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes])
158 # LB_VALIDATE_EXT4_SRC_DIR
160 # Spot check the existance of several source files common to ext4.
161 # Detecting this at configure time allows us to avoid a potential build
162 # failure and provide a useful error message to explain what is wrong.
164 AC_DEFUN([LB_VALIDATE_EXT4_SRC_DIR],
166 if test x$EXT4_SRC_DIR = x; then
167 enable_ldiskfs_build='no'
169 LB_CHECK_FILE([$EXT4_SRC_DIR/dir.c], [], [
170 enable_ldiskfs_build='no'
171 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
172 LB_CHECK_FILE([$EXT4_SRC_DIR/file.c], [], [
173 enable_ldiskfs_build='no'
174 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
175 LB_CHECK_FILE([$EXT4_SRC_DIR/inode.c], [], [
176 enable_ldiskfs_build='no'
177 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
178 LB_CHECK_FILE([$EXT4_SRC_DIR/super.c], [], [
179 enable_ldiskfs_build='no'
180 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
183 if test x$enable_ldiskfs_build = xno; then
188 Disabling ldiskfs support because complete ext4 source does not exist.
190 If you are building using kernel-devel packages and require ldiskfs
191 server support then ensure that the matching kernel-debuginfo-common
192 and kernel-debuginfo-common-<arch> packages are installed.
202 # Determine the location of the ext4 source code. It it required
203 # for several configure tests and to build ldiskfs.
205 AC_DEFUN([LB_EXT4_SRC_DIR],
207 # Kernel ext source located with devel headers
209 if test -e "$linux_src/fs/ext4/super.c"; then
210 EXT4_SRC_DIR=$linux_src/fs/ext4
212 # Kernel ext source provided by kernel-debuginfo-common package
213 linux_src=$(ls -1d /usr/src/debug/*/linux-$LINUXRELEASE \
214 2>/dev/null | tail -1)
215 if test -e "$linux_src/fs/ext4/super.c"; then
216 EXT4_SRC_DIR=$linux_src/fs/ext4
222 AC_MSG_CHECKING([ext4 source directory])
223 AC_MSG_RESULT([$EXT4_SRC_DIR])
224 AC_SUBST(EXT4_SRC_DIR)
226 LB_VALIDATE_EXT4_SRC_DIR
230 # LB_DEFINE_E2FSPROGS_NAMES
232 # Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
234 AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES],
236 AC_ARG_WITH([ldiskfsprogs],
237 AC_HELP_STRING([--with-ldiskfsprogs],
238 [use alternate names for ldiskfs-enabled e2fsprogs]),
241 AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
242 if test x$withval = xyes ; then
243 AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
244 E2FSPROGS="ldiskfsprogs"
245 MKE2FS="mkfs.ldiskfs"
246 DEBUGFS="debugfs.ldiskfs"
247 TUNE2FS="tunefs.ldiskfs"
248 E2LABEL="label.ldiskfs"
249 DUMPE2FS="dumpfs.ldiskfs"
250 E2FSCK="fsck.ldiskfs"
251 PFSCK="pfsck.ldiskfs"
252 AC_MSG_RESULT([enabled])
254 E2FSPROGS="e2fsprogs"
262 AC_MSG_RESULT([disabled])
265 AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
266 AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
267 AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
268 AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
269 AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
270 AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
271 AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
272 AC_DEFINE_UNQUOTED(PFSCK, "$PFSCK", [name of parallel fsck program])
274 AC_SUBST([E2FSPROGS], [$E2FSPROGS])
275 AC_SUBST([MKE2FS], [$MKE2FS])
276 AC_SUBST([DEBUGFS], [$DEBUGFS])
277 AC_SUBST([TUNE2FS], [$TUNE2FS])
278 AC_SUBST([E2LABEL], [$E2LABEL])
279 AC_SUBST([DUMPE2FS], [$DUMPE2FS])
280 AC_SUBST([E2FSCK], [$E2FSCK])
281 AC_SUBST([PFSCK], [$PFSCK])