Whamcloud - gitweb
Branch b1_8
[fs/lustre-release.git] / build / autoconf / lustre-build-linux.m4
1 #
2 # LB_LINUX_VERSION
3 #
4 # Set things accordingly for a 2.5 kernel
5 #
6 AC_DEFUN([LB_LINUX_VERSION],
7 [LB_CHECK_FILE([$LINUX/include/linux/namei.h],
8         [
9                 linux25="yes"
10                 KMODEXT=".ko"
11         ],[
12                 KMODEXT=".o"
13                 linux25="no"
14         ])
15 AC_MSG_CHECKING([if you are using Linux 2.6])
16 AC_MSG_RESULT([$linux25])
17
18 MODULE_TARGET="SUBDIRS"
19 if test $linux25 = "yes" ; then
20         makerule="$PWD/build"
21         AC_MSG_CHECKING([for external module build support])
22         rm -f build/conftest.i
23         LB_LINUX_TRY_MAKE([],[],
24                 [$makerule LUSTRE_KERNEL_TEST=conftest.i],
25                 [test -s build/conftest.i],
26                 [
27                         AC_MSG_RESULT([no])
28                 ],[
29                         makerule="_module_$makerule"
30                         MODULE_TARGET="M"
31                         LB_LINUX_TRY_MAKE([],[],
32                                 [$makerule LUSTRE_KERNEL_TEST=conftest.i],
33                                 [test -s build/conftest.i],
34                                 [
35                                         AC_MSG_RESULT([yes])
36                                 ],[
37                                         AC_MSG_ERROR([unknown; check config.log for details])
38                                 ])
39                 ])
40 else
41         makerule="_dir_$PWD/build"
42 fi
43
44 AC_SUBST(MODULE_TARGET)
45 AC_SUBST(linux25)
46 AC_SUBST(KMODEXT)
47 ])
48
49 #
50 # LB_LINUX_RELEASE
51 #
52 # get the release version of linux
53 #
54 AC_DEFUN([LB_LINUX_RELEASE],
55 [LINUXRELEASE=
56 rm -f build/conftest.i
57 AC_MSG_CHECKING([for Linux release])
58 if test -s $LINUX_OBJ/include/linux/utsrelease.h ; then
59         LINUXRELEASEHEADER=utsrelease.h
60 else
61         LINUXRELEASEHEADER=version.h
62 fi
63 LB_LINUX_TRY_MAKE([
64         #include <linux/$LINUXRELEASEHEADER>
65 ],[
66         char *LINUXRELEASE;
67         LINUXRELEASE=UTS_RELEASE;
68 ],[
69         $makerule LUSTRE_KERNEL_TEST=conftest.i
70 ],[
71         test -s build/conftest.i
72 ],[
73         # LINUXRELEASE="UTS_RELEASE"
74         eval $(grep "LINUXRELEASE=" build/conftest.i)
75 ],[
76         AC_MSG_RESULT([unknown])
77         AC_MSG_ERROR([Could not preprocess test program.  Consult config.log for details.])
78 ])
79 rm -f build/conftest.i
80 if test x$LINUXRELEASE = x ; then
81         AC_MSG_RESULT([unknown])
82         AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
83 fi
84 AC_MSG_RESULT([$LINUXRELEASE])
85 AC_SUBST(LINUXRELEASE)
86
87 moduledir='/lib/modules/'$LINUXRELEASE/kernel
88 AC_SUBST(moduledir)
89
90 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
91 AC_SUBST(modulefsdir)
92
93 modulenetdir='$(moduledir)/net/$(PACKAGE)'
94 AC_SUBST(modulenetdir)
95
96 # ------------ RELEASE --------------------------------
97 AC_MSG_CHECKING([for Lustre release])
98 RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
99 AC_MSG_RESULT($RELEASE)
100 AC_SUBST(RELEASE)
101
102 # check is redhat/suse kernels
103 AC_MSG_CHECKING([that RedHat kernel])
104 LB_LINUX_TRY_COMPILE([
105                 #include <linux/version.h>
106         ],[
107                 #ifndef RHEL_MAJOR
108                 #error "not redhat kernel"
109                 #endif
110         ],[
111                 RHEL_KENEL="yes"
112                 RHEL_KERNEL="yes"
113                 AC_MSG_RESULT([yes])
114         ],[
115                 AC_MSG_RESULT([no])
116 ])
117
118 AC_MSG_CHECKING([that SuSe kernel])
119 LB_LINUX_TRY_COMPILE([
120                 #include <linux/version.h>
121         ],[
122                 #ifndef SLE_VERSION_CODE
123                 #error "not sles kernel"
124                 #endif
125         ],[
126                 SUSE_KERNEL="yes"
127                 AC_MSG_RESULT([yes])
128         ],[
129                 AC_MSG_RESULT([no])
130 ])
131
132 ])
133
134 #
135 #
136 # LB_LINUX_PATH
137 #
138 # Find paths for linux, handling kernel-source rpms
139 #
140 AC_DEFUN([LB_LINUX_PATH],
141 [AC_MSG_CHECKING([for Linux sources])
142 AC_ARG_WITH([linux],
143         AC_HELP_STRING([--with-linux=path],
144                        [set path to Linux source (default=/usr/src/linux)]),
145         [
146                 if ! [[[ $with_linux = /* ]]]; then
147                         AC_MSG_ERROR([You must provide an absolute pathname to the --with-linux= option.])
148                 else
149                         LINUX=$with_linux
150                 fi
151         ],
152         [LINUX=/usr/src/linux])
153 AC_MSG_RESULT([$LINUX])
154 AC_SUBST(LINUX)
155
156 # -------- check for linux --------
157 LB_CHECK_FILE([$LINUX],[],
158         [AC_MSG_ERROR([Kernel source $LINUX could not be found.])])
159
160 # -------- linux objects (for 2.6) --
161 AC_MSG_CHECKING([for Linux objects dir])
162 AC_ARG_WITH([linux-obj],
163         AC_HELP_STRING([--with-linux-obj=path],
164                         [set path to Linux objects dir (default=$LINUX)]),
165         [LINUX_OBJ=$with_linux_obj],
166         [LINUX_OBJ=$LINUX])
167 AC_MSG_RESULT([$LINUX_OBJ])
168 AC_SUBST(LINUX_OBJ)
169
170 # -------- check for .config --------
171 AC_ARG_WITH([linux-config],
172         [AC_HELP_STRING([--with-linux-config=path],
173                         [set path to Linux .conf (default=$LINUX_OBJ/.config)])],
174         [LINUX_CONFIG=$with_linux_config],
175         [LINUX_CONFIG=$LINUX_OBJ/.config])
176 AC_SUBST(LINUX_CONFIG)
177
178 LB_CHECK_FILE([/boot/kernel.h],
179         [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
180         [LB_CHECK_FILE([/var/adm/running-kernel.h],
181                 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h'])])
182
183 AC_ARG_WITH([kernel-source-header],
184         AC_HELP_STRING([--with-kernel-source-header=path],
185                         [Use a different kernel version header.  Consult build/README.kernel-source for details.]),
186         [KERNEL_SOURCE_HEADER=$with_kernel_source_header])
187
188 # ------------ .config exists ----------------
189 LB_CHECK_FILE([$LINUX_CONFIG],[],
190         [AC_MSG_ERROR([Kernel config could not be found.  If you are building from a kernel-source rpm consult build/README.kernel-source])])
191
192 # ----------- make dep run? ------------------
193 # at 2.6.19 # $LINUX/include/linux/config.h is removed
194 # and at more old has only one line
195 # include <autoconf.h>
196 LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[],
197         [AC_MSG_ERROR([Run make config in $LINUX.])])
198 LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[],
199         [AC_MSG_ERROR([Run make config in $LINUX.])])
200
201 # ------------ rhconfig.h includes runtime-generated bits --
202 # red hat kernel-source checks
203
204 # we know this exists after the check above.  if the user
205 # tarred up the tree and ran make dep etc. in it, then
206 # version.h gets overwritten with a standard linux one.
207
208 if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
209         # This is a clean kernel-source tree, we need to
210         # enable extensive workarounds to get this to build
211         # modules
212         LB_CHECK_FILE([$KERNEL_SOURCE_HEADER],
213                 [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
214                         AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
215                         AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
216                         AC_MSG_WARN([Consult build/README.kernel-source for details.])
217                 fi],
218                 [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found.  Consult build/README.kernel-source for details.])])
219         EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
220 fi
221
222 # this is needed before we can build modules
223 LB_LINUX_UML
224 LB_LINUX_VERSION
225
226 # --- check that we can build modules at all
227 AC_MSG_CHECKING([that modules can be built at all])
228 LB_LINUX_TRY_COMPILE([],[],[
229         AC_MSG_RESULT([yes])
230 ],[
231         AC_MSG_RESULT([no])
232         AC_MSG_WARN([Consult config.log for details.])
233         AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
234         AC_MSG_ERROR([Kernel modules cannot be built.])
235 ])
236
237 LB_LINUX_RELEASE
238 ]) # end of LB_LINUX_PATH
239
240 # LB_LINUX_SYMVERFILE
241 # SLES 9 uses a different name for this file - unsure about vanilla kernels
242 # around this version, but it matters for servers only.
243 AC_DEFUN([LB_LINUX_SYMVERFILE],
244         [AC_MSG_CHECKING([name of module symbol version file])
245         if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
246                 SYMVERFILE=Modules.symvers
247         else
248                 SYMVERFILE=Module.symvers
249         fi
250         AC_MSG_RESULT($SYMVERFILE)
251         AC_SUBST(SYMVERFILE)
252 ])
253
254 #
255 #
256 # LB_LINUX_MODPOST
257 #
258 # Find modpost and check it
259 #
260 AC_DEFUN([LB_LINUX_MODPOST],
261 [
262 # Find the modpost utility
263 LB_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
264         [MODPOST=$LINUX_OBJ/scripts/mod/modpost],
265         [LB_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
266                 [MODPOST=$LINUX_OBJ/scripts/modpost],
267                 AC_MSG_ERROR([modpost not found.])
268         )]
269 )
270 AC_SUBST(MODPOST)
271
272 # Ensure it can run
273 AC_MSG_CHECKING([if modpost can be run])
274 if $MODPOST ; then
275         AC_MSG_RESULT([yes])
276 else
277         AC_MSG_ERROR([modpost can not be run.])
278 fi
279
280 # Check if modpost supports (and therefore requires) -m
281 AC_MSG_CHECKING([if modpost supports -m])
282 if $MODPOST -m 2>/dev/null ; then
283         AC_MSG_RESULT([yes])
284         MODPOST_ARGS=-m
285 else
286         AC_MSG_RESULT([no])
287         MODPOST_ARGS=""
288 fi
289 AC_SUBST(MODPOST_ARGS)
290 ])
291
292 #
293 # LB_LINUX_UML
294 #
295 # check for a uml kernel
296 #
297 AC_DEFUN([LB_LINUX_UML],
298 [ARCH_UM=
299 UML_CFLAGS=
300
301 AC_MSG_CHECKING([if you are running user mode linux for $target_cpu])
302 if test -e $LINUX/include/asm-um ; then
303         if test  X`ls -id $LINUX/include/asm/ 2>/dev/null | awk '{print [$]1}'` = X`ls -id $LINUX/include/asm-um 2>/dev/null | awk '{print [$]1}'` ; then
304                 ARCH_UM='ARCH=um'
305                 # see notes in Rules.in
306                 UML_CFLAGS='-O0'
307                 AC_MSG_RESULT(yes)
308         else
309                 AC_MSG_RESULT([no])
310         fi
311 else
312         AC_MSG_RESULT([no (asm-um missing)])
313 fi
314 AC_SUBST(ARCH_UM)
315 AC_SUBST(UML_CFLAGS)
316 ])
317
318 # these are like AC_TRY_COMPILE, but try to build modules against the
319 # kernel, inside the build directory
320
321 #
322 # LB_LINUX_CONFTEST
323 #
324 # create a conftest.c file
325 #
326 AC_DEFUN([LB_LINUX_CONFTEST],
327 [cat >conftest.c <<_ACEOF
328 $1
329 _ACEOF
330 ])
331
332
333 # LB_LANG_PROGRAM(C)([PROLOGUE], [BODY])
334 # --------------------------------------
335 m4_define([LB_LANG_PROGRAM],
336 [$1
337 int
338 main (void)
339 {
340 dnl Do *not* indent the following line: there may be CPP directives.
341 dnl Don't move the `;' right after for the same reason.
342 $2
343   ;
344   return 0;
345 }])
346
347 #
348 # LB_LINUX_COMPILE_IFELSE
349 #
350 # like AC_COMPILE_IFELSE
351 #
352 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
353 [m4_ifvaln([$1], [LB_LINUX_CONFTEST([$1])])dnl
354 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
355 AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
356         [$4],
357         [_AC_MSG_LOG_CONFTEST
358 m4_ifvaln([$5],[$5])dnl])dnl
359 rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl
360 ])
361
362 #
363 # LB_LINUX_ARCH
364 #
365 # Determine the kernel's idea of the current architecture
366 #
367 AC_DEFUN([LB_LINUX_ARCH],
368          [AC_MSG_CHECKING([Linux kernel architecture])
369           AS_IF([rm -f $PWD/build/arch
370                  make -s --no-print-directory echoarch -f $PWD/build/Makefile \
371                      LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX_OBJ $ARCH_UM \
372                      ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`],
373                 [AC_MSG_RESULT([$LINUX_ARCH])],
374                 [AC_MSG_ERROR([Could not determine the kernel architecture.])])
375           rm -f build/arch])
376
377 #
378 # LB_LINUX_TRY_COMPILE
379 #
380 # like AC_TRY_COMPILE
381 #
382 AC_DEFUN([LB_LINUX_TRY_COMPILE],
383 [LB_LINUX_COMPILE_IFELSE(
384         [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
385         [modules],
386         [test -s build/conftest.o],
387         [$3], [$4])])
388
389 #
390 # LB_LINUX_CONFIG
391 #
392 # check if a given config option is defined
393 #
394 AC_DEFUN([LB_LINUX_CONFIG],
395 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
396 LB_LINUX_TRY_COMPILE([
397 #include <linux/autoconf.h>
398 ],[
399 #ifndef CONFIG_$1
400 #error CONFIG_$1 not #defined
401 #endif
402 ],[
403 AC_MSG_RESULT([yes])
404 $2
405 ],[
406 AC_MSG_RESULT([no])
407 $3
408 ])
409 ])
410
411 #
412 # LB_LINUX_CONFIG_IM
413 #
414 # check if a given config option is builtin or as module
415 #
416 AC_DEFUN([LB_LINUX_CONFIG_IM],
417 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
418 LB_LINUX_TRY_COMPILE([
419 #include <linux/autoconf.h>
420 ],[
421 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
422 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
423 #endif
424 ],[
425 AC_MSG_RESULT([yes])
426 $2
427 ],[
428 AC_MSG_RESULT([no])
429 $3
430 ])
431 ])
432
433 #
434 # LB_LINUX_TRY_MAKE
435 #
436 # like LB_LINUX_TRY_COMPILE, but with different arguments
437 #
438 AC_DEFUN([LB_LINUX_TRY_MAKE],
439 [LB_LINUX_COMPILE_IFELSE([AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])], [$3], [$4], [$5], [$6])])
440
441 #
442 # LB_LINUX_CONFIG_BIG_STACK
443 #
444 # check for big stack patch
445 #
446 AC_DEFUN([LB_LINUX_CONFIG_BIG_STACK],
447 [if test "x$ARCH_UM" = "x" -a "x$linux25" = "xno" ; then
448         case $target_cpu in
449                 i?86 | x86_64)
450                         LB_LINUX_CONFIG([STACK_SIZE_16KB],[],[
451                                 LB_LINUX_CONFIG([STACK_SIZE_32KB],[],[
452                                         LB_LINUX_CONFIG([STACK_SIZE_64KB],[],[
453                                                 AC_MSG_ERROR([Lustre requires that Linux is configured with at least a 16KB stack.])
454                                         ])
455                                 ])
456                         ])
457                         ;;
458         esac
459 fi
460 ])
461
462 #
463 # LB_CONFIG_OFED_BACKPORTS
464 #
465 # include any OFED backport headers in all compile commands
466 # NOTE: this does only include the backport paths, not the OFED headers
467 #       adding the OFED headers is done in the lnet portion
468 AC_DEFUN([LB_CONFIG_OFED_BACKPORTS],
469 [AC_MSG_CHECKING([whether to use any OFED backport headers])
470 # set default
471 AC_ARG_WITH([o2ib],
472         AC_HELP_STRING([--with-o2ib=path],
473                        [build o2iblnd against path]),
474         [
475                 case $with_o2ib in
476                 yes)    O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
477                         ENABLEO2IB=2
478                         ;;
479                 no)     ENABLEO2IB=0
480                         ;;
481                 *)      O2IBPATHS=$with_o2ib
482                         ENABLEO2IB=3
483                         ;;
484                 esac
485         ],[
486                 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
487                 ENABLEO2IB=1
488         ])
489 if test $ENABLEO2IB -eq 0; then
490         AC_MSG_RESULT([no])
491 else
492         o2ib_found=false
493         for O2IBPATH in $O2IBPATHS; do
494                 if test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
495                            -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
496                            -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
497                            -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
498                         o2ib_found=true
499                         break
500                 fi
501         done
502         if ! $o2ib_found; then
503                 AC_MSG_RESULT([no])
504                 case $ENABLEO2IB in
505                         1) ;;
506                         2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
507                         3) AC_MSG_ERROR([bad --with-o2ib path]);;
508                         *) AC_MSG_ERROR([internal error]);;
509                 esac
510         else
511                 if test -f $O2IBPATH/config.mk; then
512                         . $O2IBPATH/config.mk
513                 elif test -f $O2IBPATH/ofed_patch.mk; then
514                         . $O2IBPATH/ofed_patch.mk
515                 fi
516                 if test -n "$BACKPORT_INCLUDES"; then
517                         OFED_BACKPORT_PATH=`echo $BACKPORT_INCLUDES | sed "s#.*/src/ofa_kernel/#$O2IBPATH/#"`
518                         EXTRA_LNET_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_LNET_INCLUDE"
519                         AC_MSG_RESULT([yes])
520                 else
521                         AC_MSG_RESULT([no])
522                 fi
523         fi
524 fi
525 ])
526
527
528 #
529 # LB_PROG_LINUX
530 #
531 # linux tests
532 #
533 AC_DEFUN([LB_PROG_LINUX],
534 [LB_LINUX_PATH
535 LB_LINUX_ARCH
536 LB_LINUX_SYMVERFILE
537
538
539 LB_LINUX_CONFIG([MODULES],[],[
540         AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
541 ])
542
543 LB_LINUX_CONFIG([MODVERSIONS])
544
545 LB_LINUX_CONFIG([KALLSYMS],[],[
546 if test "x$ARCH_UM" = "x" ; then
547         AC_MSG_ERROR([Lustre requires that CONFIG_KALLSYMS is enabled in your kernel.])
548 fi
549 ])
550
551 LB_LINUX_CONFIG([KMOD],[],[
552         AC_MSG_WARN([])
553         AC_MSG_WARN([Kernel module loading support is highly recommended.])
554         AC_MSG_WARN([])
555 ])
556
557 #LB_LINUX_CONFIG_BIG_STACK
558
559 # it's ugly to be doing anything with OFED outside of the lnet module, but
560 # this has to be done here so that the backports path is set before all of
561 # the LN_PROG_LINUX checks are done
562 LB_CONFIG_OFED_BACKPORTS
563 ])
564
565 #
566 # LB_LINUX_CONDITIONALS
567 #
568 # AM_CONDITIONALS for linux
569 #
570 AC_DEFUN([LB_LINUX_CONDITIONALS],
571 [AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
572 ])
573
574
575 #
576 # LB_CHECK_SYMBOL_EXPORT
577 # check symbol exported or not
578 # $1 - symbol
579 # $2 - file(s) for find.
580 # $3 - do 'yes'
581 # $4 - do 'no'
582 #
583 # 2.6 based kernels - put modversion info into $LINUX/Module.modvers
584 # or check
585 AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
586 [AC_MSG_CHECKING([if Linux was built with symbol $1 exported])
587 grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
588 rc=$?
589 if test $rc -ne 0; then
590     export=0
591     for file in $2; do
592         grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null
593         rc=$?
594         if test $rc -eq 0; then
595                 export=1
596                 break;
597         fi
598     done
599     if test $export -eq 0; then
600         AC_MSG_RESULT([no])
601         $4
602     else
603         AC_MSG_RESULT([yes])
604         $3
605     fi
606 else
607     AC_MSG_RESULT([yes])
608     $3
609 fi
610 ])
611
612 #
613 # Like AC_CHECK_HEADER but checks for a kernel-space header
614 #
615 m4_define([LB_CHECK_LINUX_HEADER],
616 [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
617 AC_CACHE_CHECK([for $1], ac_Header,
618                [LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
619                                   [modules],
620                                   [test -s build/conftest.o],
621                                   [AS_VAR_SET(ac_Header, [yes])],
622                                   [AS_VAR_SET(ac_Header, [no])])])
623 AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl
624 AS_VAR_POPDEF([ac_Header])dnl
625 ])