4 AC_DEFUN([LDISKFS_LINUX_SERIES], [
5 AC_MSG_CHECKING([which ldiskfs series to use])
6 case x$LDISKFS_SERIES in
9 *.series) # set externally
13 AS_IF([test -z "$LDISKFS_SERIES"], [
14 AS_IF([test x$RHEL_KERNEL = xyes], [
15 case $RHEL_RELEASE_NO in
16 84) LDISKFS_SERIES="4.18-rhel8.4.series" ;;
17 83) LDISKFS_SERIES="4.18-rhel8.3.series" ;;
18 82) LDISKFS_SERIES="4.18-rhel8.2.series" ;;
19 81) LDISKFS_SERIES="4.18-rhel8.1.series" ;;
20 80) LDISKFS_SERIES="4.18-rhel8.series" ;;
21 79) LDISKFS_SERIES="3.10-rhel7.9.series" ;;
22 78) LDISKFS_SERIES="3.10-rhel7.8.series" ;;
23 77) LDISKFS_SERIES="3.10-rhel7.7.series" ;;
24 76) LDISKFS_SERIES="3.10-rhel7.6.series" ;;
26 ], [test x$SUSE_KERNEL = xyes], [
27 AS_VERSION_COMPARE([$LINUXRELEASE],[5.3.18],[
28 AS_VERSION_COMPARE([$LINUXRELEASE],[4.12.14],[], [], [
29 suse_conf=$LINUX_OBJ/include/generated/uapi/linux/suse_version.h
30 suse_vers=$(awk '[$]2 == "SUSE_VERSION" {print [$]3 }' $suse_conf)
31 suse_patchlevel=$(awk '[$]2 == "SUSE_PATCHLEVEL" {print [$]3 }' $suse_conf)
32 echo "$suse_conf $suse_vers $suse_patchlevel ${suse_vers}sp$suse_patchlevel" >> /tmp/log-nb
33 case ${suse_vers}sp$suse_patchlevel in # (
34 15sp0 ) LDISKFS_SERIES="4.12-sles15.series"
35 if test ! -f $LINUX/arch/x86/kernel/cpu/hygon.c ; then
36 # This file was added shortly after -150.22 so
37 # this must be 150.22 or earlier
38 LDISKFS_SERIES="4.12-sles15-22.series"
41 15sp1 ) LDISKFS_SERIES="4.12-sles15sp1.series"
42 if test ! -f $LINUX/arch/x86/kernel/cpu/umwait.c ; then
43 # This file was added after -197.7 so
44 # this must be -197.7 or earlier
45 LDISKFS_SERIES="4.12-sles15sp1-7.series"
50 )], [LDISKFS_SERIES="5.4.21-ml.series"],
52 suse_conf=$LINUX_OBJ/include/generated/uapi/linux/suse_version.h
53 suse_vers=$(awk '[$]2 == "SUSE_VERSION" {print [$]3 }' $suse_conf)
54 suse_patchlevel=$(awk '[$]2 == "SUSE_PATCHLEVEL" {print [$]3 }' $suse_conf)
55 echo "$suse_conf $suse_vers $suse_patchlevel ${suse_vers}sp$suse_patchlevel" >> /tmp/log-nb
57 case ${suse_vers}sp${suse_patchlevel} in # (
58 15sp2 ) LDISKFS_SERIES="5.4.21-ml.series"
59 grep -A3 ext4_update_dx_flag $LINUX/fs/ext4/ext4.h \
60 | grep ext4_test_inode_flag
61 if test $? -eq 0; then
62 LDISKFS_SERIES="5.4.0-66-ubuntu20.series"
65 15sp3 ) LDISKFS_SERIES="5.3.18-sles15sp2.series"
69 ], [test x$UBUNTU_KERNEL = xyes], [
70 AS_VERSION_COMPARE([$LINUXRELEASE],[5.8.0],[
71 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],[
72 AS_VERSION_COMPARE([$LINUXRELEASE],[5.0.0],[
73 AS_VERSION_COMPARE([$LINUXRELEASE],[4.15.0],[
74 AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.0], [],
76 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
79 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
80 LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"
82 [test $KPLEV -ge 73], [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"],
83 [test $KPLEV -ge 62], [LDISKFS_SERIES="4.4.0-62-ubuntu14+16.series"],
84 [test $KPLEV -ge 49], [LDISKFS_SERIES="4.4.0-49-ubuntu14+16.series"],
85 [LDISKFS_SERIES="4.4.0-45-ubuntu14+16.series"]
88 [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"])],
90 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
93 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
94 LDISKFS_SERIES="4.15.0-24-ubuntu18.series"
96 [test $KPLEV -ge 24], [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"],
97 [test $KPLEV -ge 20], [LDISKFS_SERIES="4.15.0-20-ubuntu18.series"]
100 [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"])],
101 [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"],
102 [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"])],
103 [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"],
105 KPLEV=$(echo $LINUXRELEASE | cut -d'-' -f2)
107 [test -z "$KPLEV"], [
108 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
109 LDISKFS_SERIES="5.4.0-80-ubuntu20.series"
111 [test $KPLEV -eq 1007], [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"],
112 [test $KPLEV -ge 66], [LDISKFS_SERIES="5.4.0-66-ubuntu20.series"],
113 [test $KPLEV -ge 80], [LDISKFS_SERIES="5.4.0-80-ubuntu20.series"],
114 [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"]
117 [LDISKFS_SERIES="5.4.0-ml.series"])],
118 [LDISKFS_SERIES="5.8.0-53-ubuntu20.series"],
119 [LDISKFS_SERIES="5.8.0-53-ubuntu20.series"],
120 [LDISKFS_SERIES="5.8.0-ml.series"])
123 # Not RHEL/SLES or Ubuntu .. probably mainline
124 AS_IF([test -z "$LDISKFS_SERIES"],
126 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],[],
127 [LDISKFS_SERIES="5.4.0-ml.series"],[
128 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.21],
129 [LDISKFS_SERIES="5.4.0-ml.series"], # lt
130 [LDISKFS_SERIES="5.4.21-ml.series"], # eq
131 [AS_VERSION_COMPARE([$LINUXRELEASE],[5.8.0],
132 [LDISKFS_SERIES="5.4.136-ml.series"], # lt
133 [LDISKFS_SERIES="5.8.0-ml.series"], # eq
134 [LDISKFS_SERIES="5.8.0-ml.series"], # gt
139 AS_IF([test -z "$LDISKFS_SERIES"],
140 [AC_MSG_RESULT([failed to identify series])],
141 [AC_MSG_RESULT([$LDISKFS_SERIES for $LINUXRELEASE])])
142 AC_SUBST(LDISKFS_SERIES)
143 ]) # LDISKFS_LINUX_SERIES
146 # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
148 # 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
149 # Note that RHEL6 is pre 2.6.32-rc7 so this check is still needed.
151 AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD], [
152 LB_CHECK_COMPILE([if 'ext4_free_blocks' needs 'struct buffer_head'],
153 ext4_free_blocks_with_buffer_head, [
154 #include <linux/fs.h>
155 #include "$EXT4_SRC_DIR/ext4.h"
157 ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
159 AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
160 [ext4_free_blocks do not require struct buffer_head])
162 ]) # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
165 # LB_EXT4_JOURNAL_START_3ARGS
167 # 3.9 added a type argument to ext4_journal_start and friends
169 AC_DEFUN([LB_EXT4_JOURNAL_START_3ARGS], [
170 LB_CHECK_COMPILE([if ext4_journal_start takes 3 arguments],
171 ext4_journal_start, [
172 #include <linux/fs.h>
173 #include "$EXT4_SRC_DIR/ext4_jbd2.h"
175 ext4_journal_start(NULL, 0, 0);
177 AC_DEFINE(JOURNAL_START_HAS_3ARGS, 1, [ext4_journal_start takes 3 arguments])
179 ]) # LB_EXT4_JOURNAL_START_3ARGS
182 # LB_EXT4_BREAD_4ARGS
184 # 3.18 ext4_bread has 4 arguments
185 # NOTE: It may not be exported for modules, use a positive compiler test here.
187 AC_DEFUN([LB_EXT4_BREAD_4ARGS], [
188 LB_CHECK_COMPILE([if ext4_bread takes 4 arguments],
190 #include <linux/fs.h>
191 #include "$EXT4_SRC_DIR/ext4.h"
193 struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
194 ext4_lblk_t block, int map_flags)
196 struct buffer_head *bh = NULL;
204 ext4_bread(NULL, NULL, 0, 0);
206 AC_DEFINE(HAVE_EXT4_BREAD_4ARGS, 1, [ext4_bread takes 4 arguments])
208 ]) # LB_EXT4_BREAD_4ARGS
211 # LB_EXT4_HAVE_INFO_DQUOT
213 # in linux 4.4 i_dqout is in ext4_inode_info, not in struct inode
215 AC_DEFUN([LB_EXT4_HAVE_INFO_DQUOT], [
216 LB_CHECK_COMPILE([if i_dquot is in ext4_inode_info],
218 #include <linux/fs.h>
219 #include <linux/quota.h>
220 #include "$EXT4_SRC_DIR/ext4.h"
222 struct ext4_inode_info in;
227 AC_DEFINE(HAVE_EXT4_INFO_DQUOT, 1, [i_dquot is in ext4_inode_info])
229 ]) # LB_EXT4_HAVE_INFO_DQUOT
232 # LB_EXT4_HAVE_I_CRYPT_INFO
234 # in linux 4.8 i_crypt_info moved from ext4_inode_info to struct inode
236 # Determine if we need to enable CONFIG_LDISKFS_FS_ENCRYPTION.
237 # If we have i_crypt_info in ext4_inode_info, the config option
238 # should be enabled to make the ldiskfs module compilation happy.
239 # Otherwise i_crypy_info is in struct inode, we need to check kernel
240 # config option to determine that.
242 AC_DEFUN([LB_EXT4_HAVE_I_CRYPT_INFO], [
243 LB_CHECK_COMPILE([if i_crypt_info is in ext4_inode_info],
245 #define CONFIG_EXT4_FS_ENCRYPTION 1
246 #include <linux/fs.h>
247 #include "$EXT4_SRC_DIR/ext4.h"
249 struct ext4_inode_info in;
251 in.i_crypt_info = NULL;
254 CONFIG_LDISKFS_FS_ENCRYPTION, 1,
255 [enable encryption for ldiskfs]
258 LB_CHECK_CONFIG([EXT4_FS_ENCRYPTION],[
260 CONFIG_LDISKFS_FS_ENCRYPTION, 1,
261 [enable encryption for ldiskfs]
265 ]) # LB_EXT4_HAVE_I_CRYPT_INFO
268 # LB_LDISKFS_JOURNAL_ENSURE_CREDITS
270 # kernel 4.18.0-240.1.1.el8 and
271 # kernel 5.4 commit a413036791d040e33badcc634453a4d0c0705499
273 # ext4_journal_ensure_credits was introduced to ensure given handle
274 # has at least requested amount of credits available, and possibly
275 # restarting transaction if needed.
277 AC_DEFUN([LB_LDISKFS_JOURNAL_ENSURE_CREDITS], [
278 tmp_flags="$EXTRA_KCFLAGS"
279 EXTRA_KCFLAGS="-Werror"
280 LB_CHECK_COMPILE([if 'ext4_journal_ensure_credits' exists],
281 ext4_journal_ensure_credits, [
282 #include "$EXT4_SRC_DIR/ext4_jbd2.h"
283 int __ext4_journal_ensure_credits(handle_t *handle, int check_cred,
284 int extend_cred, int revoke_cred) { return 0; }
286 ext4_journal_ensure_credits(NULL, 0, 0);
288 AC_DEFINE(HAVE_LDISKFS_JOURNAL_ENSURE_CREDITS, 1,
289 ['ext4_journal_ensure_credits' exists])
291 EXTRA_KCFLAGS="$tmp_flags"
292 ]) # LB_LDISKFS_JOURNAL_ENSURE_CREDITS
295 # LB_LDISKFS_IGET_HAS_FLAGS_ARG
297 # kernel 4.19 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
298 # ext4_iget changed to a macro with 3 args was function with 2 args
300 AC_DEFUN([LB_LDISKFS_IGET_HAS_FLAGS_ARG], [
301 tmp_flags="$EXTRA_KCFLAGS"
302 EXTRA_KCFLAGS="-Werror"
303 LB_CHECK_COMPILE([if ldiskfs_iget takes a flags argument],
305 #include <linux/fs.h>
306 #include "$EXT4_SRC_DIR/ext4.h"
308 int f = EXT4_IGET_SPECIAL;
311 AC_DEFINE(HAVE_LDISKFS_IGET_WITH_FLAGS, 1,
312 [if ldiskfs_iget takes a flags argument])
314 EXTRA_KCFLAGS="$tmp_flags"
315 ]) # LB_LDISKFS_IGET_HAS_FLAGS_ARG
318 # LDISKFS_AC_PATCH_PROGRAM
320 # Determine which program should be used to apply the patches to
321 # the ext4 source code to produce the ldiskfs source code.
323 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
324 AC_ARG_ENABLE([quilt],
325 [AC_HELP_STRING([--disable-quilt],
326 [disable use of quilt for ldiskfs])],
327 [AS_IF([test "x$enableval" = xno],
333 AS_IF([test x$use_quilt = xmaybe], [
334 AC_PATH_PROG([quilt_avail], [quilt], [no])
335 AS_IF([test x$quilt_avail = xno], [
342 AS_IF([test x$use_quilt = xno], [
343 AC_PATH_PROG([patch_avail], [patch], [no])
344 AS_IF([test x$patch_avail = xno], [
345 AC_MSG_ERROR([*** Need "quilt" or "patch" command])
348 ]) # LDISKFS_AC_PATCH_PROGRAM
351 # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
353 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
354 # ext4: avoid declaring fs inconsistent due to invalid file handles
355 # __ext4_find_entry became a helper function for ext4_find_entry
356 # conflicting with previous ldiskfs patches.
357 # ldiskfs patches map ext4_find_entry to ldiskfs_find_entry_locked to
358 # avoid conflicting with __ext4_find_entry
360 # When the following check succeeds __ext4_find_entry helper is not
363 AC_DEFUN([LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS], [
364 tmp_flags="$EXTRA_KCFLAGS"
365 EXTRA_KCFLAGS="-Werror"
366 LB_CHECK_COMPILE([if __ldiskfs_find_entry is available],
367 ldiskfs_find_entry_locked, [
368 #include <linux/fs.h>
369 #include "$EXT4_SRC_DIR/ext4.h"
370 #include "$EXT4_SRC_DIR/namei.c"
372 static int __ext4_find_entry(void) { return 0; }
374 int x = __ext4_find_entry();
377 AC_DEFINE(HAVE___LDISKFS_FIND_ENTRY, 1,
378 [if __ldiskfs_find_entry is available])
380 EXTRA_KCFLAGS="$tmp_flags"
381 ]) # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
384 # LB_LDISKFSFS_DIRHASH_WANTS_DIR
386 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
387 # ext4fs_dirhash UNICODE support
389 AC_DEFUN([LB_LDISKFSFS_DIRHASH_WANTS_DIR], [
390 tmp_flags="$EXTRA_KCFLAGS"
391 EXTRA_KCFLAGS="-Werror"
392 LB_CHECK_COMPILE([if ldiskfsfs_dirhash takes an inode argument],
394 #include <linux/fs.h>
395 #include "$EXT4_SRC_DIR/ext4.h"
397 int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
398 struct dx_hash_info *hinfo)
407 int f = ext4fs_dirhash(NULL, NULL, 0, NULL);
410 AC_DEFINE(HAVE_LDISKFSFS_GETHASH_INODE_ARG, 1,
411 [ldiskfsfs_dirhash takes an inode argument])
413 EXTRA_KCFLAGS="$tmp_flags"
414 ]) # LB_LDISKFSFS_DIRHASH_WANTS_DIR
417 # LB_JBD2_H_TOTAL_CREDITS
419 # kernel 5.5 commit 933f1c1e0b75bbc29730eef07c9e196c6dfd37e5
420 # jbd2: Reserve space for revoke descriptor blocks
422 AC_DEFUN([LB_JBD2_H_TOTAL_CREDITS], [
423 tmp_flags="$EXTRA_KCFLAGS"
424 EXTRA_KCFLAGS="-Werror"
425 LB_CHECK_COMPILE([if struct jbd2_journal_handle has h_total_credits member],
426 handle_t_h_revoke_credits, [
427 #include <linux/jbd2.h>
429 int x = offsetof(struct jbd2_journal_handle, h_total_credits);
432 AC_DEFINE(HAVE_JOURNAL_TOTAL_CREDITS, 1,
433 [struct jbd2_journal_handle has h_total_credits member])
435 EXTRA_KCFLAGS="$tmp_flags"
436 ]) # LB_JBD2_H_TOTAL_CREDITS
439 # LB_EXT4_GET_BLOCKS_KEEP_SIZE
441 # kernel 5.6-rc4 commit 9e52484c713321e84e8834803a44ca0a001376d2
442 # ext4: remove EXT4_GET_BLOCKS_KEEP_SIZE flag
444 AC_DEFUN([LB_EXT4_GET_BLOCKS_KEEP_SIZE], [
445 tmp_flags="$EXTRA_KCFLAGS"
446 EXTRA_KCFLAGS="-Werror"
447 LB_CHECK_COMPILE([if EXT4_GET_BLOCKS_KEEP_SIZE exists],
448 ext4_get_blocks_keep_size, [
449 #include <linux/fs.h>
450 #include "$EXT4_SRC_DIR/ext4.h"
452 int f = EXT4_IGET_SPECIAL;
455 AC_DEFINE(HAVE_LDISKFS_GET_BLOCKS_KEEP_SIZE, 1,
456 [EXT4_GET_BLOCKS_KEEP_SIZE hasn't been removed])
458 EXTRA_KCFLAGS="$tmp_flags"
459 ]) # LB_EXT4_GET_BLOCKS_KEEP_SIZE
464 AC_DEFUN([LB_CONFIG_LDISKFS], [
465 # --with-ldiskfs is deprecated now that ldiskfs is fully merged with lustre.
466 # However we continue to support this option through Lustre 2.5.
467 AC_ARG_WITH([ldiskfs],
469 [AC_MSG_WARN([--with-ldiskfs is deprecated, please use --enable-ldiskfs])
470 AS_IF([test x$withval != xyes -a x$withval != xno],
473 The ldiskfs option is deprecated,
474 and no longer supports paths to external ldiskfs source
478 AC_ARG_ENABLE([ldiskfs],
479 [AS_HELP_STRING([--disable-ldiskfs],
480 [disable ldiskfs osd (default is enable)])],
481 [AS_IF([test x$enable_ldiskfs != xyes -a x$enable_ldiskfs != xno],
482 [AC_MSG_ERROR([ldiskfs valid options are "yes" or "no"])])],
483 [AS_IF([test "${with_ldiskfs+set}" = set],
484 [enable_ldiskfs=$with_ldiskfs],
485 [enable_ldiskfs=maybe])
488 AS_IF([test x$enable_server = xno],
489 [AS_CASE([$enable_ldiskfs],
490 [maybe], [enable_ldiskfs=no],
491 [yes], [AC_MSG_ERROR([cannot build ldiskfs when servers are disabled])]
494 AS_IF([test x$enable_ldiskfs != xno],[
495 # In the future, we chould change enable_ldiskfs from maybe to
496 # either yes or no based on additional tests, e.g. whether a patch
497 # set is available for the detected kernel. For now, we just always
499 AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes])
500 AC_SUBST(ENABLE_LDISKFS, yes)
503 LDISKFS_AC_PATCH_PROGRAM
504 LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
505 LB_EXT4_JOURNAL_START_3ARGS
507 LB_EXT4_HAVE_INFO_DQUOT
508 LB_EXT4_HAVE_I_CRYPT_INFO
509 LB_LDISKFS_JOURNAL_ENSURE_CREDITS
510 LB_LDISKFS_IGET_HAS_FLAGS_ARG
511 LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
512 LB_LDISKFSFS_DIRHASH_WANTS_DIR
513 LB_JBD2_H_TOTAL_CREDITS
514 LB_EXT4_GET_BLOCKS_KEEP_SIZE
515 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
516 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
517 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
518 AC_DEFINE(CONFIG_LDISKFS_FS_RW, 1, [enable rw access for ldiskfs])
519 AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
520 AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
522 AC_SUBST(ENABLE_LDISKFS, no)
525 AC_MSG_CHECKING([whether to build ldiskfs])
526 AC_MSG_RESULT([$enable_ldiskfs])
528 AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes])
529 ]) # LB_CONFIG_LDISKFS
532 AC_DEFUN([LB_EXT4_SRC_DIR_SRC], [])
533 AC_DEFUN([LB_EXT4_SRC_DIR_RESULTS], [])
536 # LB_VALIDATE_EXT4_SRC_DIR
538 # Spot check the existence of several source files common to ext4.
539 # Detecting this at configure time allows us to avoid a potential build
540 # failure and provide a useful error message to explain what is wrong.
542 AC_DEFUN([LB_VALIDATE_EXT4_SRC_DIR], [
543 enable_ldiskfs_build="no"
544 AS_IF([test -n "$EXT4_SRC_DIR"], [
545 enable_ldiskfs_build="yes"
546 LB_CHECK_FILE([$EXT4_SRC_DIR/dir.c], [], [
547 enable_ldiskfs_build="no"
548 AC_MSG_WARN([ext4 must exist for ldiskfs build])
550 LB_CHECK_FILE([$EXT4_SRC_DIR/file.c], [], [
551 enable_ldiskfs_build="no"
552 AC_MSG_WARN([ext4 must exist for ldiskfs build])
554 LB_CHECK_FILE([$EXT4_SRC_DIR/inode.c], [], [
555 enable_ldiskfs_build="no"
556 AC_MSG_WARN([ext4 must exist for ldiskfs build])
558 LB_CHECK_FILE([$EXT4_SRC_DIR/super.c], [], [
559 enable_ldiskfs_build="no"
560 AC_MSG_WARN([ext4 must exist for ldiskfs build])
564 AS_IF([test "x$enable_ldiskfs_build" = xno], [
569 Disabling ldiskfs support because complete ext4 source does not exist.
571 If you are building using kernel-devel packages and require ldiskfs
572 server support then ensure that the matching kernel-debuginfo-common
573 and kernel-debuginfo-common-<arch> packages are installed.
576 ]) # LB_VALIDATE_EXT4_SRC_DIR
581 # Determine the location of the ext4 source code. It it required
582 # for several configure tests and to build ldiskfs.
584 AC_DEFUN([LB_EXT4_SRC_DIR], [
585 AC_MSG_CHECKING([ext4 source directory])
586 # Kernel ext source located with devel headers
588 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
589 EXT4_SRC_DIR="$linux_src/fs/ext4"
591 # Kernel ext source provided by kernel-debuginfo-common package
592 # that extracted to $LINUX
593 linux_src=$(ls -1d $linux_src/../../debug/*/linux-${LINUXRELEASE%.*}* \
594 2>/dev/null | tail -1)
595 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
596 EXT4_SRC_DIR="$linux_src/fs/ext4"
598 # Kernel ext source provided by kernel-debuginfo-common package
599 linux_src=$(ls -1d /usr/src/debug/*/linux-${LINUXRELEASE%.*}* \
600 2>/dev/null | tail -1)
601 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
602 EXT4_SRC_DIR="$linux_src/fs/ext4"
608 AC_MSG_RESULT([$EXT4_SRC_DIR])
609 AC_SUBST(EXT4_SRC_DIR)
611 LB_VALIDATE_EXT4_SRC_DIR
615 # LB_DEFINE_E2FSPROGS_NAMES
617 # Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
619 AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES], [
620 AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
621 AC_ARG_WITH([ldiskfsprogs],
622 AC_HELP_STRING([--with-ldiskfsprogs],
623 [use alternate names for ldiskfs-enabled e2fsprogs]),
626 AS_IF([test "x$withval" = xyes], [
627 AC_MSG_RESULT([enabled])
628 AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
629 E2FSPROGS="ldiskfsprogs"
630 MKE2FS="mkfs.ldiskfs"
631 DEBUGFS="debugfs.ldiskfs"
632 TUNE2FS="tunefs.ldiskfs"
633 E2LABEL="label.ldiskfs"
634 DUMPE2FS="dumpfs.ldiskfs"
635 E2FSCK="fsck.ldiskfs"
636 PFSCK="pfsck.ldiskfs"
638 AC_MSG_RESULT([disabled])
639 E2FSPROGS="e2fsprogs"
649 AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
650 AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
651 AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
652 AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
653 AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
654 AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
655 AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
656 AC_DEFINE_UNQUOTED(PFSCK, "$PFSCK", [name of parallel fsck program])
658 AC_SUBST([E2FSPROGS], [$E2FSPROGS])
659 AC_SUBST([MKE2FS], [$MKE2FS])
660 AC_SUBST([DEBUGFS], [$DEBUGFS])
661 AC_SUBST([TUNE2FS], [$TUNE2FS])
662 AC_SUBST([E2LABEL], [$E2LABEL])
663 AC_SUBST([DUMPE2FS], [$DUMPE2FS])
664 AC_SUBST([E2FSCK], [$E2FSCK])
665 AC_SUBST([PFSCK], [$PFSCK])
666 ]) # LB_DEFINE_E2FSPROGS_NAMES