Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / build / autogen.sh
index 05be061..eb02edd 100644 (file)
@@ -78,7 +78,17 @@ check_version() {
 }
 
 echo "Checking for a complete tree..."
-for dir in build portals lustre ; do
+if [ -d kernel_patches ] ; then
+    # This is ldiskfs
+    REQUIRED_DIRS="build"
+    CONFIGURE_DIRS=""
+else
+    REQUIRED_DIRS="build lnet lustre"
+    OPTIONAL_DIRS="snmp portals"
+    CONFIGURE_DIRS="libsysio ldiskfs"
+fi
+
+for dir in $REQUIRED_DIRS ; do
     if [ ! -d "$dir" ] ; then
        cat >&2 <<EOF
 Your tree seems to be missing $dir.
@@ -88,6 +98,12 @@ EOF
     fi
     ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
 done
+# optional directories for Lustre
+for dir in $OPTIONAL_DIRS; do
+    if [ -d "$dir" ] ; then
+       ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
+    fi
+done
 
 check_version automake automake-1.7 "1.7.8"
 check_version autoconf autoconf "2.57"
@@ -101,9 +117,12 @@ automake-1.7 -a -c
 echo "Running autoconf..."
 autoconf
 
-if [ -d libsysio ] ; then
-    pushd libsysio >/dev/null
-    echo "Running autogen for libsysio..."
-    sh autogen.sh
-    popd >/dev/null
-fi
+# Run autogen.sh in these directories
+for dir in $CONFIGURE_DIRS; do
+    if [ -d $dir ] ; then
+        pushd $dir >/dev/null
+        echo "Running autogen for $dir..."
+        sh autogen.sh
+        popd >/dev/null
+    fi
+done