1 # Process this file with autoconf to produce a configure script.
3 AC_INIT([Lustre ldiskfs], 3.0.9, [https://bugzilla.lustre.org/])
4 AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
6 # Don't look for install-sh, etc. in ..
23 # is the target os supported?
25 AC_DEFUN([LC_TARGET_SUPPORTED],
36 AC_DEFUN([LC_KERNEL_WITH_EXT4],
37 [if test -f $LINUX/fs/ext4/ext4.h ; then
44 AC_MSG_CHECKING([whether to build kernel modules])
45 AC_ARG_ENABLE([modules],
46 AC_HELP_STRING([--disable-modules],
47 [disable building of Lustre kernel modules]),[],
48 [LC_TARGET_SUPPORTED([enable_modules='yes'],
49 [enable_modules='no'])])
50 AC_MSG_RESULT([$enable_modules])
52 if test x$enable_modules = xyes ; then
54 if test x$linux25 = xyes ; then
61 # These allow Lustre Makefiles and autoMakefiles to be used unchanged.
62 AM_CONDITIONAL(MODULES, true)
63 AM_CONDITIONAL(LINUX, true)
64 AM_CONDITIONAL(DARWIN, true)
65 AM_CONDITIONAL(LINUX25, true)
67 LDISKFSDIR="$PWD/ldiskfs"
70 AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
71 AC_ARG_ENABLE([quilt],
72 AC_HELP_STRING([--disable-quilt],
73 [disable use of quilt for ldiskfs]),[],
75 AC_MSG_RESULT([$enable_quilt])
77 AC_PATH_PROG(PATCH, patch, [no])
79 if test x$enable_quilt = xno ; then
82 AC_PATH_PROG(QUILT, quilt, [no])
85 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
86 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
89 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
91 LB_DEFINE_LDISKFS_OPTIONS
93 AC_MSG_CHECKING([whether to build ldiskfs based on ext4])
94 if test x$RHEL_KERNEL = xyes; then
96 AC_HELP_STRING([--enable-ext4],
97 [enable building of ldiskfs based on ext4]),
98 [], [enable_ext4='no'])
100 case $LINUXRELEASE in
101 # ext4 was in 2.6.22-2.6.26 but not stable enough to use
102 2.6.2[0-6]*) enable_ext4='no' ;;
103 *) LC_KERNEL_WITH_EXT4([enable_ext4='yes'],
104 [enable_ext4='no']) ;;
107 AC_MSG_RESULT([$enable_ext4])
109 if test x$enable_ext4 = xyes ; then
110 AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [ldiskfs based on ext4])
117 BACKFSU=${BACKFS/ext/EXT}
118 AC_SUBST(BACKFSU) # We need a Upper string
120 AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
122 AC_MSG_CHECKING([which ldiskfs series to use])
123 case $LINUXRELEASE in
124 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
125 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
126 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
127 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
128 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
129 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
130 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
132 if test x$RHEL_KENEL = xyes; then
133 if test x$enable_ext4 = xyes; then
134 LDISKFS_SERIES="2.6-rhel5-ext4.series"
136 LDISKFS_SERIES="2.6-rhel5.series"
139 LDISKFS_SERIES="2.6.18-vanilla.series"
142 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
143 2.6.27*) LDISKFS_SERIES="2.6-sles11.series";;
144 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
146 AC_MSG_RESULT([$LDISKFS_SERIES])
147 AC_SUBST(LDISKFS_SERIES)
149 AC_SUBST(ac_configure_args)
151 LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
153 [AC_DEFINE(HAVE_D_REHASH_COND, 1,
154 [d_rehash_cond is exported by the kernel])],
157 LB_CHECK_SYMBOL_EXPORT([__d_rehash],
159 [AC_DEFINE(HAVE___D_REHASH, 1,
160 [__d_rehash is exported by the kernel])],
163 LB_CHECK_SYMBOL_EXPORT([d_move_locked],
165 [AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
166 [d_move_locked is exported by the kernel])],
169 LB_CHECK_SYMBOL_EXPORT([__d_move],
171 [AC_DEFINE(HAVE___D_MOVE, 1,
172 [__d_move exported by the kernel])],
176 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
178 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
179 AC_SUBST(MOSTLYCLEANFILES)