5 # This script is to generate lib lustre library as a whole. It will leave
6 # two files on current directory: liblustre.a and liblustre.so.
8 # Most concern here is the libraries linking order
10 # FIXME: How to do this cleanly use makefile?
15 RANLIB=/usr/bin/ranlib
22 if [ ! -f $SYSIO/lib/libsysio.a ]; then
23 echo "ERROR: $SYSIO/lib/libsysio.a dosen't exist"
34 for _lib in $_objs; do
35 ALL_OBJS=$ALL_OBJS"$1/$_lib ";
41 for _lib in $_objs; do
42 ALL_OBJS="$1/$_lib "$ALL_OBJS;
47 # special treatment for libsysio
49 sysio_tmp=$CWD/sysio_tmp_`date +%s`
51 build_sysio_obj_list() {
57 for _lib in $_objs; do
58 ALL_OBJS=$ALL_OBJS"$sysio_tmp/$_lib ";
63 # special treatment for libportals.a
65 cray_tmp=$CWD/cray_tmp_`date +%s`
67 build_cray_portals_obj_list() {
73 for _lib in $_objs; do
74 ALL_OBJS=$ALL_OBJS"$cray_tmp/$_lib ";
78 # lustre components libs
79 build_obj_list . liblutils.a
80 build_obj_list ../lov liblov.a
81 build_obj_list ../obdecho libobdecho.a
82 build_obj_list ../osc libosc.a
83 build_obj_list ../mdc libmdc.a
84 build_obj_list ../ptlrpc libptlrpc.a
85 build_obj_list ../sec libptlrpcs.a
86 build_obj_list ../obdclass liblustreclass.a
87 build_obj_list ../lvfs liblvfs.a
89 # portals components libs
90 build_obj_list ../../portals/utils libuptlctl.a
92 if [ "x$CRAY_PORTALS_PATH" = "x" ]; then
93 build_obj_list ../../portals/unals libtcpnal.a
94 build_obj_list ../../portals/portals libportals.a
96 build_cray_portals_obj_list $CRAY_PORTALS_PATH/lib_TV/snos64/libportals.a
99 # create static lib lsupport
100 rm -f $CWD/liblsupport.a
101 $AR -cru $CWD/liblsupport.a $ALL_OBJS
102 $RANLIB $CWD/liblsupport.a
104 # libllite should be at the beginning of obj list
105 prepend_obj_list . libllite.a
108 build_sysio_obj_list $SYSIO/lib/libsysio.a
110 # create static lib lustre
111 rm -f $CWD/liblustre.a
112 $AR -cru $CWD/liblustre.a $ALL_OBJS
113 $RANLIB $CWD/liblustre.a
115 # create shared lib lustre
116 rm -f $CWD/liblustre.so
117 $LD -shared -o $CWD/liblustre.so -init __liblustre_setup_ -fini __liblustre_cleanup_ \
118 $ALL_OBJS -lcap -lpthread