4 # Verify that LUSTRE_VERSION was defined properly
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.])
15 # fixup $target_os for use in other places
17 AC_DEFUN([LB_CANONICAL_SYSTEM],
28 AC_SUBST(lb_target_os)
32 # LB_DOWNSTREAM_RELEASE
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],
40 # if not specified, see if it's in the META file
42 DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)
45 AC_SUBST(DOWNSTREAM_RELEASE)
51 # Check if the source is a GA release and if not, set a "BUILDID"
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],
59 AC_MSG_CHECKING([for buildid])
61 if git branch >/dev/null 2>&1; then
64 ver=$(git describe --match [[0-9v]]\* --tags)
65 if [[[ $ver = *-*-* ]]]; then
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
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')
79 # a "lustre fix" value of .0 should be truncated
80 if [[[ $ver = *.*.*.0 ]]]; then
83 # ditto for a "lustre fix" value of _0
84 if [[[ $ver = v*_*_*_0 ]]]; then
89 # only do this test for lustre (not ldiskfs)
90 if test "$PACKAGE" = "lustre" -a "$ver" != "$VERSION"; then
91 AC_MSG_ERROR([most recent tag found: $ver does not match current version $VERSION.])
94 if test "$ffw" != "0"; then
96 msg="$BUILDID (ahead by $ffw commits)"
99 AC_MSG_RESULT([none... congratulations, you must be on a tag])
101 elif test -f META; then
102 BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' META)
103 msg="$BUILDID (from META file)"
104 AC_MSG_RESULT([$msg])
106 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.])
114 # Check for file existance even when cross compiling
116 AC_DEFUN([LB_CHECK_FILE],
117 [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
118 AC_CACHE_CHECK([for $1], lb_File,
119 [if test -r "$1"; then
120 AS_VAR_SET(lb_File, yes)
122 AS_VAR_SET(lb_File, no)
124 AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
125 AS_VAR_POPDEF([lb_File])dnl
130 # LB_ARG_LIBS_INCLUDES
132 # support for --with-foo, --with-foo-includes, and --with-foo-libs in
133 # a single magical macro
135 AC_DEFUN([LB_ARG_LIBS_INCLUDES],
136 [lb_pathvar="m4_bpatsubst([$2], -, _)"
137 AC_MSG_CHECKING([for $1])
139 AC_HELP_STRING([--with-$2=path],
143 if test x$withval = xyes ; then
144 eval "$lb_pathvar='$3'"
146 eval "$lb_pathvar='$withval'"
148 AC_MSG_RESULT([${!lb_pathvar:-no}])
150 if test x${!lb_pathvar} != x -a x${!lb_pathvar} != xno ; then
151 AC_MSG_CHECKING([for $1 includes])
152 AC_ARG_WITH([$2-includes],
153 AC_HELP_STRING([--with-$2-includes=path],
154 [path to $1 includes]),
157 lb_includevar="${lb_pathvar}_includes"
158 if test x$withval = xyes ; then
159 eval "${lb_includevar}='${!lb_pathvar}/include'"
161 eval "${lb_includevar}='$withval'"
163 AC_MSG_RESULT([${!lb_includevar}])
165 AC_MSG_CHECKING([for $1 libs])
166 AC_ARG_WITH([$2-libs],
167 AC_HELP_STRING([--with-$2-libs=path],
171 lb_libvar="${lb_pathvar}_libs"
172 if test x$withval = xyes ; then
173 eval "${lb_libvar}='${!lb_pathvar}/lib'"
175 eval "${lb_libvar}='$withval'"
177 AC_MSG_RESULT([${!lb_libvar}])
185 # Handle internal/external libsysio
187 AC_DEFUN([LB_PATH_LIBSYSIO],
188 [AC_ARG_WITH([sysio],
189 AC_HELP_STRING([--with-sysio=path],
190 [set path to libsysio source (default is included libsysio)]),
192 case $lb_target_os in
201 AC_MSG_CHECKING([location of libsysio])
202 enable_sysio="$with_sysio"
205 AC_MSG_RESULT([internal])
206 LB_CHECK_FILE([$srcdir/libsysio/src/rmdir.c],[],[
207 AC_MSG_ERROR([A complete internal libsysio was not found.])
209 LIBSYSIO_SUBDIR="libsysio"
210 SYSIO="$PWD/libsysio"
213 AC_MSG_RESULT([disabled])
216 AC_MSG_RESULT([$with_sysio])
217 LB_CHECK_FILE([$with_sysio/lib/libsysio.a],[],[
218 AC_MSG_ERROR([A complete (built) external libsysio was not found.])
225 # We have to configure even if we don't build here for make dist to work
226 AC_CONFIG_SUBDIRS(libsysio)
230 # LB_PATH_LUSTREIOKIT
232 # Handle internal/external lustre-iokit
234 AC_DEFUN([LB_PATH_LUSTREIOKIT],
235 [AC_ARG_WITH([lustre-iokit],
236 AC_HELP_STRING([--with-lustre-iokit=path],
237 [set path to lustre-iokit source (default is included lustre-iokit)]),
239 with_lustre_iokit='yes'
241 AC_MSG_CHECKING([location of lustre-iokit])
242 enable_lustre_iokit="$with_lustre_iokit"
243 case x$with_lustre_iokit in
245 AC_MSG_RESULT([internal])
246 LB_CHECK_FILE([$srcdir/lustre-iokit/ior-survey/ior-survey],[],[
247 AC_MSG_ERROR([A complete internal lustre-iokit was not found.])
249 LUSTREIOKIT_SUBDIR="lustre-iokit"
250 LUSTREIOKIT="$PWD/lustre-iokit"
253 AC_MSG_RESULT([disabled])
256 AC_MSG_RESULT([$with_lustre_iokit])
257 LB_CHECK_FILE([$with_lustre_iokit/ior-survey/ior_survey],[],[
258 AC_MSG_ERROR([A complete (built) external lustre-iokit was not found.])
260 LUSTREIOKIT="$with_lustre_iokit"
261 with_lustre_iokit="yes"
264 AC_SUBST(LUSTREIOKIT_SUBDIR)
265 # We have to configure even if we don't build here for make dist to work
266 AC_CONFIG_SUBDIRS(lustre-iokit)
272 # Handle internal/external ldiskfs
274 AC_DEFUN([LB_PATH_LDISKFS],
275 [AC_ARG_WITH([ldiskfs],
276 AC_HELP_STRING([--with-ldiskfs=path],
277 [set path to ldiskfs source (default is included ldiskfs)]),
279 if test x$linux25$enable_server = xyesyes ; then
285 AC_ARG_WITH([ldiskfs-inkernel],
286 AC_HELP_STRING([--with-ldiskfs-inkernel],
287 [use ldiskfs built in to the kernel]),
288 [with_ldiskfs=inkernel], [])
289 AC_MSG_CHECKING([location of ldiskfs])
290 case x$with_ldiskfs in
292 AC_MSG_RESULT([internal])
293 LB_CHECK_FILE([$srcdir/ldiskfs/lustre-ldiskfs.spec.in],[],[
294 AC_MSG_ERROR([A complete internal ldiskfs was not found.])
296 LDISKFS_SUBDIR="ldiskfs"
297 LDISKFS_DIR="$PWD/ldiskfs"
300 AC_MSG_RESULT([disabled])
303 AC_MSG_RESULT([inkernel])
304 LB_CHECK_FILE([$LINUX/include/linux/ldiskfs_fs.h],[],[
305 AC_MSG_ERROR([ldiskfs was not found in $LINUX/include/linux/ldiskfs_fs.h])
309 AC_MSG_RESULT([$with_ldiskfs])
310 LB_CHECK_FILE([$with_ldiskfs/ldiskfs/inode.c],[],[
311 AC_MSG_ERROR([A complete (built) external ldiskfs was not found.])
313 LDISKFS_DIR=$with_ldiskfs
316 AC_SUBST(LDISKFS_DIR)
317 AC_SUBST(LDISKFS_SUBDIR)
318 AM_CONDITIONAL(LDISKFS_ENABLED, test x$with_ldiskfs != xno)
319 AM_CONDITIONAL(LDISKFS_IN_KERNEL, test x$with_ldiskfs = xinkernel)
321 if test x$enable_ext4 = xyes ; then
322 AC_DEFINE(HAVE_EXT4_LDISKFS, 1, [build ext4 based ldiskfs])
325 # We have to configure even if we don't build here for make dist to work
326 AC_CONFIG_SUBDIRS(ldiskfs)
329 AC_DEFUN([LC_KERNEL_WITH_EXT4],
330 [if test -f $LINUX/fs/ext4/ext4.h ; then
338 # LB_HAVE_EXT4_ENABLED
340 AC_DEFUN([LB_HAVE_EXT4_ENABLED],
342 if test x$RHEL_KERNEL = xyes; then
343 AC_ARG_ENABLE([ext4],
344 AC_HELP_STRING([--enable-ext4],
345 [enable building of ldiskfs based on ext4]),
348 if test x$ldiskfs_is_ext4 = xyes; then
355 case $LINUXRELEASE in
356 # ext4 was in 2.6.22-2.6.26 but not stable enough to use
357 2.6.2[0-6]*) enable_ext4='no' ;;
358 *) LC_KERNEL_WITH_EXT4([enable_ext4='yes'],
359 [enable_ext4='no']) ;;
362 if test x$enable_ext4 = xyes; then
363 ac_configure_args="$ac_configure_args --enable-ext4"
365 AC_MSG_CHECKING([whether to build ldiskfs based on ext4])
366 AC_MSG_RESULT([$enable_ext4])
369 # Define no libcfs by default.
370 AC_DEFUN([LB_LIBCFS_DIR],
372 case x$libcfs_is_module in
374 LIBCFS_INCLUDE_DIR="libcfs/include"
375 LIBCFS_SUBDIR="libcfs"
378 LIBCFS_INCLUDE_DIR="lnet/include"
382 AC_SUBST(LIBCFS_SUBDIR)
383 AC_SUBST(LIBCFS_INCLUDE_DIR)
387 # LB_DEFINE_LDISKFS_OPTIONS
389 # Enable config options related to ldiskfs. These are used both by ldiskfs
390 # and lvfs (which includes ldiskfs headers.)
392 AC_DEFUN([LB_DEFINE_LDISKFS_OPTIONS],
394 AC_DEFINE(CONFIG_LDISKFS_FS_MODULE, 1, [build ldiskfs as a module])
395 AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1, [enable extended attributes for ldiskfs])
396 AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs])
397 AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1, [enable fs security for ldiskfs])
398 AC_DEFINE(CONFIG_LDISKFSDEV_FS_POSIX_ACL, 1, [enable posix acls for ldiskfs])
399 AC_DEFINE(CONFIG_LDISKFSDEV_FS_XATTR, 1, [enable extented attributes for ldiskfs])
400 AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1, [enable fs security for ldiskfs])
404 # LB_DEFINE_E2FSPROGS_NAMES
406 # Enable the use of alternate naming of ldiskfs-enabled e2fsprogs package.
408 AC_DEFUN([LB_DEFINE_E2FSPROGS_NAMES],
409 [AC_ARG_WITH([ldiskfsprogs],
410 AC_HELP_STRING([--with-ldiskfsprogs],
411 [use alternate names for ldiskfs-enabled e2fsprogs]),
414 AC_MSG_CHECKING([whether to use alternate names for e2fsprogs])
415 if test x$withval = xyes ; then
416 AC_DEFINE(HAVE_LDISKFSPROGS, 1, [enable use of ldiskfsprogs package])
417 E2FSPROGS="ldiskfsprogs"
418 MKE2FS="mkfs.ldiskfs"
419 DEBUGFS="debugfs.ldiskfs"
420 TUNE2FS="tunefs.ldiskfs"
421 E2LABEL="label.ldiskfs"
422 DUMPE2FS="dumpfs.ldiskfs"
423 E2FSCK="fsck.ldiskfs"
424 AC_MSG_RESULT([enabled])
426 E2FSPROGS="e2fsprogs"
433 AC_MSG_RESULT([disabled])
435 AC_DEFINE_UNQUOTED(E2FSPROGS, "$E2FSPROGS", [name of ldiskfs e2fsprogs package])
436 AC_DEFINE_UNQUOTED(MKE2FS, "$MKE2FS", [name of ldiskfs mkfs program])
437 AC_DEFINE_UNQUOTED(DEBUGFS, "$DEBUGFS", [name of ldiskfs debug program])
438 AC_DEFINE_UNQUOTED(TUNE2FS, "$TUNE2FS", [name of ldiskfs tune program])
439 AC_DEFINE_UNQUOTED(E2LABEL, "$E2LABEL", [name of ldiskfs label program])
440 AC_DEFINE_UNQUOTED(DUMPE2FS,"$DUMPE2FS", [name of ldiskfs dump program])
441 AC_DEFINE_UNQUOTED(E2FSCK, "$E2FSCK", [name of ldiskfs fsck program])
447 # Enable Cray XT3 features
449 AC_DEFUN([LB_CONFIG_CRAY_XT3],
450 [AC_MSG_CHECKING([whether to build Cray XT3 features])
451 AC_ARG_ENABLE([cray_xt3],
452 AC_HELP_STRING([--enable-cray-xt3],
453 [enable building of Cray XT3 features]),
454 [enable_cray_xt3='yes'],[enable_cray_xt3='no'])
455 AC_MSG_RESULT([$enable_cray_xt3])
456 if test x$enable_cray_xt3 != xno; then
457 AC_DEFINE(CRAY_XT3, 1, Enable Cray XT3 Features)
464 # Enable BGL features
466 AC_DEFUN([LB_CONFIG_BGL],
467 [AC_MSG_CHECKING([whether to build BGL features])
469 AC_HELP_STRING([--enable-bgl],
470 [enable building of BGL features]),
471 [enable_bgl='yes'],[enable_bgl='no'])
472 AC_MSG_RESULT([$enable_bgl])
473 if test x$enable_bgl != xno; then
474 AC_DEFINE(HAVE_BGL_SUPPORT, 1, Enable BGL Features)
478 enable_liblustre='no'
479 enable_libreadline='no'
484 # Support for --enable-uoss
487 [AC_MSG_CHECKING([whether to enable uoss])
488 AC_ARG_ENABLE([uoss],
489 AC_HELP_STRING([--enable-uoss],
490 [enable userspace OSS]),
491 [enable_uoss='yes'],[enable_uoss='no'])
492 AC_MSG_RESULT([$enable_uoss])
493 if test x$enable_uoss = xyes; then
494 AC_DEFINE(UOSS_SUPPORT, 1, Enable user-level OSS)
495 AC_DEFINE(LUSTRE_ULEVEL_MT, 1, Multi-threaded user-level lustre port)
497 enable_ulevel_mt='yes'
501 enable_liblustre='no'
504 AC_SUBST(enable_uoss)
508 # Support for --enable-posix-osd
510 AC_DEFUN([LB_POSIX_OSD],
511 [AC_MSG_CHECKING([whether to enable posix osd])
512 AC_ARG_ENABLE([posix-osd],
513 AC_HELP_STRING([--enable-posix-osd],
514 [enable using of posix osd]),
515 [enable_posix_osd='yes'],[enable_posix_osd='no'])
516 AC_MSG_RESULT([$enable_posix_osd])
517 if test x$enable_uoss = xyes -a x$enable_posix_osd = xyes ; then
518 AC_DEFINE(POSIX_OSD, 1, Enable POSIX OSD)
521 AM_CONDITIONAL(POSIX_OSD_ENABLED, test x$posix_osd = xyes)
527 AC_DEFUN([LB_PATH_DMU],
528 [AC_ARG_ENABLE([dmu],
529 AC_HELP_STRING([--enable-dmu],
530 [enable the DMU backend]),
531 [],[with_dmu='default'])
532 AC_MSG_CHECKING([whether to enable DMU])
541 if test x$enable_uoss = xyes -a x$posix_osd != xyes; then
542 # Enable the DMU if we're configuring a userspace server
545 # Enable the DMU by default on the b_hd_kdmu branch
546 if test -d $PWD/zfs -a x$linux25$enable_server = xyesyes; then
557 AC_MSG_RESULT([$dmu_osd])
558 if test x$dmu_osd = xyes; then
559 AC_DEFINE(DMU_OSD, 1, Enable DMU OSD)
560 if test x$enable_uoss = xyes; then
562 DMU_SRC="$PWD/lustre/zfs-lustre"
564 LB_CHECK_FILE([$DMU_SRC/src/.patched],[],[
565 AC_MSG_ERROR([A complete (patched) DMU tree was not found.])
567 AC_CONFIG_SUBDIRS(lustre/zfs-lustre)
573 SPL_DIR="$PWD/$SPL_SUBDIR"
574 ZFS_DIR="$PWD/$ZFS_SUBDIR"
576 LB_CHECK_FILE([$SPL_DIR/module/spl/spl-generic.c],[],[
577 AC_MSG_ERROR([A complete SPL tree was not found in $SPL_DIR.])
580 LB_CHECK_FILE([$ZFS_DIR/module/zfs/dmu.c],[],[
581 AC_MSG_ERROR([A complete kernel DMU tree was not found in $ZFS_DIR.])
584 AC_CONFIG_SUBDIRS(spl)
585 ac_configure_args="$ac_configure_args --with-spl=$SPL_DIR"
586 AC_CONFIG_SUBDIRS(zfs)
593 AM_CONDITIONAL(DMU_OSD_ENABLED, test x$dmu_osd = xyes)
594 AM_CONDITIONAL(KDMU, test x$dmu_osd$enable_uoss = xyesno)
600 # check for in-tree snmp support
602 AC_DEFUN([LB_PATH_SNMP],
603 [LB_CHECK_FILE([$srcdir/snmp/lustre-snmp.c],[SNMP_DIST_SUBDIR="snmp"])
604 AC_SUBST(SNMP_DIST_SUBDIR)
605 AC_SUBST(SNMP_SUBDIR)
611 # Build kernel modules?
613 AC_DEFUN([LB_CONFIG_MODULES],
614 [AC_MSG_CHECKING([whether to build kernel modules])
615 AC_ARG_ENABLE([modules],
616 AC_HELP_STRING([--disable-modules],
617 [disable building of Lustre kernel modules]),
619 LC_TARGET_SUPPORTED([
625 AC_MSG_RESULT([$enable_modules ($target_os)])
627 if test x$enable_modules = xyes ; then
640 # This is strange - Lustre supports a target we don't
641 AC_MSG_ERROR([Modules are not supported on $target_os])
652 AC_DEFUN([LB_CONFIG_UTILS],
653 [AC_MSG_CHECKING([whether to build utilities])
654 AC_ARG_ENABLE([utils],
655 AC_HELP_STRING([--disable-utils],
656 [disable building of Lustre utility programs]),
657 [],[enable_utils='yes'])
658 AC_MSG_RESULT([$enable_utils])
659 if test x$enable_utils = xyes ; then
660 LB_CONFIG_INIT_SCRIPTS
669 AC_DEFUN([LB_CONFIG_TESTS],
670 [AC_MSG_CHECKING([whether to build Lustre tests])
671 AC_ARG_ENABLE([tests],
672 AC_HELP_STRING([--disable-tests],
673 [disable building of Lustre tests]),
678 AC_MSG_RESULT([$enable_tests])
683 # Just enough configure so that "make dist" is useful
685 # this simply re-adjusts some defaults, which of course can be overridden
686 # on the configure line after the --enable-dist option
688 AC_DEFUN([LB_CONFIG_DIST],
689 [AC_MSG_CHECKING([whether to configure just enough for make dist])
690 AC_ARG_ENABLE([dist],
691 AC_HELP_STRING([--enable-dist],
692 [only configure enough for make dist]),
693 [enable_dist='yes'],[enable_dist='no'])
694 AC_MSG_RESULT([$enable_dist])
695 if test x$enable_dist != xno; then
698 enable_liblustre='no'
707 # Just enough configure so that "make dist" is useful
709 # this simply re-adjusts some defaults, which of course can be overridden
710 # on the configure line after the --for-dist option
712 AC_DEFUN([LB_CONFIG_DIST],
713 [AC_MSG_CHECKING([whether to configure just enough for make dist])
714 AC_ARG_ENABLE([dist],
715 AC_HELP_STRING([--enable-dist],
716 [only configure enough for make dist]),
717 [enable_dist='yes'],[enable_dist='no'])
718 AC_MSG_RESULT([$enable_dist])
719 if test x$enable_dist != xno; then
722 enable_liblustre='no'
733 AC_DEFUN([LB_CONFIG_DOCS],
734 [AC_MSG_CHECKING([whether to build docs])
736 AC_HELP_STRING([--disable-doc],
737 [skip creation of pdf documentation]),
739 if test x$enable_doc = xyes ; then
748 AC_MSG_RESULT([$enable_doc])
753 # LB_CONFIG_INIT_SCRIPTS
755 # our init scripts only work on red hat linux
757 AC_DEFUN([LB_CONFIG_INIT_SCRIPTS],
758 [ENABLE_INIT_SCRIPTS=0
759 if test x$enable_utils = xyes ; then
760 AC_MSG_CHECKING([whether to install init scripts])
761 # our scripts only work on red hat systems
762 if test -f /etc/init.d/functions -a -f /etc/sysconfig/network ; then
763 ENABLE_INIT_SCRIPTS=1
769 AC_SUBST(ENABLE_INIT_SCRIPTS)
775 # add -include config.h
777 AC_DEFUN([LB_CONFIG_HEADERS],
778 [AC_CONFIG_HEADERS([config.h])
779 CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
780 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
781 AC_SUBST(EXTRA_KCFLAGS)
787 # defines for including the toplevel Rules
789 AC_DEFUN([LB_INCLUDE_RULES],
790 [INCLUDE_RULES="include $PWD/Rules"
791 AC_SUBST(INCLUDE_RULES)
797 # 'fixup' default paths
799 AC_DEFUN([LB_PATH_DEFAULTS],
800 [# directories for binaries
801 AC_PREFIX_DEFAULT([/usr])
806 # Directories for documentation and demos.
807 docdir='${datadir}/doc/$(PACKAGE)'
819 # checks on the C compiler
821 AC_DEFUN([LB_PROG_CC],
823 AC_MSG_CHECKING([for buggy compiler])
824 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
826 AC_MSG_RESULT([buggy compiler found!])
828 echo " '$CC_VERSION'"
829 echo " has been known to generate bad code, "
830 echo " please get an updated compiler."
831 AC_MSG_ERROR([sorry])
833 case "$CC_VERSION" in
837 # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
838 # without "sub $0xc,%esp" to protect the stack from being
839 # stomped on by interrupts (bug 606)
840 "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
843 # mandrake's similar sub 0xc compiler bug
844 # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2
845 "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)")
849 AC_MSG_RESULT([no known problems])
853 # --------- unsigned long long sane? -------
854 AC_CHECK_SIZEOF(unsigned long long, 0)
855 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
856 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
857 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
858 AC_MSG_ERROR([** we assume that sizeof(long long) == 8. Tell phil@clusterfs.com])
861 if test $target_cpu == "powerpc64"; then
862 AC_MSG_WARN([set compiler with -m64])
863 CFLAGS="$CFLAGS -m64"
867 CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include $CPPFLAGS"
869 LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1"
872 # Add _GNU_SOURCE for strnlen on linux
873 LLCFLAGS="-g -Wall -fPIC -D_GNU_SOURCE"
876 # everyone builds against lnet and lustre
877 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include"
878 AC_SUBST(EXTRA_KCFLAGS)
884 # AM_CONDITIONAL instances for everything
885 # (so that portals/lustre can disable some if needed)
886 AC_DEFUN([LB_CONDITIONALS],
887 [AM_CONDITIONAL(MODULES, test x$enable_modules = xyes)
888 AM_CONDITIONAL(UTILS, test x$enable_utils = xyes)
889 AM_CONDITIONAL(TESTS, test x$enable_tests = xyes)
890 AM_CONDITIONAL(DOC, test x$ENABLE_DOC = x1)
891 AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1")
892 AM_CONDITIONAL(LINUX, test x$lb_target_os = "xlinux")
893 AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin")
894 AM_CONDITIONAL(CRAY_XT3, test x$enable_cray_xt3 = "xyes")
895 AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
896 AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
898 # this lets lustre cancel libsysio, per-branch or if liblustre is
900 if test "x$LIBSYSIO_SUBDIR" = xlibsysio ; then
901 if test "x$with_sysio" != xyes ; then
906 AC_SUBST(LIBSYSIO_SUBDIR)
909 LB_LINUX_CONDITIONALS
910 LB_DARWIN_CONDITIONALS
920 # build-specific config files
922 AC_DEFUN([LB_CONFIG_FILES],
928 [Rules:build/Rules.in]
929 AC_PACKAGE_TARNAME[.spec]
936 # main configure steps
938 AC_DEFUN([LB_CONFIGURE],
943 LB_DOWNSTREAM_RELEASE
964 LC_CONFIG_CLIENT_SERVER
966 # two macros for cmd3
967 m4_ifdef([LC_CONFIG_SPLIT], [LC_CONFIG_SPLIT])
981 LB_DEFINE_E2FSPROGS_NAMES
989 if test "$SNMP_DIST_SUBDIR" ; then
1001 if test "$SNMP_DIST_SUBDIR" ; then
1005 AC_SUBST(ac_configure_args)
1007 MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symvers Module.symvers'
1008 AC_SUBST(MOSTLYCLEANFILES)
1017 LLCPPFLAGS: $LLCPPFLAGS
1019 EXTRA_KCFLAGS: $EXTRA_KCFLAGS
1022 Type 'make' to build Lustre.