Whamcloud - gitweb
79651c4f76fb93e5da759d04bb1eab2d67799ca8
[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.0.6, [https://bugzilla.lustre.org/])
4 AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
5
6 # Don't look for install-sh, etc. in ..
7 AC_CONFIG_AUX_DIR([.])
8
9 AC_CANONICAL_SYSTEM
10
11 AM_INIT_AUTOMAKE
12
13 AC_PROG_CC
14
15 LB_CANONICAL_SYSTEM
16 LB_INCLUDE_RULES
17 LB_PROG_CC
18
19
20 #
21 # LC_TARGET_SUPPORTED
22 #
23 # is the target os supported?
24 #
25 AC_DEFUN([LC_TARGET_SUPPORTED],
26 [case $target_os in
27         linux* | darwin*)
28 $1
29                 ;;
30         *)
31 $2
32                 ;;
33 esac
34 ])
35
36
37 AC_MSG_CHECKING([whether to build kernel modules])
38 AC_ARG_ENABLE([modules],
39               AC_HELP_STRING([--disable-modules],
40                              [disable building of Lustre kernel modules]),[],
41                              [LC_TARGET_SUPPORTED([enable_modules='yes'],
42                              [enable_modules='no'])])
43 AC_MSG_RESULT([$enable_modules])
44
45 if test x$enable_modules = xyes ; then
46         LB_PROG_LINUX
47 if test x$linux25 = xyes ; then
48         LB_LINUX_MODPOST
49 fi
50 fi
51
52 LB_CONFIG_HEADERS
53
54 # These allow Lustre Makefiles and autoMakefiles to be used unchanged.
55 AM_CONDITIONAL(MODULES, true)
56 AM_CONDITIONAL(LINUX, true)
57 AM_CONDITIONAL(DARWIN, true)
58 AM_CONDITIONAL(LINUX25, true)
59
60 LDISKFSDIR="$PWD/ldiskfs"
61 AC_SUBST(LDISKFSDIR)
62
63 AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
64 AC_ARG_ENABLE([quilt],
65               AC_HELP_STRING([--disable-quilt],
66                              [disable use of quilt for ldiskfs]),[],
67                              [enable_quilt='yes'])
68 AC_MSG_RESULT([$enable_quilt])
69
70 AC_PATH_PROG(PATCH, patch, [no])
71
72 if test x$enable_quilt = xno ; then
73     QUILT="no"
74 else
75     AC_PATH_PROG(QUILT, quilt, [no])
76 fi
77
78 if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
79         AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
80 fi
81
82 AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
83
84 LB_DEFINE_LDISKFS_OPTIONS
85
86 AC_MSG_CHECKING([which ldiskfs series to use])
87 case $LINUXRELEASE in
88 2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
89 2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
90 2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
91 2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
92 2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
93 2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
94 2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
95 2.6.18*)
96         if test x$RHEL_KENEL = xyes; then
97                 LDISKFS_SERIES="2.6-rhel5.series"
98         else
99                 LDISKFS_SERIES="2.6.18-vanilla.series"
100         fi
101         ;;
102 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";;
103 *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
104 esac
105 AC_MSG_RESULT([$LDISKFS_SERIES])
106 AC_SUBST(LDISKFS_SERIES)
107
108 AC_SUBST(ac_configure_args)
109
110 LB_CHECK_SYMBOL_EXPORT([d_rehash_cond],
111                        [fs/dcache.c],
112                        [AC_DEFINE(HAVE_D_REHASH_COND, 1,
113                                   [d_rehash_cond is exported by the kernel])],
114                                   [])
115
116 LB_CHECK_SYMBOL_EXPORT([__d_rehash],
117                        [fs/dcache.c],
118                        [AC_DEFINE(HAVE___D_REHASH, 1,
119                                   [__d_rehash is exported by the kernel])],
120                                   [])
121
122 LB_CHECK_SYMBOL_EXPORT([d_move_locked],
123                        [fs/dcache.c],
124                        [AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
125                                   [d_move_locked is exported by the kernel])],
126                                   [])
127
128 LB_CHECK_SYMBOL_EXPORT([__d_move],
129                        [fs/dcache.c],
130                        [AC_DEFINE(HAVE___D_MOVE, 1,
131                                   [__d_move exported by the kernel])],
132                                   [])
133
134 LB_CONFIG_FILES
135 AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
136
137 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.*'
138 AC_SUBST(MOSTLYCLEANFILES)
139
140 AC_OUTPUT