Whamcloud - gitweb
LU-723 ldiskfs: remove ext3 RHEL5 kernel series
[fs/lustre-release.git] / ldiskfs / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 AC_INIT([Lustre ldiskfs], 3.3.0, [http://bugs.whamcloud.com/])
4 AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
5 ldiskfs_is_ext4=yes
6
7 # Don't look for install-sh, etc. in ..
8 AC_CONFIG_AUX_DIR([.])
9
10 AC_CANONICAL_SYSTEM
11
12 AM_INIT_AUTOMAKE([1.9 tar-ustar])
13
14 AC_PROG_CC
15
16 LB_CANONICAL_SYSTEM
17
18 LB_DOWNSTREAM_RELEASE
19
20 LB_BUILDID
21
22 LB_INCLUDE_RULES
23 LB_PROG_CC
24
25 AC_ARG_ENABLE([dist],
26         AC_HELP_STRING([--enable-dist],
27                         [only configure enough for make dist]),
28         [enable_dist='yes'],[enable_dist='no'])
29 AC_MSG_RESULT([$enable_dist])
30 if test x$enable_dist != xno; then
31         enable_modules='no'
32 fi
33
34 #
35 # LC_TARGET_SUPPORTED
36 #
37 # is the target os supported?
38 #
39 AC_DEFUN([LC_TARGET_SUPPORTED],
40 [case $target_os in
41         linux* | darwin*)
42 $1
43                 ;;
44         *)
45 $2
46                 ;;
47 esac
48 ])
49
50
51 AC_MSG_CHECKING([whether to build kernel modules])
52 AC_ARG_ENABLE([modules],
53               AC_HELP_STRING([--disable-modules],
54                              [disable building of Lustre kernel modules]),[],
55                              [LC_TARGET_SUPPORTED([enable_modules='yes'],
56                              [enable_modules='no'])])
57 AC_MSG_RESULT([$enable_modules])
58
59 if test x$enable_modules = xyes ; then
60         LB_PROG_LINUX
61 if test x$linux25 = xyes ; then
62         LB_LINUX_MODPOST
63 fi
64 fi
65
66 LB_CONFIG_HEADERS
67
68 # These allow Lustre Makefiles and autoMakefiles to be used unchanged.
69 AM_CONDITIONAL(MODULES, true)
70 AM_CONDITIONAL(LINUX, true)
71 AM_CONDITIONAL(DARWIN, true)
72 AM_CONDITIONAL(LINUX25, true)
73
74 LDISKFSDIR="$PWD/ldiskfs"
75 AC_SUBST(LDISKFSDIR)
76
77 AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
78 AC_ARG_ENABLE([quilt],
79               AC_HELP_STRING([--disable-quilt],
80                              [disable use of quilt for ldiskfs]),[],
81                              [enable_quilt='yes'])
82 AC_MSG_RESULT([$enable_quilt])
83
84 AC_PATH_PROG(PATCH, patch, [no])
85
86 if test x$enable_quilt = xno ; then
87     QUILT="no"
88 else
89     AC_PATH_PROG(QUILT, quilt, [no])
90 fi
91
92 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
93         AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
94 fi
95
96 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
97
98 LB_DEFINE_LDISKFS_OPTIONS
99
100 LB_HAVE_EXT4_ENABLED
101
102 if test x$enable_ext4 = xyes ; then
103         AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [ldiskfs based on ext4])
104         BACKFS=ext4
105 else
106         BACKFS=ext3
107 fi
108
109 AC_SUBST(BACKFS)
110 BACKFSU=${BACKFS/ext/EXT}
111 AC_SUBST(BACKFSU) # We need a Upper string
112
113 AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes)
114
115 if test x$enable_dist != xyes; then
116         # don't need to do this if only configuring for make dist
117 AC_MSG_CHECKING([which ldiskfs series to use])
118 case $LINUXRELEASE in
119 2.6.18*)
120         if test x$RHEL_KERNEL = xyes; then
121                 LDISKFS_SERIES="2.6-rhel5-ext4.series"
122         fi
123         ;;
124 2.6.32*)
125         if test x$RHEL_KERNEL = xyes; then
126                  LDISKFS_SERIES="2.6-rhel6.series"
127         fi
128         ;;
129 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
130 esac
131 AC_MSG_RESULT([$LDISKFS_SERIES])
132 fi
133 AC_SUBST(LDISKFS_SERIES)
134
135 AC_SUBST(ac_configure_args)
136
137
138 LB_CONFIG_FILES
139 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
140
141 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
142 AC_SUBST(MOSTLYCLEANFILES)
143
144 AC_OUTPUT