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