Whamcloud - gitweb
0835d5209921be02201dc83e8fc17461e7a064b8
[fs/lustre-release.git] / config / lustre-build-ldiskfs.m4
1 #
2 # LDISKFS_LINUX_SERIES
3 #
4 AC_DEFUN([LDISKFS_LINUX_SERIES], [
5 AC_MSG_CHECKING([which ldiskfs series to use])
6 case x$LDISKFS_SERIES in
7         x)                      # not set
8                 ;;
9         *.series)               # set externally
10                 ;;
11         *) LDISKFS_SERIES=
12 esac
13 AS_IF([test -z "$LDISKFS_SERIES"], [
14 AS_IF([test x$RHEL_KERNEL = xyes], [
15         case $RHEL_RELEASE_NO in
16         81)     LDISKFS_SERIES="4.18-rhel8.1.series"    ;;
17         80)     LDISKFS_SERIES="4.18-rhel8.series"      ;;
18         78)     LDISKFS_SERIES="3.10-rhel7.8.series"    ;;
19         77)     LDISKFS_SERIES="3.10-rhel7.7.series"    ;;
20         76)     LDISKFS_SERIES="3.10-rhel7.6.series"    ;;
21         esac
22 ], [test x$SUSE_KERNEL = xyes], [
23         AS_VERSION_COMPARE([$LINUXRELEASE],[5.3.18],[
24         AS_VERSION_COMPARE([$LINUXRELEASE],[4.12.14],[], [], [
25                 suse_conf=$LINUX_OBJ/include/generated/uapi/linux/suse_version.h
26                 suse_vers=$(awk '[$]2 == "SUSE_VERSION" {print [$]3 }' $suse_conf)
27                 suse_patchlevel=$(awk '[$]2 == "SUSE_PATCHLEVEL" {print [$]3 }' $suse_conf)
28                 echo "$suse_conf $suse_vers $suse_patchlevel  ${suse_vers}sp$suse_patchlevel" >> /tmp/log-nb
29                 case ${suse_vers}sp$suse_patchlevel in # (
30                 15sp0 ) LDISKFS_SERIES="4.12-sles15.series"
31                         if test ! -f $LINUX/arch/x86/kernel/cpu/hygon.c ; then
32                                 # This file was added shortly after -150.22 so
33                                 # this must be 150.22 or earlier
34                                 LDISKFS_SERIES="4.12-sles15-22.series"
35                         fi
36                         ;; # (
37                 15sp1 ) LDISKFS_SERIES="4.12-sles15sp1.series"
38                         if test ! -f $LINUX/arch/x86/kernel/cpu/umwait.c ; then
39                                 # This file was added after -197.7 so
40                                 # this must be -197.7 or earlier
41                                 LDISKFS_SERIES="4.12-sles15sp1-7.series"
42                         fi
43                         ;;
44                 esac
45         ]
46         )], [LDISKFS_SERIES="5.4.0-ml.series"],
47             [LDISKFS_SERIES="5.4.0-ml.series"])
48 ], [test x$UBUNTU_KERNEL = xyes], [
49         AS_VERSION_COMPARE([$LINUXRELEASE],[5.3.0],[
50         AS_VERSION_COMPARE([$LINUXRELEASE],[5.0.0],[
51         AS_VERSION_COMPARE([$LINUXRELEASE],[4.15.0],[
52         AS_VERSION_COMPARE([$LINUXRELEASE],[4.4.0], [],
53         [
54                 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
55                 AS_IF(
56                         [test -z "$KPLEV"], [
57                                 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
58                                 LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"
59                         ],
60                         [test $KPLEV -ge 73], [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"],
61                         [test $KPLEV -ge 62], [LDISKFS_SERIES="4.4.0-62-ubuntu14+16.series"],
62                         [test $KPLEV -ge 49], [LDISKFS_SERIES="4.4.0-49-ubuntu14+16.series"],
63                         [LDISKFS_SERIES="4.4.0-45-ubuntu14+16.series"]
64                 )
65         ],
66         [LDISKFS_SERIES="4.4.0-73-ubuntu14+16.series"])],
67         [
68                 KPLEV=$(echo $LINUXRELEASE | sed -n 's/.*-\([0-9]\+\).*/\1/p')
69                 AS_IF(
70                         [test -z "$KPLEV"], [
71                                 AC_MSG_WARN([Failed to determine Kernel patch level. Assume latest.])
72                                 LDISKFS_SERIES="4.15.0-24-ubuntu18.series"
73                         ],
74                         [test $KPLEV -ge 24], [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"],
75                         [test $KPLEV -ge 20], [LDISKFS_SERIES="4.15.0-20-ubuntu18.series"]
76                 )
77         ],
78         [LDISKFS_SERIES="4.15.0-24-ubuntu18.series"])],
79         [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"],
80         [LDISKFS_SERIES="5.0.0-13-ubuntu19.series"])],
81         [LDISKFS_SERIES="5.4.0-ml.series"],
82         [LDISKFS_SERIES="5.4.0-ml.series"])
83 ])
84 ])
85 # Not RHEL/SLES or Ubuntu .. probably mainline
86 AS_IF([test -z "$LDISKFS_SERIES"],
87         [
88         AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],[],
89         [LDISKFS_SERIES="5.4.0-ml.series"],[
90         AS_VERSION_COMPARE([$LINUXRELEASE],[5.4.0],
91                 [LDISKFS_SERIES="5.4.0-ml.series"], # lt
92                 [LDISKFS_SERIES="5.4.0-ml.series"], # eq
93                 [LDISKFS_SERIES="5.4.0-ml.series"]  # gt
94                 )])
95         ],
96 [])
97 AS_IF([test -z "$LDISKFS_SERIES"],
98         [AC_MSG_RESULT([failed to identify series])],
99         [AC_MSG_RESULT([$LDISKFS_SERIES for $LINUXRELEASE])])
100 AC_SUBST(LDISKFS_SERIES)
101 ]) # LDISKFS_LINUX_SERIES
102
103 #
104 # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
105 #
106 # 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
107 # Note that RHEL6 is pre 2.6.32-rc7 so this check is still needed.
108 #
109 AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD], [
110 LB_CHECK_COMPILE([if 'ext4_free_blocks' needs 'struct buffer_head'],
111 ext4_free_blocks_with_buffer_head, [
112         #include <linux/fs.h>
113         #include "$EXT4_SRC_DIR/ext4.h"
114 ],[
115         ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
116 ],[
117         AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
118                 [ext4_free_blocks do not require struct buffer_head])
119 ])
120 ]) # LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
121
122 #
123 # LB_EXT4_JOURNAL_START_3ARGS
124 #
125 # 3.9 added a type argument to ext4_journal_start and friends
126 #
127 AC_DEFUN([LB_EXT4_JOURNAL_START_3ARGS], [
128 LB_CHECK_COMPILE([if ext4_journal_start takes 3 arguments],
129 ext4_journal_start, [
130         #include <linux/fs.h>
131         #include "$EXT4_SRC_DIR/ext4_jbd2.h"
132 ],[
133         ext4_journal_start(NULL, 0, 0);
134 ],[
135         AC_DEFINE(JOURNAL_START_HAS_3ARGS, 1, [ext4_journal_start takes 3 arguments])
136 ])
137 ]) # LB_EXT4_JOURNAL_START_3ARGS
138
139 #
140 # LB_EXT4_BREAD_4ARGS
141 #
142 # 3.18 ext4_bread has 4 arguments
143 # NOTE: It may not be exported for modules, use a positive compiler test here.
144 #
145 AC_DEFUN([LB_EXT4_BREAD_4ARGS], [
146 LB_CHECK_COMPILE([if ext4_bread takes 4 arguments],
147 ext4_bread, [
148         #include <linux/fs.h>
149         #include "$EXT4_SRC_DIR/ext4.h"
150
151         struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
152                                        ext4_lblk_t block, int map_flags)
153         {
154                 struct buffer_head *bh = NULL;
155                 (void)handle;
156                 (void)inode;
157                 (void)block;
158                 (void)map_flags;
159                 return bh;
160         }
161 ],[
162         ext4_bread(NULL, NULL, 0, 0);
163 ],[
164         AC_DEFINE(HAVE_EXT4_BREAD_4ARGS, 1, [ext4_bread takes 4 arguments])
165 ])
166 ]) # LB_EXT4_BREAD_4ARGS
167
168 #
169 # LB_EXT4_HAVE_INFO_DQUOT
170 #
171 # in linux 4.4 i_dqout is in ext4_inode_info, not in struct inode
172 #
173 AC_DEFUN([LB_EXT4_HAVE_INFO_DQUOT], [
174 LB_CHECK_COMPILE([if i_dquot is in ext4_inode_info],
175 ext4_info_dquot, [
176         #include <linux/fs.h>
177         #include <linux/quota.h>
178         #include "$EXT4_SRC_DIR/ext4.h"
179 ],[
180         struct ext4_inode_info in;
181         struct dquot *dq;
182
183         dq = in.i_dquot[0];
184 ],[
185         AC_DEFINE(HAVE_EXT4_INFO_DQUOT, 1, [i_dquot is in ext4_inode_info])
186 ])
187 ]) # LB_EXT4_HAVE_INFO_DQUOT
188
189 #
190 # LB_EXT4_HAVE_I_CRYPT_INFO
191 #
192 # in linux 4.8 i_crypt_info moved from ext4_inode_info to struct inode
193 #
194 # Determine if we need to enable CONFIG_LDISKFS_FS_ENCRYPTION.
195 # If we have i_crypt_info in ext4_inode_info, the config option
196 # should be enabled to make the ldiskfs module compilation happy.
197 # Otherwise i_crypy_info is in struct inode, we need to check kernel
198 # config option to determine that.
199 #
200 AC_DEFUN([LB_EXT4_HAVE_I_CRYPT_INFO], [
201 LB_CHECK_COMPILE([if i_crypt_info is in ext4_inode_info],
202 ext4_i_crypt_info, [
203         #define CONFIG_EXT4_FS_ENCRYPTION 1
204         #include <linux/fs.h>
205         #include "$EXT4_SRC_DIR/ext4.h"
206 ],[
207         struct ext4_inode_info in;
208
209         in.i_crypt_info = NULL;
210 ],[
211         AC_DEFINE(
212                 CONFIG_LDISKFS_FS_ENCRYPTION, 1,
213                 [enable encryption for ldiskfs]
214         )
215 ],[
216         LB_CHECK_CONFIG([EXT4_FS_ENCRYPTION],[
217                 AC_DEFINE(
218                         CONFIG_LDISKFS_FS_ENCRYPTION, 1,
219                         [enable encryption for ldiskfs]
220                 )
221         ])
222 ])
223 ]) # LB_EXT4_HAVE_I_CRYPT_INFO
224
225 #
226 # LB_LDISKFS_IGET_HAS_FLAGS_ARG
227 #
228 # kernel 4.19 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
229 # ext4_iget changed to a macro with 3 args was function with 2 args
230 #
231 AC_DEFUN([LB_LDISKFS_IGET_HAS_FLAGS_ARG], [
232 tmp_flags="$EXTRA_KCFLAGS"
233 EXTRA_KCFLAGS="-Werror"
234 LB_CHECK_COMPILE([if ldiskfs_iget takes a flags argument],
235 ext4_iget_3args, [
236         #include <linux/fs.h>
237         #include "$EXT4_SRC_DIR/ext4.h"
238 ],[
239         int f = EXT4_IGET_SPECIAL;
240         (void)f;
241 ],[
242         AC_DEFINE(HAVE_LDISKFS_IGET_WITH_FLAGS, 1,
243                 [if ldiskfs_iget takes a flags argument])
244 ])
245 EXTRA_KCFLAGS="$tmp_flags"
246 ]) # LB_LDISKFS_IGET_HAS_FLAGS_ARG
247
248 #
249 # LDISKFS_AC_PATCH_PROGRAM
250 #
251 # Determine which program should be used to apply the patches to
252 # the ext4 source code to produce the ldiskfs source code.
253 #
254 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
255         AC_ARG_ENABLE([quilt],
256                 [AC_HELP_STRING([--disable-quilt],
257                         [disable use of quilt for ldiskfs])],
258                 [AS_IF([test "x$enableval" = xno],
259                         [use_quilt=no],
260                         [use_quilt=maybe])],
261                 [use_quilt=maybe]
262         )
263
264         AS_IF([test x$use_quilt = xmaybe], [
265                 AC_PATH_PROG([quilt_avail], [quilt], [no])
266                 AS_IF([test x$quilt_avail = xno], [
267                         use_quilt=no
268                 ], [
269                         use_quilt=yes
270                 ])
271         ])
272
273         AS_IF([test x$use_quilt = xno], [
274                 AC_PATH_PROG([patch_avail], [patch], [no])
275                 AS_IF([test x$patch_avail = xno], [
276                         AC_MSG_ERROR([*** Need "quilt" or "patch" command])
277                 ])
278         ])
279 ]) # LDISKFS_AC_PATCH_PROGRAM
280
281 #
282 # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
283 #
284 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
285 # ext4: avoid declaring fs inconsistent due to invalid file handles
286 # __ext4_find_entry became a helper function for ext4_find_entry
287 # conflicting with previous ldiskfs patches.
288 # ldiskfs patches map ext4_find_entry to ldiskfs_find_entry_locked to
289 # avoid conflicting with __ext4_find_entry
290 #
291 # When the following check succeeds __ext4_find_entry helper is not
292 # used.
293 #
294 AC_DEFUN([LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS], [
295 tmp_flags="$EXTRA_KCFLAGS"
296 EXTRA_KCFLAGS="-Werror"
297 LB_CHECK_COMPILE([if __ldiskfs_find_entry is available],
298 ldiskfs_find_entry_locked, [
299         #include <linux/fs.h>
300         #include "$EXT4_SRC_DIR/ext4.h"
301         #include "$EXT4_SRC_DIR/namei.c"
302
303         static int __ext4_find_entry(void) { return 0; }
304 ],[
305         int x = __ext4_find_entry();
306         (void)x;
307 ],[
308         AC_DEFINE(HAVE___LDISKFS_FIND_ENTRY, 1,
309                 [if __ldiskfs_find_entry is available])
310 ])
311 EXTRA_KCFLAGS="$tmp_flags"
312 ]) # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
313
314 #
315 # LB_LDISKFSFS_DIRHASH_WANTS_DIR
316 #
317 # kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
318 # ext4fs_dirhash UNICODE support
319 #
320 AC_DEFUN([LB_LDISKFSFS_DIRHASH_WANTS_DIR], [
321 tmp_flags="$EXTRA_KCFLAGS"
322 EXTRA_KCFLAGS="-Werror"
323 LB_CHECK_COMPILE([if ldiskfsfs_dirhash takes an inode argument],
324 ext4fs_dirhash, [
325         #include <linux/fs.h>
326         #include "$EXT4_SRC_DIR/ext4.h"
327
328         int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
329                           struct dx_hash_info *hinfo)
330         {
331                 (void)dir;
332                 (void)name;
333                 (void)len;
334                 (void)hinfo;
335                 return 0;
336         }
337 ],[
338         int f = ext4fs_dirhash(NULL, NULL, 0, NULL);
339         (void)f;
340 ],[
341         AC_DEFINE(HAVE_LDISKFSFS_GETHASH_INODE_ARG, 1,
342                 [if ldiskfsfs_dirhash takes an inode argument])
343 ])
344 EXTRA_KCFLAGS="$tmp_flags"
345 ]) # LB_LDISKFSFS_DIRHASH_WANTS_DIR
346
347 #
348 # LB_CONFIG_LDISKFS
349 #
350 AC_DEFUN([LB_CONFIG_LDISKFS], [
351 # --with-ldiskfs is deprecated now that ldiskfs is fully merged with lustre.
352 # However we continue to support this option through Lustre 2.5.
353 AC_ARG_WITH([ldiskfs],
354         [],
355         [AC_MSG_WARN([--with-ldiskfs is deprecated, please use --enable-ldiskfs])
356         AS_IF([test x$withval != xyes -a x$withval != xno],
357                 [AC_MSG_ERROR([
358
359 The ldiskfs option is deprecated,
360 and no longer supports paths to external ldiskfs source
361 ])])
362 ])
363
364 AC_ARG_ENABLE([ldiskfs],
365         [AS_HELP_STRING([--disable-ldiskfs],
366                 [disable ldiskfs osd (default is enable)])],
367         [AS_IF([test x$enable_ldiskfs != xyes -a x$enable_ldiskfs != xno],
368                 [AC_MSG_ERROR([ldiskfs valid options are "yes" or "no"])])],
369         [AS_IF([test "${with_ldiskfs+set}" = set],
370                 [enable_ldiskfs=$with_ldiskfs],
371                 [enable_ldiskfs=maybe])
372 ])
373
374 AS_IF([test x$enable_server = xno],
375         [AS_CASE([$enable_ldiskfs],
376                 [maybe], [enable_ldiskfs=no],
377                 [yes], [AC_MSG_ERROR([cannot build ldiskfs when servers are disabled])]
378         )])
379
380 AS_IF([test x$enable_ldiskfs != xno],[
381         # In the future, we chould change enable_ldiskfs from maybe to
382         # either yes or no based on additional tests, e.g.  whether a patch
383         # set is available for the detected kernel.  For now, we just always
384         # set it to "yes".
385         AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes])
386         AC_SUBST(ENABLE_LDISKFS, yes)
387
388         LDISKFS_LINUX_SERIES
389         LDISKFS_AC_PATCH_PROGRAM
390         LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD
391         LB_EXT4_JOURNAL_START_3ARGS
392         LB_EXT4_BREAD_4ARGS
393         LB_EXT4_HAVE_INFO_DQUOT
394         LB_EXT4_HAVE_I_CRYPT_INFO
395         LB_LDISKFS_IGET_HAS_FLAGS_ARG
396         LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
397         LB_LDISKFSFS_DIRHASH_WANTS_DIR
398         AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs])
399         AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [fs security for ldiskfs])
400         AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [extened attributes for ldiskfs])
401         AC_DEFINE(CONFIG_LDISKFS_FS_RW, 1, [enable rw access for ldiskfs])
402         AC_SUBST(LDISKFS_SUBDIR, ldiskfs)
403         AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd)
404 ], [
405         AC_SUBST(ENABLE_LDISKFS, no)
406 ])
407
408 AC_MSG_CHECKING([whether to build ldiskfs])
409 AC_MSG_RESULT([$enable_ldiskfs])
410
411 AM_CONDITIONAL([LDISKFS_ENABLED], [test x$enable_ldiskfs = xyes])
412 ]) # LB_CONFIG_LDISKFS
413
414
415 AC_DEFUN([LB_EXT4_SRC_DIR_SRC], [])
416 AC_DEFUN([LB_EXT4_SRC_DIR_RESULTS], [])
417
418 #
419 # LB_VALIDATE_EXT4_SRC_DIR
420 #
421 # Spot check the existence of several source files common to ext4.
422 # Detecting this at configure time allows us to avoid a potential build
423 # failure and provide a useful error message to explain what is wrong.
424 #
425 AC_DEFUN([LB_VALIDATE_EXT4_SRC_DIR], [
426 enable_ldiskfs_build="no"
427 AS_IF([test -n "$EXT4_SRC_DIR"], [
428         enable_ldiskfs_build="yes"
429         LB_CHECK_FILE([$EXT4_SRC_DIR/dir.c], [], [
430                 enable_ldiskfs_build="no"
431                 AC_MSG_WARN([ext4 must exist for ldiskfs build])
432         ])
433         LB_CHECK_FILE([$EXT4_SRC_DIR/file.c], [], [
434                 enable_ldiskfs_build="no"
435                 AC_MSG_WARN([ext4 must exist for ldiskfs build])
436         ])
437         LB_CHECK_FILE([$EXT4_SRC_DIR/inode.c], [], [
438                 enable_ldiskfs_build="no"
439                 AC_MSG_WARN([ext4 must exist for ldiskfs build])
440         ])
441         LB_CHECK_FILE([$EXT4_SRC_DIR/super.c], [], [
442                 enable_ldiskfs_build="no"
443                 AC_MSG_WARN([ext4 must exist for ldiskfs build])
444         ])
445 ])
446
447 AS_IF([test "x$enable_ldiskfs_build" = xno], [
448         enable_ldiskfs="no"
449
450         AC_MSG_WARN([
451
452 Disabling ldiskfs support because complete ext4 source does not exist.
453
454 If you are building using kernel-devel packages and require ldiskfs
455 server support then ensure that the matching kernel-debuginfo-common
456 and kernel-debuginfo-common-<arch> packages are installed.
457 ])
458 ])
459 ]) # LB_VALIDATE_EXT4_SRC_DIR
460
461 #
462 # LB_EXT4_SRC_DIR
463 #
464 # Determine the location of the ext4 source code.  It it required
465 # for several configure tests and to build ldiskfs.
466 #
467 AC_DEFUN([LB_EXT4_SRC_DIR], [
468 AC_MSG_CHECKING([ext4 source directory])
469 # Kernel ext source located with devel headers
470 linux_src=$LINUX
471 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
472         EXT4_SRC_DIR="$linux_src/fs/ext4"
473 ], [
474         # Kernel ext source provided by kernel-debuginfo-common package
475         # that extracted to $LINUX
476         linux_src=$(ls -1d $linux_src/../../debug/*/linux-${LINUXRELEASE%.*}* \
477                 2>/dev/null | tail -1)
478         AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
479                 EXT4_SRC_DIR="$linux_src/fs/ext4"
480         ], [
481                 # Kernel ext source provided by kernel-debuginfo-common package
482                 linux_src=$(ls -1d /usr/src/debug/*/linux-${LINUXRELEASE%.*}* \
483                         2>/dev/null | tail -1)
484                 AS_IF([test -e "$linux_src/fs/ext4/super.c"], [
485                         EXT4_SRC_DIR="$linux_src/fs/ext4"
486                 ], [
487                         EXT4_SRC_DIR=""
488                 ])
489         ])
490 ])
491 AC_MSG_RESULT([$EXT4_SRC_DIR])
492 AC_SUBST(EXT4_SRC_DIR)
493
494 LB_VALIDATE_EXT4_SRC_DIR
495 ]) # LB_EXT4_SRC_DIR
496
497 #
498 # LB_DEFINE_E2FSPROGS_NAMES
499 #
500 # Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
501 #
502 AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES], [
503 AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
504 AC_ARG_WITH([ldiskfsprogs],
505         AC_HELP_STRING([--with-ldiskfsprogs],
506                 [use alternate names for ldiskfs-enabled e2fsprogs]),
507         [], [withval="no"])
508
509 AS_IF([test "x$withval" = xyes], [
510         AC_MSG_RESULT([enabled])
511         AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
512         E2FSPROGS="ldiskfsprogs"
513         MKE2FS="mkfs.ldiskfs"
514         DEBUGFS="debugfs.ldiskfs"
515         TUNE2FS="tunefs.ldiskfs"
516         E2LABEL="label.ldiskfs"
517         DUMPE2FS="dumpfs.ldiskfs"
518         E2FSCK="fsck.ldiskfs"
519         PFSCK="pfsck.ldiskfs"
520 ], [
521         AC_MSG_RESULT([disabled])
522         E2FSPROGS="e2fsprogs"
523         MKE2FS="mke2fs"
524         DEBUGFS="debugfs"
525         TUNE2FS="tune2fs"
526         E2LABEL="e2label"
527         DUMPE2FS="dumpe2fs"
528         E2FSCK="e2fsck"
529         PFSCK="fsck"
530 ])
531
532 AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
533 AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
534 AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
535 AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
536 AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
537 AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
538 AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
539 AC_DEFINE_UNQUOTED(PFSCK, "$PFSCK", [name of parallel fsck program])
540
541 AC_SUBST([E2FSPROGS], [$E2FSPROGS])
542 AC_SUBST([MKE2FS], [$MKE2FS])
543 AC_SUBST([DEBUGFS], [$DEBUGFS])
544 AC_SUBST([TUNE2FS], [$TUNE2FS])
545 AC_SUBST([E2LABEL], [$E2LABEL])
546 AC_SUBST([DUMPE2FS], [$DUMPE2FS])
547 AC_SUBST([E2FSCK], [$E2FSCK])
548 AC_SUBST([PFSCK], [$PFSCK])
549 ]) # LB_DEFINE_E2FSPROGS_NAMES