1 AC_DEFUN([LDISKFS_AC_LINUX_VERSION], [
2 AC_MSG_CHECKING([kernel source version])
4 utsrelease1=${LINUX_OBJ}/include/linux/version.h
5 utsrelease2=${LINUX_OBJ}/include/linux/utsrelease.h
6 utsrelease3=${LINUX_OBJ}/include/generated/utsrelease.h
7 AS_IF([test -r ${utsrelease1} && fgrep -q UTS_RELEASE ${utsrelease1}], [
8 utsrelease=${utsrelease1}
9 ], [test -r ${utsrelease2} && fgrep -q UTS_RELEASE ${utsrelease2}], [
10 utsrelease=${utsrelease2}
11 ], [test -r ${utsrelease3} && fgrep -q UTS_RELEASE ${utsrelease3}], [
12 utsrelease=${utsrelease3}
15 AS_IF([test ! -z "${utsrelease}"], [
16 UTS_RELEASE=$(awk -F \" '/ UTS_RELEASE / { print [$]2 }' \
18 AS_IF([test -z "$UTS_RELEASE"], [
19 AC_MSG_RESULT([Not found])
20 AC_MSG_ERROR([*** Cannot determine kernel version.])
23 AC_MSG_RESULT([Not found])
25 *** Cannot find UTS_RELEASE definition.
26 *** This is often provided by the kernel-devel package.])
29 AC_MSG_RESULT([${UTS_RELEASE}])
31 LINUX_VERSION=${UTS_RELEASE}
32 AC_SUBST(LINUX_VERSION)
33 LINUXRELEASE=${UTS_RELEASE}
34 AC_SUBST(LINUXRELEASE)
40 # get the release version of linux
43 AC_DEFUN([LB_LINUX_RELEASE],
45 LDISKFS_AC_LINUX_VERSION
47 # ------------ RELEASE --------------------------------
48 AC_MSG_CHECKING([for ldiskfs release])
49 AC_ARG_WITH([release],
50 AC_HELP_STRING([--with-release=string],
51 [set the release string (default=$kvers_YYYYMMDDhhmm)]),
54 if test -n "$DOWNSTREAM_RELEASE"; then
55 RELEASE="${DOWNSTREAM_RELEASE}_"
57 RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID")
58 AC_MSG_RESULT($RELEASE)
61 # check is redhat/suse kernels
62 AC_MSG_CHECKING([for RedHat kernel version])
63 AS_IF([fgrep -q RHEL_RELEASE ${LINUX_OBJ}/include/linux/version.h], [
65 RHEL_RELEASE=$(expr 0$(awk -F \" '/ RHEL_RELEASE / { print [$]2 }' \
66 ${LINUX_OBJ}/include/linux/version.h) + 1)
67 KERNEL_VERSION=$(sed -e 's/\(@<:@23@:>@\.@<:@0-9@:>@*\.@<:@0-9@:>@*\).*/\1/' <<< ${LINUXRELEASE})
68 RHEL_KERNEL_VERSION=${KERNEL_VERSION}-${RHEL_RELEASE}
69 AC_SUBST(RHEL_KERNEL_VERSION)
70 AC_MSG_RESULT([${RHEL_KERNEL_VERSION}])
72 AC_MSG_RESULT([not found])
73 LB_LINUX_CONFIG([SUSE_KERNEL],[SUSE_KERNEL="yes"],[])
77 # LB_ARG_REPLACE_PATH(PACKAGE, PATH)
78 AC_DEFUN([LB_ARG_REPLACE_PATH],[
80 eval "set x $ac_configure_args"
88 arg=$(printf %s\n ["$arg"] | \
89 sed "s/'/'\\\\\\\\''/g")
92 dnl AS_VAR_APPEND([new_configure_args], [" '$arg'"])
93 new_configure_args="$new_configure_args \"$arg\""
95 ac_configure_args=$new_configure_args
98 # this is the work-horse of the next function
99 AC_DEFUN([__LB_ARG_CANON_PATH], [
100 [$3]=$(readlink -f $with_$2)
101 LB_ARG_REPLACE_PATH([$1], $[$3])
104 # a front-end for the above function that transforms - and . in the
105 # PACKAGE portion of --with-PACKAGE into _ suitable for variable names
106 AC_DEFUN([LB_ARG_CANON_PATH], [
107 __LB_ARG_CANON_PATH([$1], m4_translit([$1], [-.], [__]), [$2])
114 # Find paths for linux, handling kernel-source rpms
116 AC_DEFUN([LB_LINUX_PATH],
117 [# prep some default values
118 for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
119 if readlink -q -e $DEFAULT_LINUX; then
123 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
124 PATHS="/lib/modules/$(uname -r)/build"
126 PATHS+=" $DEFAULT_LINUX"
127 for DEFAULT_LINUX_OBJ in $PATHS; do
128 if readlink -q -e $DEFAULT_LINUX_OBJ; then
132 AC_MSG_CHECKING([for Linux sources])
134 AC_HELP_STRING([--with-linux=path],
135 [set path to Linux source (default=/lib/modules/$(uname -r)/{source,build},/usr/src/linux)]),
136 [LB_ARG_CANON_PATH([linux], [LINUX])
137 DEFAULT_LINUX_OBJ=$LINUX],
138 [LINUX=$DEFAULT_LINUX])
139 AC_MSG_RESULT([$LINUX])
142 # -------- check for linux --------
143 LB_CHECK_FILE([$LINUX],[],
144 [AC_MSG_ERROR([Kernel source $LINUX could not be found.])])
146 # -------- linux objects (for 2.6) --
147 AC_MSG_CHECKING([for Linux objects dir])
148 AC_ARG_WITH([linux-obj],
149 AC_HELP_STRING([--with-linux-obj=path],
150 [set path to Linux objects dir (default=/lib/modules/$(uname -r)/build,/usr/src/linux)]),
151 [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])],
152 [LINUX_OBJ=$DEFAULT_LINUX_OBJ])
154 AC_MSG_RESULT([$LINUX_OBJ])
157 # -------- check for .config --------
158 AC_ARG_WITH([linux-config],
159 [AC_HELP_STRING([--with-linux-config=path],
160 [set path to Linux .conf (default=$LINUX_OBJ/.config)])],
161 [LB_ARG_CANON_PATH([linux-config], [LINUX_CONFIG])],
162 [LINUX_CONFIG=$LINUX_OBJ/.config])
163 AC_SUBST(LINUX_CONFIG)
165 LB_CHECK_FILE([/boot/kernel.h],
166 [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
167 [LB_CHECK_FILE([/var/adm/running-kernel.h],
168 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h'])])
170 AC_ARG_WITH([kernel-source-header],
171 AC_HELP_STRING([--with-kernel-source-header=path],
172 [Use a different kernel version header. Consult build/README.kernel-source for details.]),
173 [LB_ARG_CANON_PATH([kernel-source-header], [KERNEL_SOURCE_HEADER])])
175 # ------------ .config exists ----------------
176 LB_CHECK_FILE([$LINUX_CONFIG],[],
177 [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult build/README.kernel-source])])
179 # ----------- make dep run? ------------------
180 # at 2.6.19 # $LINUX/include/linux/config.h is removed
181 # and at more old has only one line
182 # include <autoconf.h>
183 LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated],
184 [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
185 [AC_MSG_ERROR([Run make config in $LINUX.])])])
186 AC_SUBST(AUTOCONF_HDIR)
187 LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[],
188 [AC_MSG_ERROR([Run make config in $LINUX.])])
190 # ----------- kconfig.h exists ---------------
191 # kernel 3.1, $LINUX/include/linux/kconfig.h is added
192 # see kernel commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
193 LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h],
194 [CONFIG_INCLUDE=include/linux/kconfig.h],
195 [CONFIG_INCLUDE=include/$AUTOCONF_HDIR/autoconf.h])
196 AC_SUBST(CONFIG_INCLUDE)
198 # ------------ rhconfig.h includes runtime-generated bits --
199 # red hat kernel-source checks
201 # we know this exists after the check above. if the user
202 # tarred up the tree and ran make dep etc. in it, then
203 # version.h gets overwritten with a standard linux one.
205 if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
206 # This is a clean kernel-source tree, we need to
207 # enable extensive workarounds to get this to build
209 LB_CHECK_FILE([$KERNEL_SOURCE_HEADER],
210 [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
211 AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
212 AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
213 AC_MSG_WARN([Consult build/README.kernel-source for details.])
215 [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult build/README.kernel-source for details.])])
216 EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
219 # --- check that we can build modules at all
220 AC_MSG_CHECKING([that modules can be built at all])
221 LB_LINUX_TRY_COMPILE([],[],[
225 AC_MSG_WARN([Consult config.log for details.])
226 AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
227 AC_MSG_ERROR([Kernel modules cannot be built.])
231 ]) # end of LB_LINUX_PATH
233 # LB_LINUX_SYMVERFILE
234 # SLES 9 uses a different name for this file - unsure about vanilla kernels
235 # around this version, but it matters for servers only.
236 AC_DEFUN([LB_LINUX_SYMVERFILE],
237 [AC_MSG_CHECKING([name of module symbol version file])
238 if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
239 SYMVERFILE=Modules.symvers
241 SYMVERFILE=Module.symvers
243 AC_MSG_RESULT($SYMVERFILE)
247 # these are like AC_TRY_COMPILE, but try to build modules against the
248 # kernel, inside the build directory
250 # LB_LANG_PROGRAM(C)([PROLOGUE], [BODY])
251 # --------------------------------------
252 m4_define([LB_LANG_PROGRAM],
254 #include <linux/kernel.h>
259 dnl Do *not* indent the following line: there may be CPP directives.
260 dnl Don't move the `;' right after for the same reason.
267 # LB_LINUX_COMPILE_IFELSE
269 # like AC_COMPILE_IFELSE
271 AC_DEFUN([LB_LINUX_COMPILE_IFELSE], [
272 m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])
273 rm -Rf build-test && mkdir -p build-test
274 echo "obj-m := conftest.o" >build-test/Makefile
276 [AC_TRY_COMMAND(cp conftest.c build-test && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" M=$PWD/build-test) >/dev/null && AC_TRY_COMMAND([$3])],
278 [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
285 # LB_LINUX_TRY_COMPILE
287 # like AC_TRY_COMPILE
289 AC_DEFUN([LB_LINUX_TRY_COMPILE],
290 [LB_LINUX_COMPILE_IFELSE(
291 [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
293 [test -s build-test/conftest.o],
299 # check if a given config option is defined
301 AC_DEFUN([LB_LINUX_CONFIG],[
302 AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
303 LB_LINUX_TRY_COMPILE([
304 #include <$AUTOCONF_HDIR/autoconf.h>
307 #error CONFIG_$1 not #defined
321 # check if a given config option is builtin or as module
323 AC_DEFUN([LB_LINUX_CONFIG_IM],[
324 AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
325 LB_LINUX_TRY_COMPILE([
326 #include <$AUTOCONF_HDIR/autoconf.h>
328 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
329 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
341 # LB_CHECK_SYMBOL_EXPORT
342 # check symbol exported or not
344 # $2 - file(s) for find.
348 # 2.6 based kernels - put modversion info into $LINUX/Module.modvers
350 AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
351 [AC_MSG_CHECKING([if Linux was built with symbol $1 exported])
352 grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
354 if test $rc -ne 0; then
357 grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null
359 if test $rc -eq 0; then
364 if test $export -eq 0; then
378 # Like AC_CHECK_HEADER but checks for a kernel-space header
380 m4_define([LB_CHECK_LINUX_HEADER],
381 [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
382 AC_CACHE_CHECK([for $1], ac_Header,
383 [LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
385 [test -s build-test/conftest.o],
386 [AS_VAR_SET(ac_Header, [yes])],
387 [AS_VAR_SET(ac_Header, [no])])])
388 AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl
389 AS_VAR_POPDEF([ac_Header])dnl
392 # LB_DOWNSTREAM_RELEASE
394 AC_DEFUN([LB_DOWNSTREAM_RELEASE],
395 [AC_ARG_WITH([downstream-release],
396 AC_HELP_STRING([--with-downstream-release=string],
397 [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]),
398 [DOWNSTREAM_RELEASE=$with_downstream_release],
400 # if not specified, see if it's in the META file
401 if test -f META; then
402 DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)
405 AC_SUBST(DOWNSTREAM_RELEASE)
411 # Check if the source is a GA release and if not, set a "BUILDID"
413 # Currently there are at least two ways/modes of/for doing this. One
414 # is if we are in a valid git repository, the other is if we are in a
415 # non-git source tree of some form. Building the latter from the former
416 # will be handled here.
417 AC_DEFUN([LB_BUILDID],
419 AC_MSG_CHECKING([for buildid])
421 if git branch >/dev/null 2>&1; then
424 ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags)
425 if [[[ $ver = *-*-* ]]]; then
431 # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]]
432 # here but the portability of the regex on the right is dismal
434 if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then
435 ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \
436 -e 's/_RC[[0-9]].*$//' -e 's/_/./g')
439 # a "lustre fix" value of .0 should be truncated
440 if [[[ $ver = *.*.*.0 ]]]; then
443 # ditto for a "lustre fix" value of _0
444 if [[[ $ver = v*_*_*_0 ]]]; then
447 if [[[ $ver = v*_*_* ]]]; then
452 if test "$ffw" != "0"; then
454 msg="$BUILDID (ahead by $ffw commits)"
455 AC_MSG_RESULT([$msg])
457 AC_MSG_RESULT([none... congratulations, you must be on a tag])
459 elif test -f META; then
460 BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
461 msg="$BUILDID (from META file)"
462 AC_MSG_RESULT([$msg])
464 AC_MSG_WARN([FIXME: I don't know how to deal with source trees outside of git that don't have a META file. Not setting a buildid.])
472 # Check for file existance even when cross compiling
474 AC_DEFUN([LB_CHECK_FILE],
475 [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
476 AC_CACHE_CHECK([for $1], lb_File,
477 [if test -r "$1"; then
478 AS_VAR_SET(lb_File, yes)
480 AS_VAR_SET(lb_File, no)
482 AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
483 AS_VAR_POPDEF([lb_File])dnl
489 # add -include config.h
491 AC_DEFUN([LB_CONFIG_HEADERS],[
492 AC_CONFIG_HEADERS([config.h ldiskfs/ldiskfs_config.h])
493 CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
494 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
495 AC_SUBST(EXTRA_KCFLAGS)
501 # checks on the C compiler
503 AC_DEFUN([LB_PROG_CC],
506 # --------- unsigned long long sane? -------
507 AC_CHECK_SIZEOF(unsigned long long, 0)
508 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
509 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
510 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
511 AC_MSG_ERROR([** we assume that sizeof(long long) == 8.])
514 if test $target_cpu == "powerpc64"; then
515 AC_MSG_WARN([set compiler with -m64])
516 CFLAGS="$CFLAGS -m64"
520 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
523 # Add _GNU_SOURCE for strnlen on linux
524 LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
527 CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
535 # Determine the location of the ext4 source code. It is required
536 # for several configure tests and to build ldiskfs.
538 AC_DEFUN([LB_LDISKFS_EXT_DIR],
540 # Kernel ext source located with devel headers
542 if test -e "$linux_src/fs/ext4/super.c"; then
543 EXT_DIR=$linux_src/fs/ext4
545 # Kernel ext source provided by kernel-debuginfo-common package
546 linux_src=$(ls -1d /usr/src/debug/*/linux-$LINUXRELEASE \
547 2>/dev/null | tail -1)
548 if test -e "$linux_src/fs/ext4/super.c"; then
549 EXT_DIR=$linux_src/fs/ext4
555 AC_MSG_CHECKING([ext4 source directory])
556 AC_MSG_RESULT([$EXT_DIR])
561 # LB_LDISKFS_EXT_SOURCE
563 # Spot check the existance of several source files common to ext4.
564 # Detecting this at configure time allows us to avoid a potential build
565 # failure and provide a useful error message to explain what is wrong.
567 AC_DEFUN([LB_LDISKFS_EXT_SOURCE],
569 if test x$EXT_DIR = x; then
570 enable_ldiskfs_build='no'
572 LB_CHECK_FILE([$EXT_DIR/dir.c], [], [
573 enable_ldiskfs_build='no'
574 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
575 LB_CHECK_FILE([$EXT_DIR/file.c], [], [
576 enable_ldiskfs_build='no'
577 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
578 LB_CHECK_FILE([$EXT_DIR/inode.c], [], [
579 enable_ldiskfs_build='no'
580 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
581 LB_CHECK_FILE([$EXT_DIR/super.c], [], [
582 enable_ldiskfs_build='no'
583 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
586 if test x$enable_ldiskfs_build = xno; then
588 enable_ldiskfs_build='no'
594 Disabling server because complete ext4 source does not exist.
596 If you are building using kernel-devel packages and require ldiskfs
597 server support then ensure that the matching kernel-debuginfo-common
598 and kernel-debuginfo-common-<arch> packages are installed.
605 AC_DEFUN([LB_LDISKFS_SYMVERS],
607 AC_MSG_CHECKING([ldiskfs module symbols])
608 if test -r $LDISKFS_OBJ/Module.symvers; then
609 LDISKFS_SYMBOLS=Module.symvers
610 elif test -r $LDISKFS_OBJ/Modules.symvers; then
611 LDISKFS_SYMBOLS=Modules.symvers
612 elif test -r $LDISKFS_OBJ/ldiskfs/Module.symvers; then
613 LDISKFS_SYMBOLS=Module.symvers
614 elif test -r $LDISKFS_OBJ/ldiskfs/Modules.symvers; then
615 LDISKFS_SYMBOLS=Modules.symvers
617 LDISKFS_SYMBOLS=$SYMVERFILE
620 AC_MSG_RESULT([$LDISKFS_SYMBOLS])
621 AC_SUBST(LDISKFS_SYMBOLS)
624 AC_DEFUN([LB_LDISKFS_SERIES],
628 AC_MSG_CHECKING([which ldiskfs series to use])
631 AS_IF([test x$RHEL_KERNEL = xyes], [
632 AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32-343],[
633 AS_VERSION_COMPARE([$RHEL_KERNEL_VERSION],[2.6.32],[],
634 [SER="2.6-rhel6.series"],[SER="2.6-rhel6.series"])],
635 [SER="2.6-rhel6.4.series"],[SER="2.6-rhel6.4.series"])
636 ], [test x$SUSE_KERNEL = xyes], [
637 AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
638 AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
639 [SER="2.6-sles11.series"],[SER="2.6-sles11.series"])],
640 [SER="3.0-sles11.series"],[SER="3.0-sles11.series"])
644 AS_IF([test -z "$LDISKFS_SERIES"],
645 [AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])])
646 AC_MSG_RESULT([$LDISKFS_SERIES])
648 AC_SUBST(LDISKFS_SERIES)
652 # 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
654 AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD],
655 [AC_MSG_CHECKING([if ext4_free_blocks needs struct buffer_head])
656 LB_LINUX_TRY_COMPILE([
657 #include <linux/fs.h>
658 #include "$EXT_DIR/ext4.h"
660 ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
663 AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
664 [ext4_free_blocks do not require struct buffer_head])
671 # 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
673 AC_DEFUN([LB_EXT_PBLOCK],
674 [AC_MSG_CHECKING([if kernel has ext_pblocks])
675 LB_LINUX_TRY_COMPILE([
676 #include <linux/fs.h>
677 #include "$EXT_DIR/ext4_extents.h"
682 AC_DEFINE(HAVE_EXT_PBLOCK, 1,
683 [kernel has ext_pblocks])
690 # LDISKFS_AC_PATCH_PROGRAM
692 # Determine which program should be used to apply the patches to
693 # the ext4 source code to produce the ldiskfs source code.
695 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
696 AC_ARG_ENABLE([quilt],
697 [AC_HELP_STRING([--disable-quilt],
698 [disable use of quilt for ldiskfs])],
699 [AS_IF([test "x$enableval" = xno],
705 AS_IF([test x$use_quilt = xmaybe], [
706 AC_PATH_PROG([quilt_avail], [quilt], [no])
707 AS_IF([test x$quilt_avail = xno], [
714 AS_IF([test x$use_quilt = xno], [
715 AC_PATH_PROG([patch_avail], [patch], [no])
716 AS_IF([test x$patch_avail = xno], [
717 AC_MSG_ERROR([*** Need "quilt" or "patch" command])
721 AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])