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"],
51 [LDISKFS_SERIES="5.4.21-ml.series"])
52 ], [test x$UBUNTU_KERNEL = xyes], [
53 AS_VERSION_COMPARE([$LINUXRELEASE],[5.8.0],[
54 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],[
55 AS_VERSION_COMPARE([$LINUXRELEASE],[5.0.0],[
56 AS_VERSION_COMPARE([$LINUXRELEASE],[4.15.0],[
57 AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.0], [],
59 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
62 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
63 LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"
65 [test $KPLEV -ge 73], [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"],
66 [test $KPLEV -ge 62], [LDISKFS_SERIES="4.4.0-62-ubuntu14+16.series"],
67 [test $KPLEV -ge 49], [LDISKFS_SERIES="4.4.0-49-ubuntu14+16.series"],
68 [LDISKFS_SERIES="4.4.0-45-ubuntu14+16.series"]
71 [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"])],
73 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
76 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
77 LDISKFS_SERIES="4.15.0-24-ubuntu18.series"
79 [test $KPLEV -ge 24], [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"],
80 [test $KPLEV -ge 20], [LDISKFS_SERIES="4.15.0-20-ubuntu18.series"]
83 [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"])],
84 [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"],
85 [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"])],
86 [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"],
88 KPLEV=$(echo $LINUXRELEASE | cut -d'-' -f2)
91 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
92 LDISKFS_SERIES="5.4.0-80-ubuntu20.series"
94 [test $KPLEV -eq 1007], [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"],
95 [test $KPLEV -ge 66], [LDISKFS_SERIES="5.4.0-66-ubuntu20.series"],
96 [test $KPLEV -ge 80], [LDISKFS_SERIES="5.4.0-80-ubuntu20.series"],
97 [LDISKFS_SERIES="5.4.0-42-ubuntu20.series"]
100 [LDISKFS_SERIES="5.4.0-ml.series"])],
101 [LDISKFS_SERIES="5.8.0-53-ubuntu20.series"],
102 [LDISKFS_SERIES="5.8.0-53-ubuntu20.series"],
103 [LDISKFS_SERIES="5.8.0-ml.series"])
106 # Not RHEL/SLES or Ubuntu .. probably mainline
107 AS_IF([test -z "$LDISKFS_SERIES"],
109 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],[],
110 [LDISKFS_SERIES="5.4.0-ml.series"],[
111 AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.21],
112 [LDISKFS_SERIES="5.4.0-ml.series"], # lt
113 [LDISKFS_SERIES="5.4.21-ml.series"], # eq
114 [AS_VERSION_COMPARE([$LINUXRELEASE],[5.8.0],
115 [LDISKFS_SERIES="5.4.136-ml.series"], # lt
116 [LDISKFS_SERIES="5.8.0-ml.series"], # eq
117 [LDISKFS_SERIES="5.8.0-ml.series"], # gt
122 AS_IF([test -z "$LDISKFS_SERIES"],
123 [AC_MSG_RESULT([failed to identify series])],
124 [AC_MSG_RESULT([$LDISKFS_SERIES for $LINUXRELEASE])])
125 AC_SUBST(LDISKFS_SERIES)
126 ]) # LDISKFS_LINUX_SERIES
129 # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
131 # 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
132 # Note that RHEL6 is pre 2.6.32-rc7 so this check is still needed.
134 AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD], [
135 LB_CHECK_COMPILE([if 'ext4_free_blocks' needs 'struct buffer_head'],
136 ext4_free_blocks_with_buffer_head, [
137 #include <linux/fs.h>
138 #include "$EXT4_SRC_DIR/ext4.h"
140 ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
142 AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
143 [ext4_free_blocks do not require struct buffer_head])
145 ]) # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
148 # LB_EXT4_JOURNAL_START_3ARGS
150 # 3.9 added a type argument to ext4_journal_start and friends
152 AC_DEFUN([LB_EXT4_JOURNAL_START_3ARGS], [
153 LB_CHECK_COMPILE([if ext4_journal_start takes 3 arguments],
154 ext4_journal_start, [
155 #include <linux/fs.h>
156 #include "$EXT4_SRC_DIR/ext4_jbd2.h"
158 ext4_journal_start(NULL, 0, 0);
160 AC_DEFINE(JOURNAL_START_HAS_3ARGS, 1, [ext4_journal_start takes 3 arguments])
162 ]) # LB_EXT4_JOURNAL_START_3ARGS
165 # LB_EXT4_BREAD_4ARGS
167 # 3.18 ext4_bread has 4 arguments
168 # NOTE: It may not be exported for modules, use a positive compiler test here.
170 AC_DEFUN([LB_EXT4_BREAD_4ARGS], [
171 LB_CHECK_COMPILE([if ext4_bread takes 4 arguments],
173 #include <linux/fs.h>
174 #include "$EXT4_SRC_DIR/ext4.h"
176 struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
177 ext4_lblk_t block, int map_flags)
179 struct buffer_head *bh = NULL;
187 ext4_bread(NULL, NULL, 0, 0);
189 AC_DEFINE(HAVE_EXT4_BREAD_4ARGS, 1, [ext4_bread takes 4 arguments])
191 ]) # LB_EXT4_BREAD_4ARGS
194 # LB_EXT4_HAVE_INFO_DQUOT
196 # in linux 4.4 i_dqout is in ext4_inode_info, not in struct inode
198 AC_DEFUN([LB_EXT4_HAVE_INFO_DQUOT], [
199 LB_CHECK_COMPILE([if i_dquot is in ext4_inode_info],
201 #include <linux/fs.h>
202 #include <linux/quota.h>
203 #include "$EXT4_SRC_DIR/ext4.h"
205 struct ext4_inode_info in;
210 AC_DEFINE(HAVE_EXT4_INFO_DQUOT, 1, [i_dquot is in ext4_inode_info])
212 ]) # LB_EXT4_HAVE_INFO_DQUOT
215 # LB_EXT4_HAVE_I_CRYPT_INFO
217 # in linux 4.8 i_crypt_info moved from ext4_inode_info to struct inode
219 # Determine if we need to enable CONFIG_LDISKFS_FS_ENCRYPTION.
220 # If we have i_crypt_info in ext4_inode_info, the config option
221 # should be enabled to make the ldiskfs module compilation happy.
222 # Otherwise i_crypy_info is in struct inode, we need to check kernel
223 # config option to determine that.
225 AC_DEFUN([LB_EXT4_HAVE_I_CRYPT_INFO], [
226 LB_CHECK_COMPILE([if i_crypt_info is in ext4_inode_info],
228 #define CONFIG_EXT4_FS_ENCRYPTION 1
229 #include <linux/fs.h>
230 #include "$EXT4_SRC_DIR/ext4.h"
232 struct ext4_inode_info in;
234 in.i_crypt_info = NULL;
237 CONFIG_LDISKFS_FS_ENCRYPTION, 1,
238 [enable encryption for ldiskfs]
241 LB_CHECK_CONFIG([EXT4_FS_ENCRYPTION],[
243 CONFIG_LDISKFS_FS_ENCRYPTION, 1,
244 [enable encryption for ldiskfs]
248 ]) # LB_EXT4_HAVE_I_CRYPT_INFO
251 # LB_LDISKFS_JOURNAL_ENSURE_CREDITS
253 # kernel 4.18.0-240.1.1.el8 and
254 # kernel 5.4 commit a413036791d040e33badcc634453a4d0c0705499
256 # ext4_journal_ensure_credits was introduced to ensure given handle
257 # has at least requested amount of credits available, and possibly
258 # restarting transaction if needed.
260 AC_DEFUN([LB_LDISKFS_JOURNAL_ENSURE_CREDITS], [
261 tmp_flags="$EXTRA_KCFLAGS"
262 EXTRA_KCFLAGS="-Werror"
263 LB_CHECK_COMPILE([if 'ext4_journal_ensure_credits' exists],
264 ext4_journal_ensure_credits, [
265 #include "$EXT4_SRC_DIR/ext4_jbd2.h"
266 int __ext4_journal_ensure_credits(handle_t *handle, int check_cred,
267 int extend_cred, int revoke_cred) { return 0; }
269 ext4_journal_ensure_credits(NULL, 0, 0);
271 AC_DEFINE(HAVE_LDISKFS_JOURNAL_ENSURE_CREDITS, 1,
272 ['ext4_journal_ensure_credits' exists])
274 EXTRA_KCFLAGS="$tmp_flags"
275 ]) # LB_LDISKFS_JOURNAL_ENSURE_CREDITS
278 # LB_LDISKFS_IGET_HAS_FLAGS_ARG
280 # kernel 4.19 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
281 # ext4_iget changed to a macro with 3 args was function with 2 args
283 AC_DEFUN([LB_LDISKFS_IGET_HAS_FLAGS_ARG], [
284 tmp_flags="$EXTRA_KCFLAGS"
285 EXTRA_KCFLAGS="-Werror"
286 LB_CHECK_COMPILE([if ldiskfs_iget takes a flags argument],
288 #include <linux/fs.h>
289 #include "$EXT4_SRC_DIR/ext4.h"
291 int f = EXT4_IGET_SPECIAL;
294 AC_DEFINE(HAVE_LDISKFS_IGET_WITH_FLAGS, 1,
295 [if ldiskfs_iget takes a flags argument])
297 EXTRA_KCFLAGS="$tmp_flags"
298 ]) # LB_LDISKFS_IGET_HAS_FLAGS_ARG
301 # LDISKFS_AC_PATCH_PROGRAM
303 # Determine which program should be used to apply the patches to
304 # the ext4 source code to produce the ldiskfs source code.
306 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
307 AC_ARG_ENABLE([quilt],
308 [AC_HELP_STRING([--disable-quilt],
309 [disable use of quilt for ldiskfs])],
310 [AS_IF([test "x$enableval" = xno],
316 AS_IF([test x$use_quilt = xmaybe], [
317 AC_PATH_PROG([quilt_avail], [quilt], [no])
318 AS_IF([test x$quilt_avail = xno], [
325 AS_IF([test x$use_quilt = xno], [
326 AC_PATH_PROG([patch_avail], [patch], [no])
327 AS_IF([test x$patch_avail = xno], [
328 AC_MSG_ERROR([*** Need "quilt" or "patch" command])
331 ]) # LDISKFS_AC_PATCH_PROGRAM
334 # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
336 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
337 # ext4: avoid declaring fs inconsistent due to invalid file handles
338 # __ext4_find_entry became a helper function for ext4_find_entry
339 # conflicting with previous ldiskfs patches.
340 # ldiskfs patches map ext4_find_entry to ldiskfs_find_entry_locked to
341 # avoid conflicting with __ext4_find_entry
343 # When the following check succeeds __ext4_find_entry helper is not
346 AC_DEFUN([LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS], [
347 tmp_flags="$EXTRA_KCFLAGS"
348 EXTRA_KCFLAGS="-Werror"
349 LB_CHECK_COMPILE([if __ldiskfs_find_entry is available],
350 ldiskfs_find_entry_locked, [
351 #include <linux/fs.h>
352 #include "$EXT4_SRC_DIR/ext4.h"
353 #include "$EXT4_SRC_DIR/namei.c"
355 static int __ext4_find_entry(void) { return 0; }
357 int x = __ext4_find_entry();
360 AC_DEFINE(HAVE___LDISKFS_FIND_ENTRY, 1,
361 [if __ldiskfs_find_entry is available])
363 EXTRA_KCFLAGS="$tmp_flags"
364 ]) # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
367 # LB_LDISKFSFS_DIRHASH_WANTS_DIR
369 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
370 # ext4fs_dirhash UNICODE support
372 AC_DEFUN([LB_LDISKFSFS_DIRHASH_WANTS_DIR], [
373 tmp_flags="$EXTRA_KCFLAGS"
374 EXTRA_KCFLAGS="-Werror"
375 LB_CHECK_COMPILE([if ldiskfsfs_dirhash takes an inode argument],
377 #include <linux/fs.h>
378 #include "$EXT4_SRC_DIR/ext4.h"
380 int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
381 struct dx_hash_info *hinfo)
390 int f = ext4fs_dirhash(NULL, NULL, 0, NULL);
393 AC_DEFINE(HAVE_LDISKFSFS_GETHASH_INODE_ARG, 1,
394 [ldiskfsfs_dirhash takes an inode argument])
396 EXTRA_KCFLAGS="$tmp_flags"
397 ]) # LB_LDISKFSFS_DIRHASH_WANTS_DIR
400 # LB_JBD2_H_TOTAL_CREDITS
402 # kernel 5.5 commit 933f1c1e0b75bbc29730eef07c9e196c6dfd37e5
403 # jbd2: Reserve space for revoke descriptor blocks
405 AC_DEFUN([LB_JBD2_H_TOTAL_CREDITS], [
406 tmp_flags="$EXTRA_KCFLAGS"
407 EXTRA_KCFLAGS="-Werror"
408 LB_CHECK_COMPILE([if struct jbd2_journal_handle has h_total_credits member],
409 handle_t_h_revoke_credits, [
410 #include <linux/jbd2.h>
412 int x = offsetof(struct jbd2_journal_handle, h_total_credits);
415 AC_DEFINE(HAVE_JOURNAL_TOTAL_CREDITS, 1,
416 [struct jbd2_journal_handle has h_total_credits member])
418 EXTRA_KCFLAGS="$tmp_flags"
419 ]) # LB_JBD2_H_TOTAL_CREDITS
422 # LB_EXT4_GET_BLOCKS_KEEP_SIZE
424 # kernel 5.6-rc4 commit 9e52484c713321e84e8834803a44ca0a001376d2
425 # ext4: remove EXT4_GET_BLOCKS_KEEP_SIZE flag
427 AC_DEFUN([LB_EXT4_GET_BLOCKS_KEEP_SIZE], [
428 tmp_flags="$EXTRA_KCFLAGS"
429 EXTRA_KCFLAGS="-Werror"
430 LB_CHECK_COMPILE([if EXT4_GET_BLOCKS_KEEP_SIZE exists],
431 ext4_get_blocks_keep_size, [
432 #include <linux/fs.h>
433 #include "$EXT4_SRC_DIR/ext4.h"
435 int f = EXT4_IGET_SPECIAL;
438 AC_DEFINE(HAVE_LDISKFS_GET_BLOCKS_KEEP_SIZE, 1,
439 [EXT4_GET_BLOCKS_KEEP_SIZE hasn't been removed])
441 EXTRA_KCFLAGS="$tmp_flags"
442 ]) # LB_EXT4_GET_BLOCKS_KEEP_SIZE
447 AC_DEFUN([LB_CONFIG_LDISKFS], [
448 # --with-ldiskfs is deprecated now that ldiskfs is fully merged with lustre.
449 # However we continue to support this option through Lustre 2.5.
450 AC_ARG_WITH([ldiskfs],
452 [AC_MSG_WARN([--with-ldiskfs is deprecated, please use --enable-ldiskfs])
453 AS_IF([test x$withval != xyes -a x$withval != xno],
456 The ldiskfs option is deprecated,
457 and no longer supports paths to external ldiskfs source
461 AC_ARG_ENABLE([ldiskfs],
462 [AS_HELP_STRING([--disable-ldiskfs],
463 [disable ldiskfs osd (default is enable)])],
464 [AS_IF([test x$enable_ldiskfs != xyes -a x$enable_ldiskfs != xno],
465 [AC_MSG_ERROR([ldiskfs valid options are "yes" or "no"])])],
466 [AS_IF([test "${with_ldiskfs+set}" = set],
467 [enable_ldiskfs=$with_ldiskfs],
468 [enable_ldiskfs=maybe])
471 AS_IF([test x$enable_server = xno],
472 [AS_CASE([$enable_ldiskfs],
473 [maybe], [enable_ldiskfs=no],
474 [yes], [AC_MSG_ERROR([cannot build ldiskfs when servers are disabled])]
477 AS_IF([test x$enable_ldiskfs != xno],[
478 # In the future, we chould change enable_ldiskfs from maybe to
479 # either yes or no based on additional tests, e.g. whether a patch
480 # set is available for the detected kernel. For now, we just always
482 AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes])
483 AC_SUBST(ENABLE_LDISKFS, yes)
486 LDISKFS_AC_PATCH_PROGRAM
487 LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
488 LB_EXT4_JOURNAL_START_3ARGS
490 LB_EXT4_HAVE_INFO_DQUOT
491 LB_EXT4_HAVE_I_CRYPT_INFO
492 LB_LDISKFS_JOURNAL_ENSURE_CREDITS
493 LB_LDISKFS_IGET_HAS_FLAGS_ARG
494 LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
495 LB_LDISKFSFS_DIRHASH_WANTS_DIR
496 LB_JBD2_H_TOTAL_CREDITS
497 LB_EXT4_GET_BLOCKS_KEEP_SIZE
498 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
499 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
500 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
501 AC_DEFINE(CONFIG_LDISKFS_FS_RW, 1, [enable rw access for ldiskfs])
502 AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
503 AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
505 AC_SUBST(ENABLE_LDISKFS, no)
508 AC_MSG_CHECKING([whether to build ldiskfs])
509 AC_MSG_RESULT([$enable_ldiskfs])
511 AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes])
512 ]) # LB_CONFIG_LDISKFS
515 AC_DEFUN([LB_EXT4_SRC_DIR_SRC], [])
516 AC_DEFUN([LB_EXT4_SRC_DIR_RESULTS], [])
519 # LB_VALIDATE_EXT4_SRC_DIR
521 # Spot check the existence of several source files common to ext4.
522 # Detecting this at configure time allows us to avoid a potential build
523 # failure and provide a useful error message to explain what is wrong.
525 AC_DEFUN([LB_VALIDATE_EXT4_SRC_DIR], [
526 enable_ldiskfs_build="no"
527 AS_IF([test -n "$EXT4_SRC_DIR"], [
528 enable_ldiskfs_build="yes"
529 LB_CHECK_FILE([$EXT4_SRC_DIR/dir.c], [], [
530 enable_ldiskfs_build="no"
531 AC_MSG_WARN([ext4 must exist for ldiskfs build])
533 LB_CHECK_FILE([$EXT4_SRC_DIR/file.c], [], [
534 enable_ldiskfs_build="no"
535 AC_MSG_WARN([ext4 must exist for ldiskfs build])
537 LB_CHECK_FILE([$EXT4_SRC_DIR/inode.c], [], [
538 enable_ldiskfs_build="no"
539 AC_MSG_WARN([ext4 must exist for ldiskfs build])
541 LB_CHECK_FILE([$EXT4_SRC_DIR/super.c], [], [
542 enable_ldiskfs_build="no"
543 AC_MSG_WARN([ext4 must exist for ldiskfs build])
547 AS_IF([test "x$enable_ldiskfs_build" = xno], [
552 Disabling ldiskfs support because complete ext4 source does not exist.
554 If you are building using kernel-devel packages and require ldiskfs
555 server support then ensure that the matching kernel-debuginfo-common
556 and kernel-debuginfo-common-<arch> packages are installed.
559 ]) # LB_VALIDATE_EXT4_SRC_DIR
564 # Determine the location of the ext4 source code. It it required
565 # for several configure tests and to build ldiskfs.
567 AC_DEFUN([LB_EXT4_SRC_DIR], [
568 AC_MSG_CHECKING([ext4 source directory])
569 # Kernel ext source located with devel headers
571 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
572 EXT4_SRC_DIR="$linux_src/fs/ext4"
574 # Kernel ext source provided by kernel-debuginfo-common package
575 # that extracted to $LINUX
576 linux_src=$(ls -1d $linux_src/../../debug/*/linux-${LINUXRELEASE%.*}* \
577 2>/dev/null | tail -1)
578 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
579 EXT4_SRC_DIR="$linux_src/fs/ext4"
581 # Kernel ext source provided by kernel-debuginfo-common package
582 linux_src=$(ls -1d /usr/src/debug/*/linux-${LINUXRELEASE%.*}* \
583 2>/dev/null | tail -1)
584 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
585 EXT4_SRC_DIR="$linux_src/fs/ext4"
591 AC_MSG_RESULT([$EXT4_SRC_DIR])
592 AC_SUBST(EXT4_SRC_DIR)
594 LB_VALIDATE_EXT4_SRC_DIR
598 # LB_DEFINE_E2FSPROGS_NAMES
600 # Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
602 AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES], [
603 AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
604 AC_ARG_WITH([ldiskfsprogs],
605 AC_HELP_STRING([--with-ldiskfsprogs],
606 [use alternate names for ldiskfs-enabled e2fsprogs]),
609 AS_IF([test "x$withval" = xyes], [
610 AC_MSG_RESULT([enabled])
611 AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
612 E2FSPROGS="ldiskfsprogs"
613 MKE2FS="mkfs.ldiskfs"
614 DEBUGFS="debugfs.ldiskfs"
615 TUNE2FS="tunefs.ldiskfs"
616 E2LABEL="label.ldiskfs"
617 DUMPE2FS="dumpfs.ldiskfs"
618 E2FSCK="fsck.ldiskfs"
619 PFSCK="pfsck.ldiskfs"
621 AC_MSG_RESULT([disabled])
622 E2FSPROGS="e2fsprogs"
632 AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
633 AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
634 AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
635 AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
636 AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
637 AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
638 AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
639 AC_DEFINE_UNQUOTED(PFSCK, "$PFSCK", [name of parallel fsck program])
641 AC_SUBST([E2FSPROGS], [$E2FSPROGS])
642 AC_SUBST([MKE2FS], [$MKE2FS])
643 AC_SUBST([DEBUGFS], [$DEBUGFS])
644 AC_SUBST([TUNE2FS], [$TUNE2FS])
645 AC_SUBST([E2LABEL], [$E2LABEL])
646 AC_SUBST([DUMPE2FS], [$DUMPE2FS])
647 AC_SUBST([E2FSCK], [$E2FSCK])
648 AC_SUBST([PFSCK], [$PFSCK])
649 ]) # LB_DEFINE_E2FSPROGS_NAMES