Rev | Line | |
---|
[1] | 1 | #!/bin/sh -f |
---|
| 2 | |
---|
| 3 | #set -x |
---|
| 4 | |
---|
| 5 | lib=$1 |
---|
| 6 | |
---|
| 7 | d=`pwd` |
---|
| 8 | a=`basename $d` |
---|
| 9 | if test "${a}" = "shlib" ; then |
---|
| 10 | cd .. |
---|
| 11 | fi |
---|
| 12 | |
---|
| 13 | if 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 | |
---|
| 28 | fi |
---|
| 29 | |
---|
| 30 | if 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` |
---|
| 34 | fi |
---|
| 35 | |
---|
| 36 | if 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 | |
---|
| 64 | fi |
---|
| 65 | |
---|
| 66 | if 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 |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | |
---|
Note: See
TracBrowser
for help on using the repository browser.