+if [ -d kernel_patches ] ; then
+ # This is ldiskfs
+ REQUIRED_DIRS="build"
+ CONFIGURE_DIRS=""
+else
+ REQUIRED_DIRS="build libcfs lnet lustre"
+ OPTIONAL_DIRS="snmp portals"
+ CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs spl zfs"
+fi
+
+for dir in $REQUIRED_DIRS ; do