From 06e1b2d1c1f4340a773c571ec1e9096dbb7eea5d Mon Sep 17 00:00:00 2001 From: meijia Date: Tue, 17 Jun 2003 03:12:53 +0000 Subject: [PATCH] [liblustre]: add script to generate libraries --- lustre/liblustre/genlib.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 lustre/liblustre/genlib.sh diff --git a/lustre/liblustre/genlib.sh b/lustre/liblustre/genlib.sh new file mode 100755 index 0000000..bf48010 --- /dev/null +++ b/lustre/liblustre/genlib.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# +# This script is to generate lib lustre library as a whole. It will leave +# two files on current directory: liblustre.a and liblustre.so. +# Integrate them into Makefile.am later +# + +AR=/usr/bin/ar +LD=/usr/bin/ld + +CWD=`pwd` + +LUS=$CWD/../ +PTL=$LUS/portals +SYSIO=$LUS/../libsysio + +TMP=/tmp/llib_tmp + +LLLIBS="$LUS/liblustre/libllite.a \ + $SYSIO/src/libsysio.a \ + $SYSIO/dev/stdfd/libsysio_stdfd.a \ + $SYSIO/drivers/native/libsysio_native.a \ + $LUS/lov/liblov.a \ + $LUS/osc/libosc.a \ + $LUS/ldlm/libldlm.a \ + $LUS/ptlrpc/libptlrpc.a \ + $LUS/obdclass/liblustreclass.a \ + $LUS/mdc/libmdc.a \ + $PTL/unals/libtcpnal.a \ + $PTL/portals/libportals.a \ + $PTL/utils/libptlctl.a" + +rm -rf $TMP +mkdir -p $TMP + +i=0 +for lib in $LLLIBS; do + mkdir $TMP/$i + cd $TMP/$i + $AR x $lib + i=$(($i+1)) +done + +cd $TMP + +# static lib +ar -r $CWD/liblustre.a `find . -type f` + +# shared lib +$LD -shared -o $CWD/liblustre.so -init __liblustre_setup_ -fini __liblustre_cleanup_ \ + `find . -type f` -lpthread -lreadline -lncurses + +cd $CWD -- 1.8.3.1