X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fliblustre%2Fgenlib.sh;h=4cbef251729e7551526505f54535ad74beb0eb1d;hb=afef2264887b5223d85d89c57fcd366601f22c39;hp=f5c489e5ec24617aff89c19d023f50df39728041;hpb=4ff551e15e6f0aff75520abe6e6e06c0e377a765;p=fs%2Flustre-release.git diff --git a/lustre/liblustre/genlib.sh b/lustre/liblustre/genlib.sh index f5c489e..4cbef25 100755 --- a/lustre/liblustre/genlib.sh +++ b/lustre/liblustre/genlib.sh @@ -1,5 +1,6 @@ #!/bin/bash #set -xv +set -e # # This script is to generate lib lustre library as a whole. It will leave @@ -11,14 +12,24 @@ # AR=/usr/bin/ar -LD=/usr/bin/ld +# see http://osdir.com/ml/gmane.comp.gnu.binutils.bugs/2006-01/msg00016.php +ppc64_CPU=`uname -p` +if [ ${ppc64_CPU} == "ppc64" ]; then + LD="gcc -m64" +else + LD="gcc" +fi RANLIB=/usr/bin/ranlib CWD=`pwd` SYSIO=$1 -CRAY_PORTALS_LIBS=$2 -LIBS=$3 +LIBS=$2 +LND_LIBS=$3 +PTHREAD_LIBS=$4 +QUOTA_LIBS=$5 +CAP_LIBS=$6 +ZLIB=$7 if [ ! -f $SYSIO/lib/libsysio.a ]; then echo "ERROR: $SYSIO/lib/libsysio.a dosen't exist" @@ -37,13 +48,6 @@ build_obj_list() { done; } -prepend_obj_list() { - _objs=`$AR -t $1/$2` - for _lib in $_objs; do - ALL_OBJS="$1/$_lib "$ALL_OBJS; - done; -} - # # special treatment for libsysio # @@ -53,26 +57,10 @@ build_sysio_obj_list() { _objs=`$AR -t $1` mkdir -p $sysio_tmp cd $sysio_tmp - $AR -x ../$1 - cd .. - for _lib in $_objs; do - ALL_OBJS=$ALL_OBJS"$sysio_tmp/$_lib "; - done -} - -# -# special treatment for libportals.a -# -cray_tmp=$CWD/cray_tmp_`date +%s` -rm -rf $cray_tmp -build_cray_portals_obj_list() { - _objs=`$AR -t $1` - mkdir -p $cray_tmp - cd $cray_tmp $AR -x $1 cd .. for _lib in $_objs; do - ALL_OBJS=$ALL_OBJS"$cray_tmp/$_lib "; + ALL_OBJS=$ALL_OBJS"$sysio_tmp/$_lib "; done } @@ -81,20 +69,29 @@ build_obj_list . libllite.a build_obj_list ../lov liblov.a build_obj_list ../obdecho libobdecho.a build_obj_list ../osc libosc.a +build_obj_list ../lmv liblmv.a build_obj_list ../mdc libmdc.a +build_obj_list ../fid libfid.a +build_obj_list ../fld libfld.a +build_obj_list ../mgc libmgc.a build_obj_list ../ptlrpc libptlrpc.a -build_obj_list ../sec libptlrpcs.a build_obj_list ../obdclass liblustreclass.a build_obj_list ../lvfs liblvfs.a -# portals components libs -build_obj_list ../../portals/utils libuptlctl.a +# lnet components libs +build_obj_list ../../lnet/utils libuptlctl.a +build_obj_list ../../libcfs/libcfs libcfs.a +build_obj_list ../../libcfs/libcfs libcfsutil.a +if $(echo "$LND_LIBS" | grep "socklnd" >/dev/null) ; then + build_obj_list ../../lnet/ulnds/socklnd libsocklnd.a +fi +if $(echo "$LND_LIBS" | grep "ptllnd" >/dev/null) ; then + build_obj_list ../../lnet/ulnds/ptllnd libptllnd.a +fi +build_obj_list ../../lnet/lnet liblnet.a -if [ "x$CRAY_PORTALS_PATH" = "x" ]; then - build_obj_list ../../portals/unals libtcpnal.a - build_obj_list ../../portals/portals libportals.a -else - build_cray_portals_obj_list $CRAY_PORTALS_PATH/lib_TV/snos64/libportals.a +if [ "x$QUOTA_LIBS" != "x" ]; then + build_obj_list ../quota libquota.a fi # create static lib lsupport @@ -114,8 +111,11 @@ $RANLIB $CWD/liblustre.a # create shared lib lustre rm -f $CWD/liblustre.so -$LD -shared -o $CWD/liblustre.so -init __liblustre_setup_ -fini __liblustre_cleanup_ \ - $ALL_OBJS -lcap -lpthread +OS=`uname` +if test x$OS = xAIX; then +$LD -shared -o $CWD/liblustre.so $ALL_OBJS -lpthread -Xlinker -bnoipath ../../libsyscall.so +else +$LD -shared -nostdlib -o $CWD/liblustre.so $ALL_OBJS $CAP_LIBS $PTHREAD_LIBS $ZLIB +fi rm -rf $sysio_tmp -rm -rf $cray_tmp