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=linux/version.h
9 ], [test -r ${utsrelease2} && fgrep -q UTS_RELEASE ${utsrelease2}], [
10 utsrelease=linux/utsrelease.h
11 ], [test -r ${utsrelease3} && fgrep -q UTS_RELEASE ${utsrelease3}], [
12 utsrelease=generated/utsrelease.h
15 AS_IF([test "${utsrelease}"], [
16 kernsrcver=$((echo "#include <$utsrelease>";
17 echo "kernsrcver=UTS_RELEASE") |
18 cpp -I ${LINUX_OBJ}/include |
19 grep "^kernsrcver=" | cut -d \" -f 2)
21 AS_IF([test -z "$kernsrcver"], [
22 AC_MSG_RESULT([Not found])
23 AC_MSG_ERROR([*** Cannot determine kernel version.])
26 AC_MSG_RESULT([Not found])
28 *** Cannot find UTS_RELEASE definition.
29 *** This is often provided by the kernel-devel package.])
32 AC_MSG_RESULT([${kernsrcver}])
34 LINUX_VERSION=${kernsrcver}
35 AC_SUBST(LINUX_VERSION)
36 LINUXRELEASE=${kernsrcver}
37 AC_SUBST(LINUXRELEASE)
43 # get the release version of linux
46 AC_DEFUN([LB_LINUX_RELEASE],
48 LDISKFS_AC_LINUX_VERSION
50 # ------------ RELEASE --------------------------------
51 AC_MSG_CHECKING([for ldiskfs release])
52 AC_ARG_WITH([release],
53 AC_HELP_STRING([--with-release=string],
54 [set the release string (default=$kvers_YYYYMMDDhhmm)]),
57 if test -n "$DOWNSTREAM_RELEASE"; then
58 RELEASE="${DOWNSTREAM_RELEASE}_"
60 RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID")
61 AC_MSG_RESULT($RELEASE)
64 # check is redhat/suse kernels
65 AC_MSG_CHECKING([that RedHat kernel])
66 LB_LINUX_TRY_COMPILE([
67 #include <linux/version.h>
69 #ifndef RHEL_RELEASE_CODE
70 #error "not redhat kernel"
79 LB_LINUX_CONFIG([SUSE_KERNEL],[SUSE_KERNEL="yes"],[])
83 # LB_ARG_REPLACE_PATH(PACKAGE, PATH)
84 AC_DEFUN([LB_ARG_REPLACE_PATH],[
86 eval "set x $ac_configure_args"
94 arg=$(printf %s\n ["$arg"] | \
95 sed "s/'/'\\\\\\\\''/g")
98 dnl AS_VAR_APPEND([new_configure_args], [" '$arg'"])
99 new_configure_args="$new_configure_args \"$arg\""
101 ac_configure_args=$new_configure_args
104 # this is the work-horse of the next function
105 AC_DEFUN([__LB_ARG_CANON_PATH], [
106 [$3]=$(readlink -f $with_$2)
107 LB_ARG_REPLACE_PATH([$1], $[$3])
110 # a front-end for the above function that transforms - and . in the
111 # PACKAGE portion of --with-PACKAGE into _ suitable for variable names
112 AC_DEFUN([LB_ARG_CANON_PATH], [
113 __LB_ARG_CANON_PATH([$1], m4_translit([$1], [-.], [__]), [$2])
120 # Find paths for linux, handling kernel-source rpms
122 AC_DEFUN([LB_LINUX_PATH],
123 [# prep some default values
124 for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
125 if readlink -q -e $DEFAULT_LINUX; then
129 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
130 PATHS="/lib/modules/$(uname -r)/build"
132 PATHS+=" $DEFAULT_LINUX"
133 for DEFAULT_LINUX_OBJ in $PATHS; do
134 if readlink -q -e $DEFAULT_LINUX_OBJ; then
138 AC_MSG_CHECKING([for Linux sources])
140 AC_HELP_STRING([--with-linux=path],
141 [set path to Linux source (default=/lib/modules/$(uname -r)/{source,build},/usr/src/linux)]),
142 [LB_ARG_CANON_PATH([linux], [LINUX])
143 DEFAULT_LINUX_OBJ=$LINUX],
144 [LINUX=$DEFAULT_LINUX])
145 AC_MSG_RESULT([$LINUX])
148 # -------- check for linux --------
149 LB_CHECK_FILE([$LINUX],[],
150 [AC_MSG_ERROR([Kernel source $LINUX could not be found.])])
152 # -------- linux objects (for 2.6) --
153 AC_MSG_CHECKING([for Linux objects dir])
154 AC_ARG_WITH([linux-obj],
155 AC_HELP_STRING([--with-linux-obj=path],
156 [set path to Linux objects dir (default=/lib/modules/$(uname -r)/build,/usr/src/linux)]),
157 [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])],
158 [LINUX_OBJ=$DEFAULT_LINUX_OBJ])
160 AC_MSG_RESULT([$LINUX_OBJ])
163 # -------- check for .config --------
164 AC_ARG_WITH([linux-config],
165 [AC_HELP_STRING([--with-linux-config=path],
166 [set path to Linux .conf (default=$LINUX_OBJ/.config)])],
167 [LB_ARG_CANON_PATH([linux-config], [LINUX_CONFIG])],
168 [LINUX_CONFIG=$LINUX_OBJ/.config])
169 AC_SUBST(LINUX_CONFIG)
171 LB_CHECK_FILE([/boot/kernel.h],
172 [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
173 [LB_CHECK_FILE([/var/adm/running-kernel.h],
174 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h'])])
176 AC_ARG_WITH([kernel-source-header],
177 AC_HELP_STRING([--with-kernel-source-header=path],
178 [Use a different kernel version header. Consult build/README.kernel-source for details.]),
179 [LB_ARG_CANON_PATH([kernel-source-header], [KERNEL_SOURCE_HEADER])])
181 # ------------ .config exists ----------------
182 LB_CHECK_FILE([$LINUX_CONFIG],[],
183 [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult build/README.kernel-source])])
185 # ----------- make dep run? ------------------
186 # at 2.6.19 # $LINUX/include/linux/config.h is removed
187 # and at more old has only one line
188 # include <autoconf.h>
189 LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated],
190 [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
191 [AC_MSG_ERROR([Run make config in $LINUX.])])])
192 AC_SUBST(AUTOCONF_HDIR)
193 LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[],
194 [AC_MSG_ERROR([Run make config in $LINUX.])])
196 # ----------- kconfig.h exists ---------------
197 # kernel 3.1, $LINUX/include/linux/kconfig.h is added
198 # see kernel commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
199 LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h],
200 [CONFIG_INCLUDE=include/linux/kconfig.h],
201 [CONFIG_INCLUDE=include/$AUTOCONF_HDIR/autoconf.h])
202 AC_SUBST(CONFIG_INCLUDE)
204 # ------------ rhconfig.h includes runtime-generated bits --
205 # red hat kernel-source checks
207 # we know this exists after the check above. if the user
208 # tarred up the tree and ran make dep etc. in it, then
209 # version.h gets overwritten with a standard linux one.
211 if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
212 # This is a clean kernel-source tree, we need to
213 # enable extensive workarounds to get this to build
215 LB_CHECK_FILE([$KERNEL_SOURCE_HEADER],
216 [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
217 AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
218 AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
219 AC_MSG_WARN([Consult build/README.kernel-source for details.])
221 [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult build/README.kernel-source for details.])])
222 EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
225 # --- check that we can build modules at all
226 AC_MSG_CHECKING([that modules can be built at all])
227 LB_LINUX_TRY_COMPILE([],[],[
231 AC_MSG_WARN([Consult config.log for details.])
232 AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
233 AC_MSG_ERROR([Kernel modules cannot be built.])
237 ]) # end of LB_LINUX_PATH
239 # LB_LINUX_SYMVERFILE
240 # SLES 9 uses a different name for this file - unsure about vanilla kernels
241 # around this version, but it matters for servers only.
242 AC_DEFUN([LB_LINUX_SYMVERFILE],
243 [AC_MSG_CHECKING([name of module symbol version file])
244 if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
245 SYMVERFILE=Modules.symvers
247 SYMVERFILE=Module.symvers
249 AC_MSG_RESULT($SYMVERFILE)
253 # these are like AC_TRY_COMPILE, but try to build modules against the
254 # kernel, inside the build directory
256 # LB_LANG_PROGRAM(C)([PROLOGUE], [BODY])
257 # --------------------------------------
258 m4_define([LB_LANG_PROGRAM],
260 #include <linux/kernel.h>
265 dnl Do *not* indent the following line: there may be CPP directives.
266 dnl Don't move the `;' right after for the same reason.
273 # LB_LINUX_COMPILE_IFELSE
275 # like AC_COMPILE_IFELSE
277 AC_DEFUN([LB_LINUX_COMPILE_IFELSE], [
278 m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])
279 rm -Rf build-test && mkdir -p build-test
280 echo "obj-m := conftest.o" >build-test/Makefile
282 [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])],
284 [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
291 # LB_LINUX_TRY_COMPILE
293 # like AC_TRY_COMPILE
295 AC_DEFUN([LB_LINUX_TRY_COMPILE],
296 [LB_LINUX_COMPILE_IFELSE(
297 [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
299 [test -s build-test/conftest.o],
305 # check if a given config option is defined
307 AC_DEFUN([LB_LINUX_CONFIG],[
308 AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
309 LB_LINUX_TRY_COMPILE([
310 #include <$AUTOCONF_HDIR/autoconf.h>
313 #error CONFIG_$1 not #defined
327 # check if a given config option is builtin or as module
329 AC_DEFUN([LB_LINUX_CONFIG_IM],[
330 AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
331 LB_LINUX_TRY_COMPILE([
332 #include <$AUTOCONF_HDIR/autoconf.h>
334 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
335 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
347 # LB_CHECK_SYMBOL_EXPORT
348 # check symbol exported or not
350 # $2 - file(s) for find.
354 # 2.6 based kernels - put modversion info into $LINUX/Module.modvers
356 AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
357 [AC_MSG_CHECKING([if Linux was built with symbol $1 exported])
358 grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
360 if test $rc -ne 0; then
363 grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null
365 if test $rc -eq 0; then
370 if test $export -eq 0; then
384 # Like AC_CHECK_HEADER but checks for a kernel-space header
386 m4_define([LB_CHECK_LINUX_HEADER],
387 [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
388 AC_CACHE_CHECK([for $1], ac_Header,
389 [LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
391 [test -s build-test/conftest.o],
392 [AS_VAR_SET(ac_Header, [yes])],
393 [AS_VAR_SET(ac_Header, [no])])])
394 AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl
395 AS_VAR_POPDEF([ac_Header])dnl
398 # LB_DOWNSTREAM_RELEASE
400 AC_DEFUN([LB_DOWNSTREAM_RELEASE],
401 [AC_ARG_WITH([downstream-release],
402 AC_HELP_STRING([--with-downstream-release=string],
403 [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]),
404 [DOWNSTREAM_RELEASE=$with_downstream_release],
406 # if not specified, see if it's in the META file
407 if test -f META; then
408 DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)
411 AC_SUBST(DOWNSTREAM_RELEASE)
417 # Check if the source is a GA release and if not, set a "BUILDID"
419 # Currently there are at least two ways/modes of/for doing this. One
420 # is if we are in a valid git repository, the other is if we are in a
421 # non-git source tree of some form. Building the latter from the former
422 # will be handled here.
423 AC_DEFUN([LB_BUILDID],
425 AC_MSG_CHECKING([for buildid])
427 if git branch >/dev/null 2>&1; then
430 ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags)
431 if [[[ $ver = *-*-* ]]]; then
437 # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]]
438 # here but the portability of the regex on the right is dismal
440 if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then
441 ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \
442 -e 's/_RC[[0-9]].*$//' -e 's/_/./g')
445 # a "lustre fix" value of .0 should be truncated
446 if [[[ $ver = *.*.*.0 ]]]; then
449 # ditto for a "lustre fix" value of _0
450 if [[[ $ver = v*_*_*_0 ]]]; then
453 if [[[ $ver = v*_*_* ]]]; then
458 if test "$ffw" != "0"; then
460 msg="$BUILDID (ahead by $ffw commits)"
461 AC_MSG_RESULT([$msg])
463 AC_MSG_RESULT([none... congratulations, you must be on a tag])
465 elif test -f META; then
466 BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
467 msg="$BUILDID (from META file)"
468 AC_MSG_RESULT([$msg])
470 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.])
478 # Check for file existance even when cross compiling
480 AC_DEFUN([LB_CHECK_FILE],
481 [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
482 AC_CACHE_CHECK([for $1], lb_File,
483 [if test -r "$1"; then
484 AS_VAR_SET(lb_File, yes)
486 AS_VAR_SET(lb_File, no)
488 AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
489 AS_VAR_POPDEF([lb_File])dnl
495 # add -include config.h
497 AC_DEFUN([LB_CONFIG_HEADERS],[
498 AC_CONFIG_HEADERS([config.h])
499 CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
500 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
501 AC_SUBST(EXTRA_KCFLAGS)
507 # checks on the C compiler
509 AC_DEFUN([LB_PROG_CC],
512 # --------- unsigned long long sane? -------
513 AC_CHECK_SIZEOF(unsigned long long, 0)
514 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
515 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
516 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
517 AC_MSG_ERROR([** we assume that sizeof(long long) == 8.])
520 if test $target_cpu == "powerpc64"; then
521 AC_MSG_WARN([set compiler with -m64])
522 CFLAGS="$CFLAGS -m64"
526 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
529 # Add _GNU_SOURCE for strnlen on linux
530 LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
533 CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
541 # Determine the location of the ext4 source code. It is required
542 # for several configure tests and to build ldiskfs.
544 AC_DEFUN([LB_LDISKFS_EXT_DIR],
546 # Kernel ext source located with devel headers
548 if test -e "$linux_src/fs/ext4/super.c"; then
549 EXT_DIR=$linux_src/fs/ext4
551 # Kernel ext source provided by kernel-debuginfo-common package
552 linux_src=$(ls -1d /usr/src/debug/*/linux-$LINUXRELEASE \
553 2>/dev/null | tail -1)
554 if test -e "$linux_src/fs/ext4/super.c"; then
555 EXT_DIR=$linux_src/fs/ext4
561 AC_MSG_CHECKING([ext4 source directory])
562 AC_MSG_RESULT([$EXT_DIR])
567 # LB_LDISKFS_EXT_SOURCE
569 # Spot check the existance of several source files common to ext4.
570 # Detecting this at configure time allows us to avoid a potential build
571 # failure and provide a useful error message to explain what is wrong.
573 AC_DEFUN([LB_LDISKFS_EXT_SOURCE],
575 if test x$EXT_DIR = x; then
576 enable_ldiskfs_build='no'
578 LB_CHECK_FILE([$EXT_DIR/dir.c], [], [
579 enable_ldiskfs_build='no'
580 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
581 LB_CHECK_FILE([$EXT_DIR/file.c], [], [
582 enable_ldiskfs_build='no'
583 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
584 LB_CHECK_FILE([$EXT_DIR/inode.c], [], [
585 enable_ldiskfs_build='no'
586 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
587 LB_CHECK_FILE([$EXT_DIR/super.c], [], [
588 enable_ldiskfs_build='no'
589 AC_MSG_WARN([ext4 must exist for ldiskfs build])])
592 if test x$enable_ldiskfs_build = xno; then
594 enable_ldiskfs_build='no'
600 Disabling server because complete ext4 source does not exist.
602 If you are building using kernel-devel packages and require ldiskfs
603 server support then ensure that the matching kernel-debuginfo-common
604 and kernel-debuginfo-common-<arch> packages are installed.
612 # LB_LDISKFS_DEFINE_OPTIONS
614 # Enable config options related to ldiskfs. These are used by ldiskfs,
615 # lvfs, and the osd-ldiskfs code (which includes ldiskfs headers.)
617 AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS],
619 LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET
621 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1,
622 [enable extended attributes for ldiskfs])
623 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1,
624 [enable posix acls for ldiskfs])
625 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1,
626 [enable fs security for ldiskfs])
627 AC_DEFINE(CONFIG_LDISKFSDEV_FS_POSIX_ACL, 1,
628 [enable posix acls for ldiskfs])
629 AC_DEFINE(CONFIG_LDISKFSDEV_FS_XATTR, 1,
630 [enable extented attributes for ldiskfs])
631 AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1,
632 [enable fs security for ldiskfs])
636 # Check for jbd2_journal_callback_set(), which is needed for commit
637 # callbacks. When LU-433 lands jbd2_journal_callback_set() will only
638 # remain for legacy reasons and AC_MSG_ERROR can be removed.
640 AC_DEFUN([LB_LDISKFS_JBD2_JOURNAL_CALLBACK_SET],
642 LB_CHECK_SYMBOL_EXPORT([jbd2_journal_callback_set],
644 [AC_DEFINE(HAVE_JBD2_JOURNAL_CALLBACK_SET, 1,
645 [kernel exports jbd2_journal_callback_set])])
649 AC_DEFUN([LB_LDISKFS_SYMVERS],
651 AC_MSG_CHECKING([ldiskfs module symbols])
652 if test -r $LDISKFS_OBJ/Module.symvers; then
653 LDISKFS_SYMBOLS=Module.symvers
654 elif test -r $LDISKFS_OBJ/Modules.symvers; then
655 LDISKFS_SYMBOLS=Modules.symvers
656 elif test -r $LDISKFS_OBJ/ldiskfs/Module.symvers; then
657 LDISKFS_SYMBOLS=Module.symvers
658 elif test -r $LDISKFS_OBJ/ldiskfs/Modules.symvers; then
659 LDISKFS_SYMBOLS=Modules.symvers
661 LDISKFS_SYMBOLS=$SYMVERFILE
664 AC_MSG_RESULT([$LDISKFS_SYMBOLS])
665 AC_SUBST(LDISKFS_SYMBOLS)
668 AC_DEFUN([LB_LDISKFS_RELEASE],
670 AC_MSG_CHECKING([ldiskfs source release])
671 if test -r $LDISKFS_OBJ/config.h; then
672 tmp_flags="$EXTRA_KCFLAGS"
673 EXTRA_KCFLAGS="-I$LDISKFS_DIR $EXTRA_KCFLAGS"
676 #undef PACKAGE_TARNAME
677 #undef PACKAGE_VERSION
678 #undef PACKAGE_STRING
679 #undef PACKAGE_BUGREPORT
684 #include <$LDISKFS_OBJ/config.h>
686 char *LDISKFS_RELEASE;
687 LDISKFS_RELEASE=VERSION;
689 $makerule LUSTRE_KERNEL_TEST=conftest.i
691 test -s build/conftest.i
693 eval $(grep "LDISKFS_RELEASE=" build/conftest.i)
695 AC_MSG_RESULT([unknown])
696 AC_MSG_ERROR([Could not preprocess test program.])
698 EXTRA_KCFLAGS="$tmp_flags"
700 elif test -r $LDISKFS_DIR/configure.ac; then
701 LDISKFS_RELEASE=$(awk '/AC\_INIT/ { print [$]3 }' \
702 $LDISKFS_DIR/configure.ac | tr ',' '\n')
704 AC_MSG_RESULT([unknown])
705 AC_MSG_ERROR([Could not locate config.h, META, or configure.ac to check release.])
708 if test x$LDISKFS_RELEASE = x; then
709 AC_MSG_RESULT([unknown])
710 AC_MSG_ERROR([Could not determine ldiskfs release.])
713 AC_MSG_RESULT([$LDISKFS_RELEASE])
714 AC_SUBST(LDISKFS_RELEASE)
717 AC_DEFUN([LB_LDISKFS_SERIES],
720 AC_MSG_CHECKING([which ldiskfs series to use])
721 case $LINUXRELEASE in
723 if test x$RHEL_KERNEL = xyes; then
724 LDISKFS_SERIES="2.6-rhel6.series"
726 if test x$SUSE_KERNEL = xyes; then
727 LDISKFS_SERIES="2.6-sles11.series"
731 AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])
735 AC_MSG_RESULT([$LDISKFS_SERIES])
739 AC_SUBST(LDISKFS_SERIES)
744 # LDISKFS_AC_PATCH_PROGRAM
746 # Determine which program should be used to apply the patches to
747 # the ext4 source code to produce the ldiskfs source code.
749 AC_DEFUN([LDISKFS_AC_PATCH_PROGRAM], [
750 AC_ARG_ENABLE([quilt],
751 [AC_HELP_STRING([--disable-quilt],
752 [disable use of quilt for ldiskfs])],
753 [AS_IF([test "x$enableval" = xno],
759 AS_IF([test x$use_quilt = xmaybe], [
760 AC_PATH_PROG([quilt_avail], [quilt], [no])
761 AS_IF([test x$quilt_avail = xno], [
768 AS_IF([test x$use_quilt = xno], [
769 AC_PATH_PROG([patch_avail], [patch], [no])
770 AS_IF([test x$patch_avail = xno], [
771 AC_MSG_ERROR([*** Need "quilt" or "patch" command])
775 AM_CONDITIONAL([USE_QUILT], [test x$use_quilt = xyes])