Whamcloud - gitweb
7757d01798385087e69b50f354bde3f6e9d32f93
[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, [https://bugzilla.lustre.org/])
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.5*) LDISKFS_SERIES="2.6-suse.series" ;;
120 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
121 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
122 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
123 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
124 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
125 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
126 2.6.18*)
127         if test x$RHEL_KENEL = xyes; then
128                 if test x$enable_ext4 = xyes; then
129                         LDISKFS_SERIES="2.6-rhel5-ext4.series"
130                 else
131                         LDISKFS_SERIES="2.6-rhel5.series"
132                 fi
133         else
134                 LDISKFS_SERIES="2.6.18-vanilla.series"
135         fi
136         ;;
137 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
138 2.6.27*) LDISKFS_SERIES="2.6-sles11.series";;
139 2.6.32*) LDISKFS_SERIES="2.6-rhel6.series";;
140 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
141 esac
142 AC_MSG_RESULT([$LDISKFS_SERIES])
143 fi
144 AC_SUBST(LDISKFS_SERIES)
145
146 AC_SUBST(ac_configure_args)
147
148 LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
149                        [fs/dcache.c],
150                        [AC_DEFINE(HAVE_D_REHASH_COND, 1,
151                                   [d_rehash_cond is exported by the kernel])],
152                                   [])
153
154 LB_CHECK_SYMBOL_EXPORT([__d_rehash],
155                        [fs/dcache.c],
156                        [AC_DEFINE(HAVE___D_REHASH, 1,
157                                   [__d_rehash is exported by the kernel])],
158                                   [])
159
160 LB_CONFIG_FILES
161 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
162
163 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
164 AC_SUBST(MOSTLYCLEANFILES)
165
166 AC_OUTPUT