source: CMT/HEAD/mgr/cmt_make_shlib.sh @ 446

Last change on this file since 446 was 446, checked in by rybkin, 16 years ago

See C.L. 350

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