source: CMT/v1r14p20031120/mgr/cmt_make_shlib.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 1.5 KB
Line 
1#!/bin/sh -f
2
3#set -x
4
5lib=$1
6
7d=`pwd`
8a=`basename $d`
9if test "${a}" = "shlib" ; then
10  cd ..
11fi
12
13if test `uname` = "HP-UX" ; then
14  mkdir -p shlib
15  /bin/rm -f shlib/*
16
17  /bin/rm -f lib${lib}.sl
18 
19  cd shlib
20  ar x ../lib${lib}.a
21#####   ld -b -a shared -o ../lib${lib}.sl `ls` $2
22  aCC -Wl,-a,shared -b +Z -q -Wl,+s -Wl,+vallcompatwarnings -o ../lib${lib}.sl `ls` $2
23
24  cd ../
25
26  /bin/rm -rf shlib
27
28fi
29
30if test `uname` = "OSF1" ; then
31  /bin/rm -f lib${lib}.so
32  ld -expect_unresolved '*' -shared -o lib${lib}.so -all lib${lib}.a \
33    $2 -rpath `pwd`
34fi
35
36if test `uname` = "Linux" ; then
37  echo "BUILDING SHARED LIBRARY ${lib}"
38# ATTEMPT 2: temp for sharedlin force
39#   cp lib${lib}.a lib${lib}.so
40
41# ATTEMPT 1:
42#  mkdir -p tmpShlib
43#  cd tmpShlib
44#  /bin/rm -f lib${lib}.so
45#
46#  ld -shared -o lib${lib}.so --whole-archive ../lib${lib}.a $2 -rpath `pwd`
47#  mv lib${lib}.so ..
48#  cd ../
49#  /bin/rm -rf tmpShlib
50
51# ATTEMPT 3: (Time consummibg but seems to work...)
52# CMT should do this differently!!!!
53  /bin/rm -f lib${lib}.so
54  mkdir -p tmpShlib
55  cd tmpShlib
56  ar x ../lib${lib}.a
57
58#  ld -shared -o lib${lib}.so `ls` $2 -rpath `pwd`
59  g++ -shared `ls` $2 -o lib${lib}.so
60  mv lib${lib}.so ..
61  cd ../
62  /bin/rm -rf tmpShlib
63
64fi
65
66if test `uname` = "SunOS" ; then
67  echo 'not yet implemented on SunOS'
68#  objs=`ls *.o`
69#  if test ! "$objs" = "" ; then
70#    /bin/rm -f *.o
71#  endif
72#  ar x ../lib${lib}.a
73#  $CILINK -o lib${lib}.so *.o $2 -lc
74#  /bin/rm -f *.o
75fi
76
77
Note: See TracBrowser for help on using the repository browser.