Whamcloud - gitweb
df48f11be9bf9b1e79997250947a79ed9bfd0bfe
[fs/lustre-release.git] / build / autoconf / lustre-build.m4
1 #
2 # LB_CHECK_VERSION
3 #
4 # Verify that LUSTRE_VERSION was defined properly
5 #
6 AC_DEFUN([LB_CHECK_VERSION],
7 [if test "LUSTRE_VERSION" = "LUSTRE""_VERSION" ; then
8         AC_MSG_ERROR([This script was not built with a version number.])
9 fi
10 ])
11
12 #
13 # LB_CANONICAL_SYSTEM
14 #
15 # fixup $target_os for use in other places
16 #
17 AC_DEFUN([LB_CANONICAL_SYSTEM],
18 [case $target_os in
19         linux*)
20                 lb_target_os="linux"
21                 ;;
22         darwin*)
23                 lb_target_os="darwin"
24                 ;;
25         solaris*)
26                 lb_target_os="SunOS"
27                 ;;esac
28 AC_SUBST(lb_target_os)
29 ])
30
31 #
32 # LB_DOWNSTREAM_RELEASE
33 #
34 AC_DEFUN([LB_DOWNSTREAM_RELEASE],
35 [AC_ARG_WITH([downstream-release],
36         AC_HELP_STRING([--with-downstream-release=string],
37                        [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]),
38         [DOWNSTREAM_RELEASE=$with_downstream_release],
39         [
40         # if not specified, see if it's in the META file
41         if test -f META; then
42                 DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)
43         fi
44         ])
45 AC_SUBST(DOWNSTREAM_RELEASE)
46 ])
47
48 #
49 # LB_BUILDID
50 #
51 # Check if the source is a GA release and if not, set a "BUILDID"
52 #
53 # Currently there are at least two ways/modes of/for doing this.  One
54 # is if we are in a valid git repository, the other is if we are in a
55 # non-git source tree of some form.  Building the latter from the former
56 # will be handled here.
57 AC_DEFUN([LB_BUILDID],
58 [
59 AC_MSG_CHECKING([for buildid])
60 BUILDID=""
61 if git branch >/dev/null 2>&1; then
62         ffw=0
63         hash=""
64         ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags)
65         if [[[ $ver = *-*-* ]]]; then
66                 hash=${ver##*-}
67                 ffw=${ver#*-}
68                 ffw=${ffw%-*}
69                 ver=${ver%%-*}
70         fi
71         # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]]
72         # here but the portability of the regex on the right is dismal
73         # (thanx suse)
74         if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then
75                 ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \
76                                       -e 's/_RC[[0-9]].*$//' -e 's/_/./g')
77         fi
78
79         # a "lustre fix" value of .0 should be truncated
80         if [[[ $ver = *.*.*.0 ]]]; then
81                 ver=${ver%.0}
82         fi
83         # ditto for a "lustre fix" value of _0
84         if [[[ $ver = v*_*_*_0 ]]]; then
85                 ver=${ver%_0}
86         fi
87         if [[[ $ver = v*_*_* ]]]; then
88                 ver=${ver#v}
89                 ver=${ver//_/.}
90         fi
91
92         # only do this test for lustre (not ldiskfs)
93         if test "$PACKAGE" = "lustre" -a "$ver" != "$VERSION"; then
94                 AC_MSG_WARN([most recent tag found: $ver does not match current version $VERSION.])
95         fi
96
97         if test "$ffw" != "0"; then
98                 BUILDID="$hash"
99                 msg="$BUILDID (ahead by $ffw commits)"
100                 AC_MSG_RESULT([$msg])
101         else
102                 AC_MSG_RESULT([none... congratulations, you must be on a tag])
103         fi
104 elif test -f META; then
105         BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
106         msg="$BUILDID (from META file)"
107         AC_MSG_RESULT([$msg])
108 else
109         AC_MSG_WARN([FIXME: I don't know how to deal with source trees outside of git that don't have a META file.  Not setting a buildid.])
110 fi
111 AC_SUBST(BUILDID)
112 ])
113
114 #
115 # LB_CHECK_FILE
116 #
117 # Check for file existance even when cross compiling
118 #
119 AC_DEFUN([LB_CHECK_FILE],
120 [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
121 AC_CACHE_CHECK([for $1], lb_File,
122 [if test -r "$1"; then
123         AS_VAR_SET(lb_File, yes)
124 else
125         AS_VAR_SET(lb_File, no)
126 fi])
127 AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
128 AS_VAR_POPDEF([lb_File])dnl
129 ])# LB_CHECK_FILE
130
131
132 #
133 # LB_ARG_LIBS_INCLUDES
134 #
135 # support for --with-foo, --with-foo-includes, and --with-foo-libs in
136 # a single magical macro
137 #
138 AC_DEFUN([LB_ARG_LIBS_INCLUDES],
139 [lb_pathvar="m4_bpatsubst([$2], -, _)"
140 AC_MSG_CHECKING([for $1])
141 AC_ARG_WITH([$2],
142         AC_HELP_STRING([--with-$2=path],
143                 [path to $1]),
144         [],[withval=$4])
145
146 if test x$withval = xyes ; then
147         eval "$lb_pathvar='$3'"
148 else
149         eval "$lb_pathvar='$withval'"
150 fi
151 AC_MSG_RESULT([${!lb_pathvar:-no}])
152
153 if test x${!lb_pathvar} != x -a x${!lb_pathvar} != xno ; then
154         AC_MSG_CHECKING([for $1 includes])
155         AC_ARG_WITH([$2-includes],
156                 AC_HELP_STRING([--with-$2-includes=path],
157                         [path to $1 includes]),
158                 [],[withval='yes'])
159
160         lb_includevar="${lb_pathvar}_includes"
161         if test x$withval = xyes ; then
162                 eval "${lb_includevar}='${!lb_pathvar}/include'"
163         else
164                 eval "${lb_includevar}='$withval'"
165         fi
166         AC_MSG_RESULT([${!lb_includevar}])
167
168         AC_MSG_CHECKING([for $1 libs])
169         AC_ARG_WITH([$2-libs],
170                 AC_HELP_STRING([--with-$2-libs=path],
171                         [path to $1 libs]),
172                 [],[withval='yes'])
173
174         lb_libvar="${lb_pathvar}_libs"
175         if test x$withval = xyes ; then
176                 eval "${lb_libvar}='${!lb_pathvar}/lib'"
177         else
178                 eval "${lb_libvar}='$withval'"
179         fi
180         AC_MSG_RESULT([${!lb_libvar}])
181 fi
182 ])
183 ])
184
185 #
186 # LB_PATH_LIBSYSIO
187 #
188 # Handle internal/external libsysio
189 #
190 AC_DEFUN([LB_PATH_LIBSYSIO],
191 [AC_ARG_WITH([sysio],
192         AC_HELP_STRING([--with-sysio=path],
193                         [set path to libsysio source (default is included libsysio)]),
194         [],[
195                 case $lb_target_os in
196                         linux)
197                                 with_sysio='yes'
198                                 ;;
199                         *)
200                                 with_sysio='no'
201                                 ;;
202                 esac
203         ])
204 AC_MSG_CHECKING([location of libsysio])
205 enable_sysio="$with_sysio"
206 case x$with_sysio in
207         xyes)
208                 AC_MSG_RESULT([internal])
209                 LB_CHECK_FILE([$srcdir/libsysio/src/rmdir.c],[],[
210                         AC_MSG_ERROR([A complete internal libsysio was not found.])
211                 ])
212                 LIBSYSIO_SUBDIR="libsysio"
213                 SYSIO="$PWD/libsysio"
214                 ;;
215         xno)
216                 AC_MSG_RESULT([disabled])
217                 ;;
218         *)
219                 AC_MSG_RESULT([$with_sysio])
220                 LB_CHECK_FILE([$with_sysio/lib/libsysio.a],[],[
221                         AC_MSG_ERROR([A complete (built) external libsysio was not found.])
222                 ])
223                 SYSIO=$with_sysio
224                 with_sysio="yes"
225                 ;;
226 esac
227
228 # We have to configure even if we don't build here for make dist to work
229 AC_CONFIG_SUBDIRS(libsysio)
230 ])
231
232 #
233 # LB_PATH_LUSTREIOKIT
234 #
235 # Handle internal/external lustre-iokit
236 #
237 AC_DEFUN([LB_PATH_LUSTREIOKIT],
238 [AC_ARG_WITH([lustre-iokit],
239         AC_HELP_STRING([--with-lustre-iokit=path],
240                         [set path to lustre-iokit source (default is included lustre-iokit)]),
241         [],[
242                         with_lustre_iokit='yes'
243         ])
244 AC_MSG_CHECKING([location of lustre-iokit])
245 enable_lustre_iokit="$with_lustre_iokit"
246 case x$with_lustre_iokit in
247         xyes)
248                 AC_MSG_RESULT([internal])
249                 LB_CHECK_FILE([$srcdir/lustre-iokit/ior-survey/ior-survey],[],[
250                         AC_MSG_ERROR([A complete internal lustre-iokit was not found.])
251                 ])
252                 LUSTREIOKIT_SUBDIR="lustre-iokit"
253                 LUSTREIOKIT="$PWD/lustre-iokit"
254                 ;;
255         xno)
256                 AC_MSG_RESULT([disabled])
257                 ;;
258         *)
259                 AC_MSG_RESULT([$with_lustre_iokit])
260                 LB_CHECK_FILE([$with_lustre_iokit/ior-survey/ior_survey],[],[
261                         AC_MSG_ERROR([A complete (built) external lustre-iokit was not found.])
262                 ])
263                 LUSTREIOKIT="$with_lustre_iokit"
264                 ;;
265 esac
266 AC_SUBST(LUSTREIOKIT_SUBDIR)
267 # We have to configure even if we don't build here for make dist to work
268 AC_CONFIG_SUBDIRS(lustre-iokit)
269 ])
270
271 # Define no libcfs by default.
272 AC_DEFUN([LB_LIBCFS_DIR],
273 [
274 case x$libcfs_is_module in
275         xyes)
276           LIBCFS_INCLUDE_DIR="libcfs/include"
277           LIBCFS_SUBDIR="libcfs"
278           ;;
279         x*)
280           LIBCFS_INCLUDE_DIR="lnet/include"
281           LIBCFS_SUBDIR=""
282           ;;
283 esac
284 AC_SUBST(LIBCFS_SUBDIR)
285 AC_SUBST(LIBCFS_INCLUDE_DIR)
286 ])
287
288 #
289 # LB_CONFIG_BGL
290 #
291 # Enable BGL features
292 #
293 AC_DEFUN([LB_CONFIG_BGL],
294 [AC_MSG_CHECKING([whether to build BGL features])
295 AC_ARG_ENABLE([bgl],
296         AC_HELP_STRING([--enable-bgl],
297                         [enable building of BGL features]),
298         [enable_bgl='yes'],[enable_bgl='no'])
299 AC_MSG_RESULT([$enable_bgl])
300 if test x$enable_bgl != xno; then
301         AC_DEFINE(HAVE_BGL_SUPPORT, 1, Enable BGL Features)
302         enable_doc='no'
303         enable_tests='no'
304         enable_server='no'
305         enable_liblustre='no'
306         enable_libreadline='no'
307 fi
308 ])
309
310 #
311 # Support for --enable-uoss
312 #
313 AC_DEFUN([LB_UOSS],
314 [AC_MSG_CHECKING([whether to enable uoss])
315 AC_ARG_ENABLE([uoss],
316         AC_HELP_STRING([--enable-uoss],
317                         [enable userspace OSS]),
318         [enable_uoss='yes'],[enable_uoss='no'])
319 AC_MSG_RESULT([$enable_uoss])
320 if test x$enable_uoss = xyes; then
321         AC_DEFINE(UOSS_SUPPORT, 1, Enable user-level OSS)
322         AC_DEFINE(LUSTRE_ULEVEL_MT, 1, Multi-threaded user-level lustre port)
323         enable_uoss='yes'
324         enable_ulevel_mt='yes'
325         enable_modules='no'
326         enable_client='no'
327         enable_tests='no'
328         enable_liblustre='no'
329         with_ldiskfs='no'
330 fi
331 AC_SUBST(enable_uoss)
332 ])
333
334 #
335 # Support for --enable-posix-osd
336 #
337 AC_DEFUN([LB_POSIX_OSD],
338 [AC_MSG_CHECKING([whether to enable posix osd])
339 AC_ARG_ENABLE([posix-osd],
340         AC_HELP_STRING([--enable-posix-osd],
341                         [enable using of posix osd]),
342         [enable_posix_osd='yes'],[enable_posix_osd='no'])
343 AC_MSG_RESULT([$enable_posix_osd])
344 if test x$enable_uoss = xyes -a x$enable_posix_osd = xyes ; then
345         AC_DEFINE(POSIX_OSD, 1, Enable POSIX OSD)
346         posix_osd='yes'
347 fi
348 AM_CONDITIONAL(POSIX_OSD_ENABLED, test x$posix_osd = xyes)
349 ])
350
351 #
352 # LB_PATH_DMU
353 #
354 AC_DEFUN([LB_PATH_DMU],
355 [AC_ARG_ENABLE([dmu],
356         AC_HELP_STRING([--enable-dmu],
357                        [enable the DMU backend]),
358         [],[with_dmu='default'])
359 AC_MSG_CHECKING([whether to enable DMU])
360 case x$with_dmu in
361         xyes)
362                 dmu_osd='yes'
363                 ;;
364         xno)
365                 dmu_osd='no'
366                 ;;
367         xdefault)
368                 if test x$enable_uoss = xyes -a x$posix_osd != xyes; then
369                         # Enable the DMU if we're configuring a userspace server
370                         dmu_osd='yes'
371                 else
372                         # Enable the DMU by default on the b_hd_kdmu branch
373                         if test -d $PWD/zfs -a x$enable_server = xyes; then
374                                 dmu_osd='yes'
375                         else
376                                 dmu_osd='no'
377                         fi
378                 fi
379                 ;;
380         *)
381                 dmu_osd='yes'
382                 ;;
383 esac
384 AC_MSG_RESULT([$dmu_osd])
385 if test x$dmu_osd = xyes; then
386         AC_DEFINE(DMU_OSD, 1, Enable DMU OSD)
387         if test x$enable_uoss = xyes; then
388                 # Userspace DMU
389                 DMU_SRC="$PWD/lustre/zfs-lustre"
390                 AC_SUBST(DMU_SRC)
391                 LB_CHECK_FILE([$DMU_SRC/src/.patched],[],[
392                         AC_MSG_ERROR([A complete (patched) DMU tree was not found.])
393                 ])
394                 AC_CONFIG_SUBDIRS(lustre/zfs-lustre)
395         else
396                 # Kernel DMU
397                 SPL_SUBDIR="spl"
398                 ZFS_SUBDIR="zfs"
399
400                 SPL_DIR="$PWD/$SPL_SUBDIR"
401                 ZFS_DIR="$PWD/$ZFS_SUBDIR"
402
403                 LB_CHECK_FILE([$SPL_DIR/module/spl/spl-generic.c],[],[
404                         AC_MSG_ERROR([A complete SPL tree was not found in $SPL_DIR.])
405                 ])
406
407                 LB_CHECK_FILE([$ZFS_DIR/module/zfs/dmu.c],[],[
408                         AC_MSG_ERROR([A complete kernel DMU tree was not found in $ZFS_DIR.])
409                 ])
410
411                 AC_CONFIG_SUBDIRS(spl)
412                 ac_configure_args="$ac_configure_args --with-spl=$SPL_DIR"
413                 AC_CONFIG_SUBDIRS(zfs)
414         fi
415 fi
416 AC_SUBST(SPL_SUBDIR)
417 AC_SUBST(ZFS_SUBDIR)
418 AC_SUBST(SPL_DIR)
419 AC_SUBST(ZFS_DIR)
420 AM_CONDITIONAL(DMU_OSD_ENABLED, test x$dmu_osd = xyes)
421 AM_CONDITIONAL(KDMU, test x$dmu_osd$enable_uoss = xyesno)
422 ])
423
424 #
425 # LB_PATH_SNMP
426 #
427 # check for in-tree snmp support
428 #
429 AC_DEFUN([LB_PATH_SNMP],
430 [LB_CHECK_FILE([$srcdir/snmp/lustre-snmp.c],[SNMP_DIST_SUBDIR="snmp"])
431 AC_SUBST(SNMP_DIST_SUBDIR)
432 AC_SUBST(SNMP_SUBDIR)
433 ])
434
435 #
436 # LB_CONFIG_MODULES
437 #
438 # Build kernel modules?
439 #
440 AC_DEFUN([LB_CONFIG_MODULES],
441 [AC_MSG_CHECKING([whether to build kernel modules])
442 AC_ARG_ENABLE([modules],
443         AC_HELP_STRING([--disable-modules],
444                         [disable building of Lustre kernel modules]),
445         [],[
446                 LC_TARGET_SUPPORTED([
447                         enable_modules='yes'
448                 ],[
449                         enable_modules='no'
450                 ])
451         ])
452 AC_MSG_RESULT([$enable_modules ($target_os)])
453
454 if test x$enable_modules = xyes ; then
455         case $target_os in
456                 linux*)
457                         LB_PROG_LINUX
458                         LIBCFS_PROG_LINUX
459                         LN_PROG_LINUX
460                         LC_PROG_LINUX
461                         ;;
462                 darwin*)
463                         LB_PROG_DARWIN
464                         LIBCFS_PROG_DARWIN
465                         ;;
466                 *)
467                         # This is strange - Lustre supports a target we don't
468                         AC_MSG_ERROR([Modules are not supported on $target_os])
469                         ;;
470         esac
471 fi
472 ])
473
474 #
475 # LB_CONFIG_UTILS
476 #
477 # Build utils?
478 #
479 AC_DEFUN([LB_CONFIG_UTILS],
480 [AC_MSG_CHECKING([whether to build utilities])
481 AC_ARG_ENABLE([utils],
482         AC_HELP_STRING([--disable-utils],
483                         [disable building of Lustre utility programs]),
484         [],[enable_utils='yes'])
485 AC_MSG_RESULT([$enable_utils])
486 if test x$enable_utils = xyes ; then 
487         LB_CONFIG_INIT_SCRIPTS
488 fi
489 ])
490
491 #
492 # LB_CONFIG_TESTS
493 #
494 # Build tests?
495 #
496 AC_DEFUN([LB_CONFIG_TESTS],
497 [AC_MSG_CHECKING([whether to build Lustre tests])
498 AC_ARG_ENABLE([tests],
499         AC_HELP_STRING([--disable-tests],
500                         [disable building of Lustre tests]),
501         [],
502         [
503                 enable_tests='yes'
504         ])
505 AC_MSG_RESULT([$enable_tests])
506 ])
507
508 #
509 # LB_CONFIG_DIST
510 #
511 # Just enough configure so that "make dist" is useful
512 #
513 # this simply re-adjusts some defaults, which of course can be overridden
514 # on the configure line after the --for-dist option
515 #
516 AC_DEFUN([LB_CONFIG_DIST],
517 [AC_MSG_CHECKING([whether to configure just enough for make dist])
518 AC_ARG_ENABLE([dist],
519         AC_HELP_STRING([--enable-dist],
520                         [only configure enough for make dist]),
521         [enable_dist='yes'],[enable_dist='no'])
522 AC_MSG_RESULT([$enable_dist])
523 if test x$enable_dist != xno; then
524         enable_modules='no'
525         enable_utils='no'
526         enable_liblustre='no'
527         enable_doc='no'
528         enable_tests='no'
529 fi
530 ])
531
532 #
533 # LB_CONFIG_DOCS
534 #
535 # Build docs?
536 #
537 AC_DEFUN([LB_CONFIG_DOCS],
538 [AC_MSG_CHECKING([whether to build docs])
539 AC_ARG_ENABLE(doc,
540         AC_HELP_STRING([--disable-doc],
541                         [skip creation of pdf documentation]),
542         [
543                 if test x$enable_doc = xyes ; then
544                     ENABLE_DOC=1
545                 else
546                     ENABLE_DOC=0
547                 fi
548         ],[
549                 ENABLE_DOC=0
550                 enable_doc='no'
551         ])
552 AC_MSG_RESULT([$enable_doc])
553 AC_SUBST(ENABLE_DOC)
554 ])
555
556 #
557 # LB_CONFIG_INIT_SCRIPTS
558 #
559 # our init scripts only work on red hat linux
560 #
561 AC_DEFUN([LB_CONFIG_INIT_SCRIPTS],
562 [ENABLE_INIT_SCRIPTS=0
563 if test x$enable_utils = xyes ; then
564         AC_MSG_CHECKING([whether to install init scripts])
565         # our scripts only work on red hat systems
566         if test -f /etc/init.d/functions -a -f /etc/sysconfig/network ; then
567                 ENABLE_INIT_SCRIPTS=1
568                 AC_MSG_RESULT([yes])
569         else
570                 AC_MSG_RESULT([no])
571         fi
572 fi
573 AC_SUBST(ENABLE_INIT_SCRIPTS)
574 ])
575
576 #
577 # LB_CONFIG_HEADERS
578 #
579 # add -include config.h
580 #
581 AC_DEFUN([LB_CONFIG_HEADERS],[
582         AC_CONFIG_HEADERS([config.h])
583         CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
584         EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
585         AC_SUBST(EXTRA_KCFLAGS)
586 ])
587
588 #
589 # LB_INCLUDE_RULES
590 #
591 # defines for including the toplevel Rules
592 #
593 AC_DEFUN([LB_INCLUDE_RULES],[
594         INCLUDE_RULES="include $PWD/Rules"
595         AC_SUBST(INCLUDE_RULES)
596 ])
597
598 #
599 # LB_PATH_DEFAULTS
600 #
601 # 'fixup' default paths
602 #
603 AC_DEFUN([LB_PATH_DEFAULTS],
604 [# directories for binaries
605 AC_PREFIX_DEFAULT([/usr])
606
607 sysconfdir='/etc'
608 AC_SUBST(sysconfdir)
609
610 # Directories for documentation and demos.
611 docdir='${datadir}/doc/$(PACKAGE)'
612 AC_SUBST(docdir)
613
614 LIBCFS_PATH_DEFAULTS
615 LN_PATH_DEFAULTS
616 LC_PATH_DEFAULTS
617
618 ])
619
620 #
621 # LB_PROG_CC
622 #
623 # checks on the C compiler
624 #
625 AC_DEFUN([LB_PROG_CC],
626 [AC_PROG_RANLIB
627
628 # ---------  unsigned long long sane? -------
629 AC_CHECK_SIZEOF(unsigned long long, 0)
630 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
631 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
632 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
633         AC_MSG_ERROR([** we assume that sizeof(long long) == 8.])
634 fi
635
636 if test $target_cpu == "powerpc64"; then
637         AC_MSG_WARN([set compiler with -m64])
638         CFLAGS="$CFLAGS -m64"
639         CC="$CC -m64"
640 fi
641
642 CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include $CPPFLAGS"
643
644 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
645 AC_SUBST(LLCPPFLAGS)
646
647 # Add _GNU_SOURCE for strnlen on linux
648 LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
649 AC_SUBST(LLCFLAGS)
650
651 CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
652 AC_SUBST(CCASFLAGS)
653
654 # everyone builds against lnet and lustre
655 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include"
656 AC_SUBST(EXTRA_KCFLAGS)
657 ])
658
659 #
660 # LB_CONTITIONALS
661 #
662 # AM_CONDITIONAL instances for everything
663 # (so that portals/lustre can disable some if needed)
664 AC_DEFUN([LB_CONDITIONALS],
665 [AM_CONDITIONAL(MODULES, test x$enable_modules = xyes)
666 AM_CONDITIONAL(UTILS, test x$enable_utils = xyes)
667 AM_CONDITIONAL(TESTS, test x$enable_tests = xyes)
668 AM_CONDITIONAL(DOC, test x$ENABLE_DOC = x1)
669 AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1")
670 AM_CONDITIONAL(LINUX, test x$lb_target_os = "xlinux")
671 AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin")
672 AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
673 AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
674 AM_CONDITIONAL(ARCH_x86, test x$target_cpu = "xx86_64" -o x$target_cpu = "xi686")
675
676 # this lets lustre cancel libsysio, per-branch or if liblustre is
677 # disabled
678 if test "x$LIBSYSIO_SUBDIR" = xlibsysio ; then
679         if test "x$with_sysio" != xyes ; then
680                 SYSIO=""
681                 LIBSYSIO_SUBDIR=""
682         fi
683 fi
684 AC_SUBST(LIBSYSIO_SUBDIR)
685 AC_SUBST(SYSIO)
686
687 LB_DARWIN_CONDITIONALS
688
689 LIBCFS_CONDITIONALS
690 LN_CONDITIONALS
691 LC_CONDITIONALS
692 ])
693
694 #
695 # LB_CONFIG_FILES
696 #
697 # build-specific config files
698 #
699 AC_DEFUN([LB_CONFIG_FILES],
700 [
701         AC_CONFIG_FILES([
702                 Makefile
703                 autoMakefile]
704                 [Rules:build/Rules.in]
705                 AC_PACKAGE_TARNAME[.spec]
706         )
707 ])
708
709 #
710 # LB_CONFIGURE
711 #
712 # main configure steps
713 #
714 AC_DEFUN([LB_CONFIGURE],
715 [LB_CANONICAL_SYSTEM
716
717 LB_CONFIG_DIST
718
719 LB_DOWNSTREAM_RELEASE
720 LB_USES_DPKG
721 LB_BUILDID
722
723 LB_LIBCFS_DIR
724
725 LB_INCLUDE_RULES
726
727 LB_CONFIG_BGL
728 LB_PATH_DEFAULTS
729
730 LB_PROG_CC
731
732 LB_UOSS
733 LB_POSIX_OSD
734 LC_OSD_ADDON
735
736 LB_CONFIG_DOCS
737 LB_CONFIG_UTILS
738 LB_CONFIG_TESTS
739 LC_CONFIG_CLIENT_SERVER
740
741 # two macros for cmd3
742 m4_ifdef([LC_CONFIG_SPLIT], [LC_CONFIG_SPLIT])
743 LN_CONFIG_CDEBUG
744 LC_QUOTA
745
746 LB_CONFIG_MODULES
747 LN_CONFIG_USERSPACE
748
749 LB_PATH_DMU
750 LB_PATH_LIBSYSIO
751 LB_PATH_SNMP
752 LB_PATH_LDISKFS
753 LB_PATH_ZFS
754 LB_PATH_LUSTREIOKIT
755
756 LB_DEFINE_E2FSPROGS_NAMES
757
758 LC_CONFIG_LIBLUSTRE
759 LIBCFS_CONFIGURE
760 LN_CONFIGURE
761
762 LC_CONFIGURE
763
764 if test "$SNMP_DIST_SUBDIR" ; then
765         LS_CONFIGURE
766 fi
767
768
769 LB_CONDITIONALS
770 LB_CONFIG_HEADERS
771
772 LIBCFS_CONFIG_FILES
773 LB_CONFIG_FILES
774 LN_CONFIG_FILES
775 LC_CONFIG_FILES
776 if test "$SNMP_DIST_SUBDIR" ; then
777         LS_CONFIG_FILES
778 fi
779
780 AC_SUBST(ac_configure_args)
781
782 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
783 AC_SUBST(MOSTLYCLEANFILES)
784
785 AC_OUTPUT
786
787 cat <<_ACEOF
788
789 CC:            $CC
790 LD:            $LD
791 CPPFLAGS:      $CPPFLAGS
792 LLCPPFLAGS:    $LLCPPFLAGS
793 CFLAGS:        $CFLAGS
794 EXTRA_KCFLAGS: $EXTRA_KCFLAGS
795 LLCFLAGS:      $LLCFLAGS
796
797 Type 'make' to build Lustre.
798 _ACEOF
799 ])