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