Whamcloud - gitweb
Land b1_2_smallfix onto b1_2 (20040616_1009)
[fs/lustre-release.git] / lustre / portals / archdep.m4
1 # -------- we can't build modules unless srcdir = builddir
2 if test x$enable_modules != xno ; then
3 AC_CHECK_FILE([autoMakefile.am],[],
4         [AC_MSG_ERROR([At this time, Lustre does not support building kernel modules with srcdir != buildir.])])
5 fi
6
7 # -------- in kernel compilation? (2.5 only) -------------
8 AC_MSG_CHECKING([if inkernel build support is requested])
9 AC_ARG_ENABLE([inkernel],
10         AC_HELP_STRING([--enable-inkernel],
11                        [set up 2.5 kernel makefiles]),
12         [],[enable_inkernel=no])
13 AC_MSG_RESULT([$enable_inkernel])
14 AM_CONDITIONAL(INKERNEL, test x$enable_inkernel = xyes)
15
16 # -------- are we building against an external portals? -------
17 AC_MSG_CHECKING([if Cray portals should be used])
18 AC_ARG_WITH([cray-portals],
19         AC_HELP_STRING([--with-cray-portals=path],
20                        [path to cray portals]),
21         [
22                 CRAY_PORTALS_INCLUDE="-I$with_cray_portals"
23                 AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
24         ],[with_cray_portals=no])
25 AC_MSG_RESULT([$with_cray_portals])
26 AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
27 if test x$enable_tests = xno ; then
28         AC_MSG_NOTICE([disabling tests])
29         enable_tests=no
30 fi
31 if test x$enable_utils = xno ; then
32         AC_MSG_NOTICE([disabling utilities])
33         enable_utils=no
34 fi
35
36 # -------- set linuxdir ------------
37 AC_MSG_CHECKING([for Linux sources])
38 AC_ARG_WITH([linux],
39         AC_HELP_STRING([--with-linux=path],
40                        [set path to Linux source (default=/usr/src/linux)]),
41         [LINUX=$with_linux],
42         [LINUX=/usr/src/linux])
43 AC_MSG_RESULT([$LINUX])
44 AC_SUBST(LINUX)
45 if test x$enable_inkernel = xyes ; then
46         echo ln -s `pwd` $LINUX/fs/lustre
47         rm $LINUX/fs/lustre
48         ln -s `pwd` $LINUX/fs/lustre
49 fi
50
51 # -------- check for .confg --------
52 AC_ARG_WITH([linux-config],
53         [AC_HELP_STRING([--with-linux-config=path],
54                         [set path to Linux .conf (default=\$LINUX/.config)])],
55         [LINUX_CONFIG=$with_linux_config],
56         [LINUX_CONFIG=$LINUX/.config])
57 AC_SUBST(LINUX_CONFIG)
58
59 AC_CHECK_FILE([/boot/kernel.h],
60         [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
61         [AC_CHECK_FILE([/var/adm/running-kernel.h]),
62                 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h']])
63
64 AC_ARG_WITH([kernel-source-header],
65         AC_HELP_STRING([--with-kernel-source-header=path],
66                         [Use a different kernel version header.  Consult README.kernel-source for details.]),
67         [KERNEL_SOURCE_HEADER=$with_kernel_source_header])
68
69 #  --------------------
70 ARCH_UM=
71 UML_CFLAGS=
72 if test x$enable_modules != xno ; then
73         AC_MSG_CHECKING([if you are running user mode linux for $host_cpu])
74         if test -e $LINUX/include/asm-um ; then
75                 if test  X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then
76                         ARCH_UM='ARCH=um'
77                         # see notes in Rules.in
78                         UML_CFLAGS='-O0'
79                         AC_MSG_RESULT(yes)
80                 else
81                         AC_MSG_RESULT([no (asm doesn't point at asm-um)])
82                 fi
83         else
84                 AC_MSG_RESULT([no (asm-um missing)])
85         fi
86 fi
87 AC_SUBST(ARCH_UM)
88 AC_SUBST(UML_CFLAGS)
89 # --------- Linux 25 ------------------
90
91 AC_CHECK_FILE([$LINUX/include/linux/namei.h],
92         [
93                 linux25="yes"
94                 KMODEXT=".ko"
95                 enable_ldiskfs="yes"
96         ],[
97                 KMODEXT=".o"
98                 linux25="no"
99         ])
100 AC_MSG_CHECKING([if you are using Linux 2.6])
101 AC_MSG_RESULT([$linux25])
102 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
103 AC_SUBST(KMODEXT)
104
105 AC_PATH_PROG(PATCH, patch, [no])
106 AC_PATH_PROG(QUILT, quilt, [no])
107 AM_CONDITIONAL(USE_QUILT, test x$QUILT = xno)
108
109 if test x$enable_ldiskfs$enable_modules = xyesyes ; then
110         if test x$PATCH$QUILT = xnono ; then
111                 AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
112         fi
113 fi
114
115 # -------  Makeflags ------------------
116
117 CPPFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE -I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include"
118
119 # liblustre are all the same
120 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
121 AC_SUBST(LLCPPFLAGS)
122
123 LLCFLAGS="-g -Wall -fPIC"
124 AC_SUBST(LLCFLAGS)
125
126 # everyone builds against portals and lustre
127
128 if test x$enable_ldiskfs = xyes ; then
129         AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
130         AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
131         AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls])
132         AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security])
133 fi
134
135 EXTRA_KCFLAGS="-g $CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE -I$PWD/portals/include -I$PWD/include"
136
137 # these are like AC_TRY_COMPILE, but try to build modules against the
138 # kernel, inside the kernel-tests directory
139
140 AC_DEFUN([LUSTRE_MODULE_CONFTEST],
141 [cat >conftest.c <<_ACEOF
142 $1
143 _ACEOF
144 ])
145
146 AC_DEFUN([LUSTRE_MODULE_COMPILE_IFELSE],
147 [m4_ifvaln([$1], [LUSTRE_MODULE_CONFTEST([$1])])dnl
148 rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.ko
149 AS_IF([AC_TRY_COMMAND(cp conftest.c kernel-tests && make [$2] -f $PWD/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM SUBDIRS=$PWD/kernel-tests) >/dev/null && AC_TRY_COMMAND([$3])],
150         [$4],
151         [_AC_MSG_LOG_CONFTEST
152 m4_ifvaln([$5],[$5])dnl])dnl
153 rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.mod.o kernel-tests/conftest.ko m4_ifval([$1], [kernel-tests/conftest.c conftest.c])[]dnl
154 ])
155
156 AC_DEFUN([LUSTRE_MODULE_TRY_COMPILE],
157 [LUSTRE_MODULE_COMPILE_IFELSE(
158         [AC_LANG_PROGRAM([[$1]], [[$2]])],
159         [modules],
160         [test -s kernel-tests/conftest.o],
161         [$3], [$4])])
162
163 AC_DEFUN([LUSTRE_MODULE_TRY_MAKE],
164 [LUSTRE_MODULE_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4], [$5], [$6])])
165
166 # ------------ include paths ------------------
167
168 if test x$enable_modules != xno ; then
169         # ------------ .config exists ----------------
170         AC_CHECK_FILE([$LINUX_CONFIG],[],
171                 [AC_MSG_ERROR([Kernel config could not be found.  If you are building from a kernel-source rpm consult README.kernel-source])])
172
173         # ----------- make dep run? ------------------
174         AC_CHECK_FILES([$LINUX/include/linux/autoconf.h
175                         $LINUX/include/linux/version.h
176                         $LINUX/include/linux/config.h],[],
177                 [AC_MSG_ERROR([Run make config in $LINUX.])])
178
179         # ------------ rhconfig.h includes runtime-generated bits --
180         # red hat kernel-source checks
181
182         # we know this exists after the check above.  if the user
183         # tarred up the tree and ran make dep etc. in it, then
184         # version.h gets overwritten with a standard linux one.
185
186         if grep rhconfig $LINUX/include/linux/version.h >/dev/null ; then
187                 # This is a clean kernel-source tree, we need to
188                 # enable extensive workarounds to get this to build
189                 # modules
190                 AC_CHECK_FILE([$KERNEL_SOURCE_HEADER],
191                         [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
192                                 AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
193                                 AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
194                                 AC_MSG_WARN([Consult README.kernel-source for details.])
195                         fi],
196                         [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found.  Consult README.kernel-source for details.])])
197                 EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
198         fi
199
200         # --- check that we can build modules at all
201         AC_MSG_CHECKING([that modules can be built])
202         LUSTRE_MODULE_TRY_COMPILE([],[],
203                 [
204                         AC_MSG_RESULT([yes])
205                 ],[
206                         AC_MSG_RESULT([no])
207                         AC_MSG_WARN([Consult config.log for details.])
208                         AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult README.kernel-source])
209                         AC_MSG_ERROR([Kernel modules could not be built.])
210                 ])
211
212         # ------------ LINUXRELEASE and moduledir ------------------
213         AC_MSG_CHECKING([for Linux release])
214         rm -f kernel-tests/conftest.i
215         LINUXRELEASE=
216         if test $linux25 = 'yes' ; then
217                 makerule="$PWD/kernel-tests"
218         else
219                 makerule="_dir_$PWD/kernel-tests"
220         fi
221         LUSTRE_MODULE_TRY_MAKE(
222                 [#include <linux/version.h>],
223                 [char *LINUXRELEASE;
224                  LINUXRELEASE=UTS_RELEASE;],
225                 [$makerule LUSTRE_KERNEL_TEST=conftest.i],
226                 [test -s kernel-tests/conftest.i],
227                 [
228                         # LINUXRELEASE="UTS_RELEASE"
229                         eval $(grep "LINUXRELEASE=" kernel-tests/conftest.i)
230                 ],[
231                         AC_MSG_RESULT([unknown])
232                         AC_MSG_ERROR([Could not preprocess test program.  Consult config.log for details.])
233                 ])
234         rm -f kernel-tests/conftest.i
235         if test x$LINUXRELEASE = x ; then
236                 AC_MSG_RESULT([unknown])
237                 AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
238         fi
239         AC_MSG_RESULT([$LINUXRELEASE])
240         AC_SUBST(LINUXRELEASE)
241
242         moduledir='$(libdir)/modules/'$LINUXRELEASE/kernel
243         AC_SUBST(moduledir)
244
245         modulefsdir='$(moduledir)/fs/$(PACKAGE)'
246         AC_SUBST(modulefsdir)
247
248         # ------------ RELEASE --------------------------------
249         AC_MSG_CHECKING([for Lustre release])
250         RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
251         AC_MSG_RESULT($RELEASE)
252         AC_SUBST(RELEASE)
253 fi
254
255 # ---------- Portals flags --------------------
256
257 #AC_PREFIX_DEFAULT([])
258 #if test "x$prefix" = xNONE || test "x$prefix" = x; then
259 #  usrprefix=/usr
260 #else
261 #  usrprefix='${prefix}'
262 #fi
263 #AC_SUBST(usrprefix)
264
265 AC_MSG_CHECKING([for zero-copy TCP support])
266 AC_ARG_ENABLE([zerocopy],
267         AC_HELP_STRING([--disable-zerocopy],
268                        [disable socknal zerocopy]),
269         [],[enable_zerocopy='yes'])
270 if test x$enable_zerocopy = xno ; then
271         AC_MSG_RESULT([no (by request)])
272 else
273         ZCCD="`grep -c zccd $LINUX/include/linux/skbuff.h`"
274         if test "$ZCCD" != 0 ; then
275                 AC_DEFINE(SOCKNAL_ZC, 1, [use zero-copy TCP])
276                 AC_MSG_RESULT(yes)
277         else
278                 AC_MSG_RESULT([no (no kernel support)])
279         fi
280 fi
281
282 AC_MSG_CHECKING([for CPU affinity support])
283 AC_ARG_ENABLE([affinity],
284         AC_HELP_STRING([--disable-affinity],
285                        [disable process/irq affinity]),
286         [],[enable_affinity='yes'])
287 if test x$enable_affinity = xno ; then
288         AC_MSG_RESULT([no (by request)])
289 else
290         SET_CPUS_ALLOW="`grep -c set_cpus_allowed $LINUX/kernel/softirq.c`"
291         if test "$SET_CPUS_ALLOW" != 0 ; then
292                 AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
293                 AC_MSG_RESULT([yes])
294         else
295                 AC_MSG_RESULT([no (no kernel support)])
296         fi
297 fi
298
299
300 #####################################
301
302 AC_MSG_CHECKING([if quadrics kernel headers are present])
303 if test -d $LINUX/drivers/net/qsnet ; then
304         AC_MSG_RESULT([yes])
305         QSWNAL="qswnal"
306         AC_MSG_CHECKING([for multirail EKC])
307         if test -f $LINUX/include/elan/epcomms.h; then
308                 AC_MSG_RESULT([supported])
309                 QSWCPPFLAGS="-DMULTIRAIL_EKC=1"
310         else
311                 AC_MSG_RESULT([not supported])
312                 QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
313         fi
314 else
315         AC_MSG_RESULT([no])
316         QSWNAL=""
317         QSWCPPFLAGS=""
318 fi
319 AC_SUBST(QSWCPPFLAGS)
320 AC_SUBST(QSWNAL)
321 AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
322
323 AC_MSG_CHECKING([if gm support was requested])
324 AC_ARG_WITH([gm],
325         AC_HELP_STRING([--with-gm=path],
326                        [build gmnal against path]),
327         [
328                 case $with_gm in 
329                         yes)
330                                 AC_MSG_RESULT([yes])
331                                 GMCPPFLAGS="-I/usr/local/gm/include"
332                                 GMNAL="gmnal"
333                                 ;;
334                         no)
335                                 AC_MSG_RESULT([no])
336                                 GMCPPFLAGS=""
337                                 GMNAL=""
338                                 ;;
339                         *)
340                                 AC_MSG_RESULT([yes])
341                                 GMCPPFLAGS="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
342                                 GMNAL="gmnal"
343                                 ;;
344                 esac
345         ],[
346                 AC_MSG_RESULT([no])
347                 GMCPPFLAGS=""
348                 GMNAL=""
349         ])
350 AC_SUBST(GMCPPFLAGS)
351 AC_SUBST(GMNAL)
352 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
353
354 #fixme: where are the default IB includes?
355 default_ib_include_dir=/usr/local/ib/include
356 an_ib_include_file=vapi.h
357
358 AC_MSG_CHECKING([if ib nal support was requested])
359 AC_ARG_WITH([ib],
360         AC_HELP_STRING([--with-ib=yes/no/path],
361                        [Path to IB includes]),
362         [
363                 case $with_ib in
364                         yes)
365                                 AC_MSG_RESULT([yes])
366                                 IBCPPFLAGS="-I/usr/local/ib/include"
367                                 IBNAL="ibnal"
368                                 ;;
369                         no)
370                                 AC_MSG_RESULT([no])
371                                 IBCPPFLAGS=""
372                                 IBNAL=""
373                                 ;;
374                         *)
375                                 AC_MSG_RESULT([yes])
376                                 IBCPPFLAGS="-I$with_ib"
377                                 IBNAL=""
378                                 ;;
379                 esac
380         ],[
381                 AC_MSG_RESULT([no])
382                 IBFLAGS=""
383                 IBNAL=""
384         ])
385 AC_SUBST(IBNAL)
386 AC_SUBST(IBCPPFLAGS)
387 AM_CONDITIONAL(BUILD_IBNAL, test x$IBNAL = "xibnal")
388
389 def_scamac=/opt/scali/include
390 AC_MSG_CHECKING([if ScaMAC support was requested])
391 AC_ARG_WITH([scamac],
392         AC_HELP_STRING([--with-scamac=yes/no/path],
393                        [Path to ScaMAC includes (default=/opt/scali/include)]),
394         [
395                 case $with_scamac in
396                         yes)
397                                 AC_MSG_RESULT([yes])
398                                 SCIMACCPPFLAGS="-I/opt/scali/include"
399                                 SCIMACNAL="scimacnal"
400                                 ;;
401                         no)
402                                 AC_MSG_RESULT([no])
403                                 SCIMACCPPFLAGS=""
404                                 SCIMACNAL=""
405                                 ;;
406                         *)
407                                 AC_MSG_RESULT([yes])
408                                 SCIMACCPPFLAGS="-I$with_scamac -I$with_scamac/icm"
409                                 SCIMACNAL="scimacnal"
410                                 ;;
411                 esac
412         ],[
413                 AC_MSG_RESULT([no])
414                 SCIMACCPPFLAGS=""
415                 SCIMACNAL=""
416         ])
417 AC_SUBST(SCIMACCPPFLAGS)
418 AC_SUBST(SCIMACNAL)
419 AM_CONDITIONAL(BUILD_SCIMACNAL, test x$SCIMACNAL = "xscimacnal")
420 # if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then
421
422 AC_SUBST(MOD_LINK)
423 AC_SUBST(LINUX25)
424
425 # ---------- Red Hat 2.4.18 has iobuf->dovary --------------
426 # But other kernels don't
427
428 AC_MSG_CHECKING([if struct kiobuf has a dovary field])
429 LUSTRE_MODULE_TRY_COMPILE(
430         [
431                 #include <linux/iobuf.h>
432         ],[
433                 struct kiobuf iobuf;
434                 iobuf.dovary = 1;
435         ],[
436                 AC_MSG_RESULT([yes])
437                 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
438         ],[
439                 AC_MSG_RESULT([no])
440         ])
441
442 # ----------- 2.6.4 no longer has page->list ---------------
443 AC_MSG_CHECKING([if struct page has a list field])
444 LUSTRE_MODULE_TRY_COMPILE(
445         [
446                 #include <linux/mm.h>
447         ],[
448                 struct page page;
449                 &page.list;
450         ],[
451                 AC_MSG_RESULT([yes])
452                 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
453         ],[
454                 AC_MSG_RESULT([no])
455         ])
456
457 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
458 # This needs to run after we've defined the KCPPFLAGS
459
460 AC_MSG_CHECKING([if task_struct has a sighand field])
461 LUSTRE_MODULE_TRY_COMPILE(
462         [
463                 #include <linux/sched.h>
464         ],[
465                 struct task_struct p;
466                 p.sighand = NULL;
467         ],[
468                 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
469                 AC_MSG_RESULT([yes])
470         ],[
471                 AC_MSG_RESULT([no])
472         ])
473
474 # ---------- 2.4.20 introduced cond_resched --------------
475
476 AC_MSG_CHECKING([if kernel offers cond_resched])
477 LUSTRE_MODULE_TRY_COMPILE(
478         [
479                 #include <linux/sched.h>
480         ],[
481                 cond_resched();
482         ],[
483                 AC_MSG_RESULT([yes])
484                 AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
485         ],[
486                 AC_MSG_RESULT([no])
487         ])
488
489 # ---------- Red Hat 2.4.21 backports some more 2.5 bits --------
490
491 AC_MSG_CHECKING([if kernel defines PDE])
492 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
493 if test "$HAVE_PDE" != 0 ; then
494         AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
495         AC_MSG_RESULT([yes])
496 else
497         AC_MSG_RESULT([no])
498 fi
499
500 AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
501 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
502 if test "$HAVE_DIO_FILE" != 0 ; then
503         AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
504         AC_MSG_RESULT(yes)
505 else
506         AC_MSG_RESULT(no)
507 fi
508
509 if test x$enable_modules != xno ; then
510         # ---------- modules? ------------------------
511         AC_MSG_CHECKING([for module support])
512         LUSTRE_MODULE_TRY_COMPILE(
513                 [
514                         #include <linux/config.h>
515                 ],[
516                         #ifndef CONFIG_MODULES
517                         #error CONFIG_MODULES not #defined
518                         #endif
519                 ],[
520                         AC_MSG_RESULT([yes])
521                 ],[
522                         AC_MSG_RESULT([no])
523                         AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
524                 ])
525
526         # ---------- modversions? --------------------
527         AC_MSG_CHECKING([for MODVERSIONS])
528         LUSTRE_MODULE_TRY_COMPILE(
529                 [
530                         #include <linux/config.h>
531                 ],[
532                         #ifndef CONFIG_MODVERSIONS
533                         #error CONFIG_MODVERSIONS not #defined
534                         #endif
535                 ],[
536                         AC_MSG_RESULT([yes])
537                 ],[
538                         AC_MSG_RESULT([no])
539                 ])
540
541         # ------------ preempt -----------------------
542         AC_MSG_CHECKING([if preempt is enabled])
543         LUSTRE_MODULE_TRY_COMPILE(
544                 [
545                         #include <linux/config.h>
546                 ],[
547                         #ifndef CONFIG_PREEMPT
548                         #error CONFIG_PREEMPT is not #defined
549                         #endif
550                 ],[
551                         AC_MSG_RESULT([yes])
552                         AC_MSG_ERROR([Lustre does not support kernels with preempt enabled.])
553                 ],[
554                         AC_MSG_RESULT([no])
555                 ])
556
557         if test $BACKINGFS = 'ext3' ; then
558                 # --- Check that ext3 and ext3 xattr are enabled in the kernel
559                 AC_MSG_CHECKING([that ext3 is enabled in the kernel])
560                 LUSTRE_MODULE_TRY_COMPILE(
561                         [
562                                 #include <linux/config.h>
563                         ],[
564                                 #ifndef CONFIG_EXT3_FS
565                                 #ifndef CONFIG_EXT3_FS_MODULE
566                                 #error CONFIG_EXT3_FS not #defined
567                                 #endif
568                                 #endif
569                         ],[
570                                 AC_MSG_RESULT([yes])
571                         ],[
572                                 AC_MSG_RESULT([no])
573                                 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
574                         ])
575
576                 AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
577                 LUSTRE_MODULE_TRY_COMPILE(
578                         [
579                                 #include <linux/config.h>
580                         ],[
581                                 #ifndef CONFIG_EXT3_FS_XATTR
582                                 #error CONFIG_EXT3_FS_XATTR not #defined
583                                 #endif
584                         ],[
585                                 AC_MSG_RESULT([yes])
586                         ],[
587                                 AC_MSG_RESULT([no])
588                                 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR.)])
589                                 AC_MSG_WARN([This build may fail.])
590                         ])
591         fi # BACKINGFS = ext3
592 fi
593
594 CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
595 EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
596 AC_SUBST(EXTRA_KCFLAGS)
597
598 #echo "KCPPFLAGS: $KCPPFLAGS"
599 #echo "KCFLAGS: $KCFLAGS"
600 #echo "LLCPPFLAGS: $LLCPPFLAGS"
601 #echo "LLCFLAGS: $LLCFLAGS"
602 #echo "MOD_LINK: $MOD_LINK"
603 #echo "CFLAGS: $CFLAGS"
604 #echo "CPPFLAGS: $CPPFLAGS"