Whamcloud - gitweb
to make b_hd_remote_uid portals based on b_hd_sec portals
[fs/lustre-release.git] / build / lbuild
index 846f1c1..a7c7e64 100755 (executable)
@@ -32,6 +32,7 @@ BOOT_ARCHS=
 JENSEN_ARCHS=
 SMP_ARCHS=
 BIGSMP_ARCHS=
+PSERIES64_ARCHS=
 UP_ARCHS=
 
 DATE=$(date)
@@ -39,6 +40,8 @@ DATE=$(date)
 USE_DATESTAMP=1
 RPMBUILD=
 
+export CC=${CC:-gcc}
+
 cleanup()
 {
     true
@@ -231,7 +234,7 @@ load_target()
     fi
     # EXTRA_VERSION=${EXTRA_VERSION//-/_}
 
-    ALL_ARCHS="$BASE_ARCHS $BIGMEM_ARCHS $BOOT_ARCHS $JENSEN_ARCHS $SMP_ARCHS $BIGSMP_ARCHS $UP_ARCHS"
+    ALL_ARCHS="$BASE_ARCHS $BIGMEM_ARCHS $BOOT_ARCHS $JENSEN_ARCHS $SMP_ARCHS $BIGSMP_ARCHS $PSERIES64_ARCHS $UP_ARCHS"
 
     BUILD_ARCHS=
     for arch in $(uniqify "$ALL_ARCHS") ; do
@@ -280,13 +283,20 @@ unpack_lustre()
            DATESTAMP=""
        fi          
 
-       cvs -d "$CVSROOT" -qz3 co $DATESTAMP -r "$TAG" -d "$DIRNAME" lustre || \
-           fatal 1 "There was an error checking out Lustre from CVS."
+       cvs -d "$CVSROOT" -qz3 co $DATESTAMP -d "$DIRNAME" lustre || \
+           fatal 1 "There was an error checking out toplevel Lustre from CVS."
+       pushd "$DIRNAME" > /dev/null
+       ./lustrecvs "$TAG" || \
+           fatal 1 "There was an error checking out Lustre/Portals/Build from CVS."
        echo "Creating lustre tarball..."
-       tar zcf "$DIRNAME.tar.gz" "$DIRNAME" \
-           --exclude "CVS" --exclude "*~" --exclude ".cvsignore" || \
-           fatal 1 "Could not create Lustre tarball."
-       LUSTRE="$PWD/$DIRNAME.tar.gz"
+       sh autogen.sh || fatal 1 "There was an error running autogen.sh."
+       ./configure --disable-{modules,utils,liblustre,tests,doc} || \
+           fatal 1 "There was an error running ./configure to create makefiles."
+       make dist || fatal 1 "There was an error running 'make dist'."
+       popd > /dev/null
+       fname=`basename $DIRNAME/lustre-*.tar.gz`
+       cp $DIRNAME/$fname . || fatal 1 "There was an error copying lustre tarball."
+       LUSTRE="$PWD/$fname"
        ln -sf "$DIRNAME" lustre
     fi
 }
@@ -329,7 +339,8 @@ patch_linux()
     rm -f linux/configs/*
     copysuccess=0
     for patchesdir in "$EXTERNAL_PATCHES" "lustre/lustre/kernel_patches" ; do
-       cp -v $patchesdir/kernel_configs/kernel-${VERSION}-${TARGET}*.config linux/configs/ >/dev/null && copysuccess=1
+       [ "$patchesdir" ] && \
+           cp -v $patchesdir/kernel_configs/kernel-${VERSION}-${TARGET}*.config linux/configs/ >/dev/null && copysuccess=1
     done
     [ "$copysuccess" = "1" ] || \
        fatal 1 "Error copying in kernel configs."
@@ -376,6 +387,7 @@ prep_build()
        -e "s^@LINUX26@^$LINUX26^g" \
        -e "s^@LUSTRE_SOURCE@^${LUSTRE##*/}^g" \
        -e "s^@LUSTRE_TARGET@^$TARGET^g" \
+       -e "s^@PSERIES64_ARCHS@^$PSERIES64_ARCHS^g" \
        -e "s^@RHBUILD@^$RHBUILD^g" \
        -e "s^@SMP_ARCHS@^$SMP_ARCHS^g" \
        -e "s^@SUSEBUILD@^$SUSEBUILD^g" \