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