Whamcloud - gitweb
b=3119
[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                 if test -d $LINUX/drivers/net/qsnet/include; then
310                         QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
311                 else
312                         QSWCPPFLAGS="-I$LINUX/include/linux"
313                 fi
314         fi
315 else
316         AC_MSG_RESULT([no])
317         QSWNAL=""
318         QSWCPPFLAGS=""
319 fi
320 AC_SUBST(QSWCPPFLAGS)
321 AC_SUBST(QSWNAL)
322 AM_CONDITIONAL(BUILD_QSWNAL, test x$QSWNAL = "xqswnal")
323
324 AC_MSG_CHECKING([if gm support was requested])
325 AC_ARG_WITH([gm],
326         AC_HELP_STRING([--with-gm=path],
327                        [build gmnal against path]),
328         [
329                 case $with_gm in 
330                         yes)
331                                 AC_MSG_RESULT([yes])
332                                 GMCPPFLAGS="-I/usr/local/gm/include"
333                                 GMNAL="gmnal"
334                                 ;;
335                         no)
336                                 AC_MSG_RESULT([no])
337                                 GMCPPFLAGS=""
338                                 GMNAL=""
339                                 ;;
340                         *)
341                                 AC_MSG_RESULT([yes])
342                                 GMCPPFLAGS="-I$with_gm/include -I$with_gm/drivers -I$with_gm/drivers/linux/gm"
343                                 GMNAL="gmnal"
344                                 ;;
345                 esac
346         ],[
347                 AC_MSG_RESULT([no])
348                 GMCPPFLAGS=""
349                 GMNAL=""
350         ])
351 AC_SUBST(GMCPPFLAGS)
352 AC_SUBST(GMNAL)
353 AM_CONDITIONAL(BUILD_GMNAL, test x$GMNAL = "xgmnal")
354
355 #fixme: where are the default IB includes?
356 default_ib_include_dir=/usr/local/ib/include
357 an_ib_include_file=vapi.h
358
359 AC_MSG_CHECKING([if ib nal support was requested])
360 AC_ARG_WITH([ib],
361         AC_HELP_STRING([--with-ib=yes/no/path],
362                        [Path to IB includes]),
363         [
364                 case $with_ib in
365                         yes)
366                                 AC_MSG_RESULT([yes])
367                                 IBCPPFLAGS="-I/usr/local/ib/include"
368                                 IBNAL="ibnal"
369                                 ;;
370                         no)
371                                 AC_MSG_RESULT([no])
372                                 IBCPPFLAGS=""
373                                 IBNAL=""
374                                 ;;
375                         *)
376                                 AC_MSG_RESULT([yes])
377                                 IBCPPFLAGS="-I$with_ib"
378                                 IBNAL=""
379                                 ;;
380                 esac
381         ],[
382                 AC_MSG_RESULT([no])
383                 IBFLAGS=""
384                 IBNAL=""
385         ])
386 AC_SUBST(IBNAL)
387 AC_SUBST(IBCPPFLAGS)
388 AM_CONDITIONAL(BUILD_IBNAL, test x$IBNAL = "xibnal")
389
390 def_scamac=/opt/scali/include
391 AC_MSG_CHECKING([if ScaMAC support was requested])
392 AC_ARG_WITH([scamac],
393         AC_HELP_STRING([--with-scamac=yes/no/path],
394                        [Path to ScaMAC includes (default=/opt/scali/include)]),
395         [
396                 case $with_scamac in
397                         yes)
398                                 AC_MSG_RESULT([yes])
399                                 SCIMACCPPFLAGS="-I/opt/scali/include"
400                                 SCIMACNAL="scimacnal"
401                                 ;;
402                         no)
403                                 AC_MSG_RESULT([no])
404                                 SCIMACCPPFLAGS=""
405                                 SCIMACNAL=""
406                                 ;;
407                         *)
408                                 AC_MSG_RESULT([yes])
409                                 SCIMACCPPFLAGS="-I$with_scamac -I$with_scamac/icm"
410                                 SCIMACNAL="scimacnal"
411                                 ;;
412                 esac
413         ],[
414                 AC_MSG_RESULT([no])
415                 SCIMACCPPFLAGS=""
416                 SCIMACNAL=""
417         ])
418 AC_SUBST(SCIMACCPPFLAGS)
419 AC_SUBST(SCIMACNAL)
420 AM_CONDITIONAL(BUILD_SCIMACNAL, test x$SCIMACNAL = "xscimacnal")
421 # if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then
422
423 AC_SUBST(MOD_LINK)
424 AC_SUBST(LINUX25)
425
426 # ---------- Red Hat 2.4.18 has iobuf->dovary --------------
427 # But other kernels don't
428
429 AC_MSG_CHECKING([if struct kiobuf has a dovary field])
430 LUSTRE_MODULE_TRY_COMPILE(
431         [
432                 #include <linux/iobuf.h>
433         ],[
434                 struct kiobuf iobuf;
435                 iobuf.dovary = 1;
436         ],[
437                 AC_MSG_RESULT([yes])
438                 AC_DEFINE(HAVE_KIOBUF_DOVARY, 1, [struct kiobuf has a dovary field])
439         ],[
440                 AC_MSG_RESULT([no])
441         ])
442
443 # ----------- 2.6.4 no longer has page->list ---------------
444 AC_MSG_CHECKING([if struct page has a list field])
445 LUSTRE_MODULE_TRY_COMPILE(
446         [
447                 #include <linux/mm.h>
448         ],[
449                 struct page page;
450                 &page.list;
451         ],[
452                 AC_MSG_RESULT([yes])
453                 AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
454         ],[
455                 AC_MSG_RESULT([no])
456         ])
457
458 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
459 # This needs to run after we've defined the KCPPFLAGS
460
461 AC_MSG_CHECKING([for kernel version])
462 LUSTRE_MODULE_TRY_COMPILE(
463         [
464                 #include <linux/sched.h>
465         ],[
466                 struct task_struct p;
467                 p.sighand = NULL;
468         ],[
469                 AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
470                 AC_MSG_RESULT([redhat-2.4.20])
471         ],[
472                 AC_MSG_RESULT([$LINUXRELEASE])
473         ])
474
475 # ---------- Red Hat 2.4.21 backports some more 2.5 bits --------
476
477 AC_MSG_CHECKING([if kernel defines PDE])
478 HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
479 if test "$HAVE_PDE" != 0 ; then
480         AC_DEFINE(HAVE_PDE, 1, [the kernel defines PDE])
481         AC_MSG_RESULT([yes])
482 else
483         AC_MSG_RESULT([no])
484 fi
485
486 AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
487 HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
488 if test "$HAVE_DIO_FILE" != 0 ; then
489         AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
490         AC_MSG_RESULT(yes)
491 else
492         AC_MSG_RESULT(no)
493 fi
494
495 if test x$enable_modules != xno ; then
496         # ---------- modules? ------------------------
497         AC_MSG_CHECKING([for module support])
498         LUSTRE_MODULE_TRY_COMPILE(
499                 [
500                         #include <linux/config.h>
501                 ],[
502                         #ifndef CONFIG_MODULES
503                         #error CONFIG_MODULES not #defined
504                         #endif
505                 ],[
506                         AC_MSG_RESULT([yes])
507                 ],[
508                         AC_MSG_RESULT([no])
509                         AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
510                 ])
511
512         # ---------- modversions? --------------------
513         AC_MSG_CHECKING([for MODVERSIONS])
514         LUSTRE_MODULE_TRY_COMPILE(
515                 [
516                         #include <linux/config.h>
517                 ],[
518                         #ifndef CONFIG_MODVERSIONS
519                         #error CONFIG_MODVERSIONS not #defined
520                         #endif
521                 ],[
522                         AC_MSG_RESULT([yes])
523                 ],[
524                         AC_MSG_RESULT([no])
525                 ])
526
527         # ------------ preempt -----------------------
528         AC_MSG_CHECKING([if preempt is enabled])
529         LUSTRE_MODULE_TRY_COMPILE(
530                 [
531                         #include <linux/config.h>
532                 ],[
533                         #ifndef CONFIG_PREEMPT
534                         #error CONFIG_PREEMPT is not #defined
535                         #endif
536                 ],[
537                         AC_MSG_RESULT([yes])
538                         AC_MSG_ERROR([Lustre does not support kernels with preempt enabled.])
539                 ],[
540                         AC_MSG_RESULT([no])
541                 ])
542
543         if test $BACKINGFS = 'ext3' ; then
544                 # --- Check that ext3 and ext3 xattr are enabled in the kernel
545                 AC_MSG_CHECKING([that ext3 is enabled in the kernel])
546                 LUSTRE_MODULE_TRY_COMPILE(
547                         [
548                                 #include <linux/config.h>
549                         ],[
550                                 #ifndef CONFIG_EXT3_FS
551                                 #ifndef CONFIG_EXT3_FS_MODULE
552                                 #error CONFIG_EXT3_FS not #defined
553                                 #endif
554                                 #endif
555                         ],[
556                                 AC_MSG_RESULT([yes])
557                         ],[
558                                 AC_MSG_RESULT([no])
559                                 AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
560                         ])
561
562                 AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
563                 LUSTRE_MODULE_TRY_COMPILE(
564                         [
565                                 #include <linux/config.h>
566                         ],[
567                                 #ifndef CONFIG_EXT3_FS_XATTR
568                                 #error CONFIG_EXT3_FS_XATTR not #defined
569                                 #endif
570                         ],[
571                                 AC_MSG_RESULT([yes])
572                         ],[
573                                 AC_MSG_RESULT([no])
574                                 AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR.)])
575                                 AC_MSG_WARN([This build may fail.])
576                         ])
577         fi # BACKINGFS = ext3
578 fi
579
580 CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
581 EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
582 AC_SUBST(EXTRA_KCFLAGS)
583
584 #echo "KCPPFLAGS: $KCPPFLAGS"
585 #echo "KCFLAGS: $KCFLAGS"
586 #echo "LLCPPFLAGS: $LLCPPFLAGS"
587 #echo "LLCFLAGS: $LLCFLAGS"
588 #echo "MOD_LINK: $MOD_LINK"
589 #echo "CFLAGS: $CFLAGS"
590 #echo "CPPFLAGS: $CPPFLAGS"