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